Calltips/Docstring while viewing function list?

后端 未结 1 1645
旧时难觅i
旧时难觅i 2021-01-14 17:43

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 op

相关标签:
1条回答
  • 2021-01-14 18:23

    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

    • Scintilla Documentation: AutoCComplete
    • Komodo Command ID List
    0 讨论(0)
提交回复
热议问题