On Wed, Apr 7, 2010 at 10:04 AM, tfer <tfethers...@aol.com> wrote: > Auto-completion is just a subset of what Leo is missing in the area of > "entry assistants". Templates (best shown by 'Textmate'), are equally > important, not to leave out my favorite, "expansions".
I agree. Templates and expansions quickly become essential. > By auto-completions, I assume you are talking about providing a data > structures containing, (for python), functions, variables, and class > methods/attributes, together with dot qualified "namespace-paths" that > may be needed to access them, (depending on what is visible to the > code fragment containing the cursor). Yes. As today's work shows, it's not difficult to do better than Python's inspect module. That is, a static analysis can reveal the members of modules, classes, methods and functions without having to import modules or instantiate classes. However, the real problem is inferring (deducing) the type of x.y.z given only x as the starting point. In general, this is a hard problem. This morning I thought that some slight of hand might allow the use to specify types "the first time". This can be done, but notice that given x, we still have to specify the type of x.y, and similar for longer chains. I doubt this scheme would be pleasant to use. Imo, we really do want to do type inference. > Following Visual Studio, the UI for such completions are usually > presented by an 'in-line' drop down list that updates itself with > fewer suggestions if you continue to type, (I find a lot of room for > improvement in this, but I'll talk about that elsewhere. Right. The trick is to present all and only the completions that are actually valid. Too many and the list quickly becomes unbearably long. Too few and the list doesn't show all choices. > > Most of this work has only addressed python, I suggest that it starts > to be factored into language specific files in the spirit of the > colorizing files in the modes directory. In fact they could be stored > in that directory, as 'modes' in other editors control more than just > the syntax coloring rules. Alternatively, we could use subfolders, > e.g.: > > modes/ > -- colorers/ > -- completions/ > -- expansions/ > -- templates/ > > and just use a convention that the language specific files start with > the name of the language, e.g.: > python_cmpltns.py > python_expnsns.py > python_tmplts.py Something like this could indeed be used for templates and expansions. I think, however, that Leo (possibly with the help of ctags) should handle completions. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to leo-edi...@googlegroups.com. To unsubscribe from this group, send email to leo-editor+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.