First off: it's great that this subject comes up, for indeed: (automatic) code completion is also the TOP1 item on *my* TextMate wishlist.
But let me grab the opportunity of blatantly list some of the features I would request for such code completion.
On 6-dec-2006, at 22:41, thomas Aylott wrote:
I think we should come up with a brick simple library that will let you do completions.
Then the hardcode d00ds can get on with extending and perfecting the completion library.
While everyone actually gets the chance to use it.
I'm not sure if I got you right, thomas. I think that a flat (Library) file is the not the solution swe're looking for here –other than just a temporary one too keep the svn manageable ;)–. I think the system for our code completion should be much more complex and *context-aware* than that. Like the filename-filepath-completion-for-textmate you showed; that didn't work with a flat library file, or did it?
On 7-dec-2006, at 0:39, Jacob Rus wrote:
I don't think it should just be alphabetical; for instance, functions already used in the current document should come sooner than others.
Indeed, or even better: that it has the learning behavior –like the ⎋ completion in TextMate already has now– : frequently (or previously) used completions will show up first.
@Ed Singleton:
That would be great!
I think python would be a good case to start building such a smart system, because of its extensive introspection. Take a look at ipython (the alternative interactive python interpreter), if you haven't already.
Good code completion systems would strongly work with the context in which the completion is requested. And luckily for us TextMate already has a great scope (context) system. For code completions that would imply that only the functions, methods or properties show up that object or context is susceptible to.
Or it could be even more context aware, for instance that it also takes into account in which code block you are working.
E.g. (seen in Xcode) Inside the method doSomethingWithFoo: of class Bar, we call a totally different class Baz, which happen to have the same method doSomethingWithFoo. Then before you type anything more than `[Baz ` it already show doSomethingWithFoo as the first completion.