作者:Quiet静以修身 | 来源:互联网 | 2023-05-17 17:53
我刚刚转到Komodo进行Python编程,到目前为止我很喜欢它.我喜欢如果我键入一个函数名称,然后是open-paren(它会打开calltipdocstring.我也很喜欢如果
我刚刚转到Komodo进行Python编程,到目前为止我很喜欢它.我喜欢如果我键入一个函数名称,然后是open-paren(它会打开calltip / docstring.我也很喜欢如果我键入一个模块名称,然后是.,它会打开一个可用函数列表.我的问题当我有函数列表时,是否有可能弹出calltip / docstring?换句话说,我希望能够在插入之前看到每个函数的作用(docstring)并打开参数列表(.原因是我发现自己需要一个函数,滚动函数列表并插入看起来相关的函数来调出文档字符串,看看是否是我想要的那个,然后如果不是,删除它和再次尝试(通过恢复功能列表).这个功能在Eclipse中出现,我试图模仿它.
对不起,如果这是令人费解的,并提前感谢您的帮助.
解决方法:
使用插入所选功能的宏,添加括号,并自动触发calltip.两个弹出窗口都无法同时显示,因此将宏指定给键盘快捷键,并在该快捷方式和撤消快捷方式之间切换以添加/删除括号并显示/隐藏功能列表:
komodo.assertMacroVersion(2);
if (komodo.view && komodo.view.scintilla) { komodo.view.scintilla.focus(); }
var editor = ko.views.manager.currentView.scimoz;
var cursor_character = editor.getCharAt(editor.currentPos - 1); //get cursor position
editor.autoCComplete(); //autocomplete selected function in list
editor.copyText(1,"("); //add left parentheses to buffer
if(cursor_character > 96 && cursor_character <123)
{
editor.paste(); //add left parentheses to editor after a function name
}
ko.commands.doCommand("cmd_triggerPrecedingCompletion"); //trigger calltip or function list
参考
> Scintilla Documentation: AutoCComplete
> Komodo Command ID List