查看函数列表时出现呼叫提示/文档字符串?

发布于 2024-10-27 16:42:04 字数 399 浏览 0 评论 0原文

我最近刚刚转用 Komodo 进行 Python 编程,到目前为止我很喜欢它。我喜欢如果我输入一个函数名称,后跟 open-paren (,它会打开 calltip/docstring。我也喜欢如果我输入一个模块名称,后跟 .< /code>,它会打开可用函数的列表。我的问题是,当我列出函数列表时是否可以弹出调用提示/文档字符串?换句话说,我希望能够看到每个函数的作用。 (文档字符串),然后插入它并使用 ( 打开参数列表。原因是我发现自己需要一个函数,并滚动函数列表并插入看起来相关的函数以调出检查文档字符串,看看这是否正是我想要的,如果不是,则删除它并重试(通过恢复函数列表)。

抱歉, Eclipse 中存在此功能,我正在尝试模仿它。如果这很复杂,请提前感谢您的帮助。

I just recently switched to Komodo for Python programming, and I'm loving it so far. I love how if I type a function name, followed by the open-paren (, it opens the calltip/docstring. I also love how if I type a module name, followed by ., it opens a list of available functions. My question is, is it possible to get the calltip/docstring to popup when I have the function list up? In other words, I want to be able to see what each function does (the docstring) before I insert it and open the argument list with the (. The reason is that I find myself needing a function, and scrolling through the function list and inserting functions that look relevant to bring up the docstring to see if that's the exact one I want, and then if it's not, deleting it and trying again (by bringing back up the function list). This functionality is present in Eclipse, and I'm trying to mimic it.

Sorry if that was convoluted, and thanks in advance for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你げ笑在眉眼 2024-11-03 16:42:04

使用插入所选函数、添加括号并自动触发调用提示的宏。两个弹出窗口无法同时显示,因此将宏分配给键盘快捷键,并在该快捷键和撤消快捷键之间交替以添加/删除括号并显示/隐藏函数列表:

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

参考

Use a macro which inserts the selected function, adds the parentheses, and triggers the calltip automatically. Both popups cannot be shown simultaneously, so assign the macro to a keyboard shortcut, and alternate between that shortcut and the undo shortcut to add/remove parentheses and show/hide the function list:

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

References

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文