查看功能列表时出现Calltips/Docstring? [英] Calltips/Docstring while viewing function list?

查看:193
本文介绍了查看功能列表时出现Calltips/Docstring?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近刚改用Komodo进行Python编程,到目前为止我很喜欢它.我喜欢如果我键入一个函数名,然后输入open-paren (,它将如何打开calltip/docstring.我也很喜欢如果我输入模块名称,然后输入.,它将打开可用功能列表.我的问题是,当我有功能列表时,是否有可能使calltip/docstring弹出?换句话说,我希望能够在插入函数并使用(打开参数列表之前查看每个函数的作用(文档字符串).原因是我发现自己需要一个函数,然后在函数列表中滚动并插入看起来相关的函数,以调出该文档字符串,以查看是否正是我想要的字符串,如果不是,请删除该字符串,然后重试(通过调出功能列表). 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.

推荐答案

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

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

参考

  • Scintilla Documentation: AutoCComplete
  • Komodo Command ID List

这篇关于查看功能列表时出现Calltips/Docstring?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆