[TxMt] Text autocomletion, BBAutoComplete

soryu2 at gmail.com soryu2 at gmail.com
Tue Aug 9 17:38:59 UTC 2005

> Soryou (on the IRC) wrote a php completions solution that scanned  
> your current code for class/function declarations - even in  
> included project files, so you might want to check that one out for  
> ideas. Don't remember the URL at the moment.

http://public.serenity.de/php2/ is the link for this providing the  
zipped bundle and the readme. I wrote this to complete function names  
of user defined functions in the same and all included files. (See  
the readme for details, it works project wide, too)

For the parsing of source files, I use ctags which is able to extract  
things like function definitions for a variety of programming  
languages. ctags evolved with vi/vim I believe to jump to certain  
functions definitions and such in the source code. My command uses it  
for that purpose, too. ctags in included in osx, at least in Tiger,  
otherwise it is a sourceforge project.

My code to call and parse the php input and the ctags output is also  
written in php.

If this thread was mainly about completions of source code for  
programming, then ctags provides a way to use it across different  
programming languages. Though I waited to port it any further for  
tm's plugin architecture and Allan's own planned completion engine.

> Except that introspection usually (always?) works with the  
> _current_ program, so the completer would need to somehow load the  
> completee in order to gain any advantage from introspection; unless  
> there is some magic in Python I don't know about. In ruby it would  
> be like this, at least.

One of the 'problems' I had for my php completions is that a user  
always can do things like include($HOME_DIR."/this.php"). We surely  
cannot cope with this because the variable is only available at  
runtime. And I don't know about your ruby or python magic…


More information about the textmate mailing list