Autocompletion like NPP

61 views
Skip to first unread message

Largo84

unread,
Apr 20, 2016, 3:19:01 PM4/20/16
to leo-editor
Just now reading up on Leo's Autocompletion feature and comparing to how Notepad++ does it. It appears that Leo's AC feature is tied exclusively to the Python language. I don't edit much in NPP as I use Leo mostly, but have found that when I do, it's very convenient to have words in the document come up as suggestions as well as having closing tags inserted (HTML, XML and LaTex). Two questions:

  1. How extensible is Leo's AC feature to possibly include some of this functionality?
  2. How many others here might find that feature useful?
Regards,
Rob...........

john lunzer

unread,
Apr 20, 2016, 8:34:01 PM4/20/16
to leo-editor
There has been some recent mention of autocompletion, though at the moment just musings.

Leo's autocompletion is not merely linked to the Python language but to Leo itself, by default being populated only with the Leo namespace. Additional autocompletions (python only) can be had using the valuespace plugin, though it is a little cumbersome. I mentioned possibly integrating Jedi down the road but with absolutely timetable suggested (this is also Python only). Past efforts in the form of plugins have been made to improve autocompletion, but I think they are now defunct.

I am speaking to only what I can observe. To answer your second question, there is no doubt that all would find autocompletion, especially language agnostic, useful. Now I will answer your first question, it would be a significant effort. If it is a feature that is desired by the Leo community and Leo developers then the reasonable thing to do is to put it on a development roadmap and weigh its value against that of other roadmapped features.

In my own experience the longer I use Leo the less I desire this feature. Between Leo's ability to chop up and organize code and Leo's various search capabilities (especially those of quick-find) I find myself easily able to discover what I wish on my own. 

Edward K. Ream

unread,
Apr 22, 2016, 11:18:25 AM4/22/16
to leo-editor
On Wed, Apr 20, 2016 at 2:19 PM, Largo84 <Lar...@gmail.com> wrote:
Just now reading up on Leo's Autocompletion feature and comparing to how Notepad++ does it.

​Here is the essence of how Notepad++ handles autocompletion:

QQQ
There are two sets of candidate words that Notepad++ uses to create suggestions; these are referred to as "words" and "functions".

"Words" are taken from the current file—everywhere in the current file, comments and code...

"Functions" are pre-defined and loaded along with the lexer that corresponds to the computer language of the file.

QQQ

At present, Leo doesn't add keywords (functions). Leo's present code completer finds most words as it its, but maybe not all.

​In short, I think Leo already does pretty well in the regard.​

​Edward​

john lunzer

unread,
Apr 22, 2016, 12:49:32 PM4/22/16
to leo-editor
Though Leo is limited to Leo source and the Python standard library. 

Rob's interest was in two things, taken from your quote::
  • "everywhere in the current file"
  • "the lexer that corresponds to the computer language of the file"
    Rob was talking about an expansion of the autocompleter, to be not limited to Leo's source or the standard library but also to include "words" from the current file and also include language agnostic completions. 

    For clarification, Leo doesn't do either of these things, unless I'm sorely mistaken, in which case I ask your pardon.

    Edward K. Ream

    unread,
    Apr 22, 2016, 3:53:10 PM4/22/16
    to leo-editor
    On Fri, Apr 22, 2016 at 11:49 AM, john lunzer <lun...@gmail.com> wrote:
    Though Leo is limited to Leo source and the Python standard library. 


    Rob was talking about an expansion of the autocompleter, to be not limited to Leo's source or the standard library but also to include "words" from the current file and also include language agnostic completions. 

    ​Yes. I understand.  Feel free to file an enhancement request.

    EKR

    john lunzer

    unread,
    Apr 22, 2016, 8:03:07 PM4/22/16
    to leo-editor
    That I shall leave to Rob.

    Largo84

    unread,
    Apr 22, 2016, 8:59:45 PM4/22/16
    to leo-editor
    Thanks for the clarifying comments. Yes, for me as a writer  (not a programmer much), the NPP feature of showing all words in the current file makes writing longish documents so much easier. I will file an enhancement request understanding this may not be a high priority or even easy to do.

    Rob............
    Reply all
    Reply to author
    Forward
    0 new messages