At first glance, the new PHPCC works as advertised. Nice!
You asked for wishes, so here goes: - what about custom functions? I'd love to get code completion for functions not defined in the current file. In an ideal world, TM would scan through the Project and use all those functions for code completion, including snippits. Somewhat less ideal but still cool would be a way for us to define custom PHP function signatures, like the old phpcc had.
-moshe
On 2 Jun 2005, at 19:05, Moshe Weitzman wrote:
At first glance, the new PHPCC works as advertised. Nice!
Thanks for the input, Moshe, and please keep on testing the bundle as it gets updated. (beta3 should be released later on today, with various fixes and new features. I'll post a mail to the ML when it's ready.)
You asked for wishes, so here goes:
- what about custom functions? I'd love to get code completion for
functions not defined in the current file. In an ideal world, TM would scan through the Project and use all those functions for code completion, including snippits.
Yes, this feature has always been part of the greater plan - as outlined in the PHPCC ToDoList doc (Automation->Run Command-
PHPCodeCompletion->Show ToDo List or Ctrl + Help ) included in the
Bundle.
The reasons to why this functionality is not yet in this bundle is entirely due to me not knowing HOW to implement it. I have a few ideas, but keep hitting some limitations/problems in most of them. If anyone can think off a solution that would work nicely, please let me know.
My current favourite is: some form of parsing of phpdoc comments in defined functions/classes/methods, but that's not ideal either for a variety of reasons. Alternatively we could always roll back to user managed input of the completion. (ie: a command that you run on the function declaration you would want a completion for)
Somewhat less ideal but still cool would be a way for us to define custom PHP function signatures, like the old phpcc had.
If everything goes to plan today, then beta3 will deal with much of this feature request. IF I hit some problems (or lack of time) then it'll be beta4 that will do it.
Please note though, that the default PHP.bundle already has a lot of snippets in it for normal control items (just like the default user stuff in phpcc originally) so you can type
Kind regards,
Mats
---- "TextMate, coding with an incredible sense of joy and ease" - www.macromates.com -
On 3 juin 05, at 11:16, Mats Persson wrote:
The reasons to why this functionality is not yet in this bundle is entirely due to me not knowing HOW to implement it. I have a few ideas, but keep hitting some limitations/problems in most of them. If anyone can think off a solution that would work nicely, please let me know.
One option is to use ctags. It looks like it's there by default in Tiger, but I'm a little bit disappointed with the results on PHP and Ruby files.
We definitely need something better....
It looks obvious that Textmate it(him?)self is the most appropriate tool to parse our source code, using the new syntax bundles. I can't imagine that Allan doesn't have plans :-)
Dominique.
On 3 Jun 2005, at 15:03, Dominique PERETTI wrote:
On 3 juin 05, at 11:16, Mats Persson wrote:
The reasons to why this functionality is not yet in this bundle is entirely due to me not knowing HOW to implement it. I have a few ideas, but keep hitting some limitations/problems in most of them. If anyone can think off a solution that would work nicely, please let me know.
One option is to use ctags. It looks like it's there by default in Tiger, but I'm a little bit disappointed with the results on PHP and Ruby files.
Virtually clueless about ctags or how to work with them, so I'll leave them alone :)
It looks obvious that Textmate it(him?)self is the most appropriate tool to parse our source code, using the new syntax bundles. I can't imagine that Allan doesn't have plans :-)
The obvious choice and yes, it's already implemented, albeit slightly crudely at the moment, in beta3 of PHPCC. Due to be released over the weekend or early next week.
Kind regards,
Mats
---- "TextMate, coding with an incredible sense of joy and ease" - www.macromates.com -
On 6/3/05, Mats Persson mats@imediatec.co.uk wrote:
Virtually clueless about ctags or how to work with them, so I'll leave them alone :)
As a fan of Exuberant ctags (http://ctags.sourceforge.net/) I'd still like to see this done utilizing them rather than something specific to Textmate. That would let me have completion capability in both Textmate and VIM using the same set of tags.
That said, the work you're doing is great and I'll no doubt be happy with whichever method is used.
On 3 Jun 2005, at 19:55, Jack Baty wrote:
Virtually clueless about ctags or how to work with them, so I'll leave them alone :)
As a fan of Exuberant ctags (http://ctags.sourceforge.net/) I'd still like to see this done utilizing them rather than something specific to Textmate. That would let me have completion capability in both Textmate and VIM using the same set of tags.
Well, Jack, I'm writing the solution in the best way I know how to, but if you could rework things into ctags and it would work the same then by all means do so once the solution is 'completed'. All the info is in a simple PHP array, so you should be able to rewrite it into many other formats if you wish.
My main reason behind redoing the original phpcc stuff was that 3700+ small text files was not ideal for the SVN, and it was a bit big size wise, as well as missing some bits of information that I liked to include.
That said, the work you're doing is great and I'll no doubt be happy with whichever method is used.
Thanks, and if you think beta2 is great then I would like to know what you will think about beta3. Even greater ?? :)
Kind regards,
Mats
---- "TextMate, coding with an incredible sense of joy and ease" - www.macromates.com -
Though Mats will probably publish a new version of his PHPCompletions bundle tommorow, I tried to do a completion and snippet thing for user defined functions.
There is a small bundle here: http://public.serenity.de/PHP2.zip There are two commands defined (with bad keyboard shortcuts, I know, just for testing, though): !completion - Shows a tooltip of all functions beginning with the current word (works if there is no current word, too) !snippet - completes the parameter list of the function that is named like the current word. Must match exactly.
What it does:
- parse the current file for use of include and include_once. syntax should not matter: include "test.php", include_once ('test.php') should work - check if the included file exist. It assumes a relative path! - use CTAGS to find the symbol declaration matching the current word in TM - show the popup or insert the snippet
Things to mention: I am just scanning the current file for includes, not recursive includes. Selected text will be replaced.
Note: This is only a fast hack, to see how it could work.
Soryu