Re: Questions about autosuggest
Todd Whiteman <[email protected]> Mon, 29 Apr 2013 17:07:42 -0700
| Newsgroups | gmane.comp.ide.komodo.general |
|---|---|
| Message-ID | <[email protected]> |
On 13-04-25 11:40 PM, Nico den Boer wrote: > There are 3 steps important. With 2 of them Komodo does not work yet as I hoped: > > 1) If you are typing the name of a variable, then 'Word suggest' (I call it Autosuggest) should be able to quickly provide information which variables are available, starting with a certain string. Example: > product_id > product_description > product_price > > Approaches: > > - In IDE's am used to a situation where I can type prod and then press ctrl-space, which pops a dialog with those three options. Then using up and down arrow followed by enter I can make a choice. > > - In the Linux console one tab is enough to complete the whole word if there is 1 options. If more, I can press tab 2 times to see a list and then continue typing enough characters followed by a tab to complete the word. > - In Komodo I can press ctrl-space to cycle through the options. In contrary to the previous 2 approaches this does not provide an instant insight in / overview which variables are available. > > Question: > Is there any way (for Komodo users) to change this behavior to make it look more like the other approaches? > Or, what should I do to have a fast-working approach which provides instant overview like I described? Hi Nico, Komodo's Complete Word functionality (ctrl+space, ctrl+shift+space) work as an iterative (one at a time), where each use of the command moves to the next iterative. This Complete Word functionality is a side feature of Code Intelligence (Ctrl+J), the later is much more accurate for Komodo's main languages (Python, PHP, JavaScript, ...). There is no way to change this behaviour in Komodo, though it certainly could be achieved using a Komodo macro. Note the Python code for the current complete word functionality is visible here: http://grok.openkomodo.com/source/xref/openkomodo/trunk/src/editor/koLanguageCommandHandler.p.py#1792 and here is a JavaScript macro example for showing custom completions in Komodo: http://code.activestate.com/recipes/577012-komodo-js-macro-show-custom-code-completions/ > > > During this phase Komodo cycles trough all variables which are defined somewhere in the whole file instead of variables defined so far. It means that the user will see irrelevant information, which implies the risk of making a mistake (choosing a variable which is not instantiated yet). > > Question: > > Is there any way (for Komodo users) to change this behavior so Komodo will only show variables defined earlier in the module or function definition? Again, not currently in Komodo, but if your using your own macro/version of this code, then anything becomes possible (only showing defined variables for example). > > 2) After typing the name of a class instance followed by a dot, a dialog pops with the names of available methods. This works as expected. > Suggestion: This dialog could also be used for the Autosuggest for variables. This dialog is Komodo's Code Intelligence system. It sounds like you are more wanting Komodo to autocomplete variable names (Komodo does this for some languages already - e.g. PHP and JavaScript). Are you using Python? As there is a request for such a feature here: http://bugs.activestate.com/show_bug.cgi?id=59937 > 3) Once a method is chosen, it is possible that it should be corrected. Example > > user = User() > # user had the following 2 methods: > user.check_password() > user.check_black_list() > > Suppose I accidently chose check_password and now want to change it to check_black_list. > Instinctively I go with the cursor to check_| and then press ctrl-space to use autosuggest to chose check_black_list. However, when I do that nothing happens ;) > > Question: > Is there any way (for Komodo users) to change this behavior? Komodo's Complete Word (ctrl+space) should still work here - perhaps I'm not fully understanding the example/context though. Also, if Komodo knows about the "User" class, then it should provide code completions when typing "user.", and if you want to re-trigger code completions, say at "user.check_", you can use the "Code > Codeintel Completions" (ctrl+J) command to show it again. Cheers, Todd _______________________________________________ Komodo-discuss mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss