Hi All,
I've written a quick and dirty script for code completion for PHP on TextMate. details here: http://ian.ardes.com/phpcc
Cheers, Ian
hi Ian, Looks very cool! Thanks... nice web page as well BTW.
On 4 Nov 2004, at 12:02, Ian White wrote:
I've written a quick and dirty script for code completion for PHP on TextMate. details here: http://ian.ardes.com/phpcc
On 4. Nov 2004, at 12:02, Ian White wrote:
I've written a quick and dirty script for code completion for PHP on TextMate. details here: http://ian.ardes.com/phpcc
Wow! That is indeed very cool! :)
I'll be adding $TM_BUNDLE_DIRECTORY to one of the next betas, then you can just put the whole thing into a bundle (i.e. the PHP manual) and ship that instead (so it should be a drag'n'drop install).
Also, structuring snippets, macros, commands, etc. is really high on the to-do now with all this cool third party stuff! :)
Kind regards Allan
Many, many, thanks for TextMate!
I'll be adding $TM_BUNDLE_DIRECTORY to one of the next betas, then you can just put the whole thing into a bundle (i.e. the PHP manual) and ship that instead (so it should be a drag'n'drop install).
Great, i'll sort that out when it appears.
<probablyuselessideas>
I'd like to eventually make a code completion add-on (probably not written in php) that does context sensitive completion, and which builds a database per project of project symbols. e.g. when I type '$this->' and hit the complete key, I'll get a list of methods and properties of the current class (and methods of parent classes). The compiler would use PHPDoc comments and class and function profiles to build the completion database. It strikes me that having a TM_ variable that gives the first line of each enclosing code blocks would be extremely useful for looking up the correct set of symbols. Any chance of this? Or suggestions as to some other way of doing it?
Also, regarding commands, it would be nice if commands could be 'chained', using the output of one as the input of the other. In conjunction with this, if there was a new output type 'list' (like a snippet popup) then the user's selection could then be fed into a new command. That way, code-completion could be interactive.
One last idea, could there be (is there?) some way of storing script variables across command executions?
</probablyuselessideas>
Thanks again for TextMate, truly awesome.
Ian
On 5. Nov 2004, at 10:55, Ian White wrote:
It strikes me that having a TM_ variable that gives the first line of each enclosing code blocks would be extremely useful for looking up the correct set of symbols. Any chance of this? Or suggestions as to some other way of doing it?
If you can give me a language neutral definition of “the first line of each enclosing code block” I may consider it ;)
But you have TM_FILEPATH and TM_LINE_NUMBER, so you should be able to find this stuff yourself -- although come to think of it, this requires the file to be saved. You could set the input to the entire document to get the actual file instead.
Another option would be for me to do minimal AppleScript support (something which I'm only postponing because I don't think it's that important ATM).
Also, regarding commands, it would be nice if commands could be 'chained', using the output of one as the input of the other. In conjunction with this, if there was a new output type 'list' (like a snippet popup) then the user's selection could then be fed into a new command. That way, code-completion could be interactive.
Yes, I do see the benefit here. I'll think some more about how to best achieve the inter-activeness you seek.
One last idea, could there be (is there?) some way of storing script variables across command executions?
No, two problems with this is 1) how to tell TM what to keep and 2) which scope should the variables have (file, project, session, global).
What I could do is introduce TM_FILE_GUID, TM_PROJECT_GUID, and TM_SESSION_GUID. These could then be used as prefix when storing stuff in /tmp and would serve as scope-indicators.
Hi Ian,
I've written a quick and dirty script for code completion for PHP on TextMate. details here: http://ian.ardes.com/phpcc
Very cool! :)
My only gripe is that the lookup is a bit slow on my 1.33GHz Powerbook and that when the tooltip is there the next key you press is used to dismiss the tooltip, instead of typing. So when I do:
mysql_fetch*esc* I get: mysql_fetch_ When I then type the 'a' key for fetch_array, the tooltip dissapears and my key is not entered.
For the rest, I love this hack! :)
On 6. Nov 2004, at 14:25, Joost Schuttelaar wrote:
My only gripe is that the lookup is a bit slow on my 1.33GHz Powerbook
Probably it's the PHP startup time, for the lookup you can bypass PHP by instead using this command: find ~/local/phpcc/lookup -name "$TM_CURRENT_WORD*" -exec basename '{}' ;
and that when the tooltip is there the next key you press is used to dismiss the tooltip, instead of typing. So when I do:
Yes, that'd be my fault, although it was a conscious choice. I'll see if I can't make it so that all keys except escape (and maybe cmd-.) will fall through.
On 2004-11-04, at 12.02, Ian White wrote:
Hi All,
I've written a quick and dirty script for code completion for PHP on TextMate. details here: http://ian.ardes.com/phpcc
Cheers, Ian
Oh my god! How could I have missed this? This is really awsome!
On 2004-11-07, at 08.44, Allan Odgaard wrote:
On 6. Nov 2004, at 14:25, Joost Schuttelaar wrote:
and that when the tooltip is there the next key you press is used to dismiss the tooltip, instead of typing. So when I do:
Yes, that'd be my fault, although it was a conscious choice. I'll see if I can't make it so that all keys except escape (and maybe cmd-.) will fall through.
It's these little changes that can make so big a difference :) Would be wonderful if you considered making the pressed key appear in the text-document.
Kind Regards ivar