pythonautocompletesublimetext3sublime-text-pluginsublime-anaconda

Autoinsertion of parenthesis for callables


I have grown keen on Sublime Text 3.

But one feature I painfully miss is the automatic insertion of parenthesis upon choosing a callable from the autocomplete/hint box. Sublime/Anaconda give me print but not print ().

Can this behavior I seek maybe unlocked with existing resources, like a setting in Sublime/Anaconda or a different plugin I have not yet found?

In case such is not possible. Can you give me any idea how complex it would be to write a plugin for it? (For simplicity restricting use case to python, maybe JavaScript here).


Solution

  • Reproducing what I already answered in Github.

    Hi, the keystroke for the ( character has meaning in anaconda, it tells anaconda that signatures is ready to be displayed, without the keystroke you will not get signatures always.

    Anyway, did you tried to enable the parameters completion? This will add the parenthesis (and other parameters for you) and signatures will not be displayed as you already have the parameters in your code so you don't need to check for the function signature.

    This is directly extracted from the configuration file:

    /*
        If complete_parameters is true, anaconda will add function and class
        parameters to its completions.
        If complete_all_parameters is true, it will add all the possible
        parameters, if it's false, it will add only required parameters
    */
    "complete_parameters": false,
    "complete_all_parameters": false,