News for PHP in KDevelop
So, after a period of silence I present you an unsorted list of features and bug fixes I did to the PHP plugin for KDevelop in the last few weeks:
added support for path autocompletion after require / include statements: This shares code with the Cpp plugin and it’s completion after #include. I plan to use this autocompletion eventually also for functions accepting filenames or paths. Think of fopen, file_get_contents etc. pp. So far only URLs that are covered by an open project can be completed. We will need support for custom include paths so we can support e.g. global PEAR or framework installations.
worked around a bug where the “schedule all project files for parsing” had no affect. Apaku is currently working on making some internal changes so I can remove the workaround and fix this properly. With this fixed/worked around you should retry the PHP plugin along with frameworks or similar to see how well it works. Just make sure to have the framework inside your project so it gets parsed.
fixed code completion of static class members for classes that where not defined in the current file
by sharing code with the cpp plugin I made it possible to show information about includes on hover. You can open the file from that popup or just see what classes, functions, variables etc. are defined there and jump to them quickly.
report errors when the user tries to include a directory
totally rewrite a huge part of the code completion: It now utilizes the token stream and can hence work much more reliably. Also the code is much cleaner in my opinion and it should be easier to extend its functionality. If you spot places where you think no code completion should happen or vice versa, please report that to me!
don’t crash on empty includes (i.e.
ignore xml declarations (i.e.
<?xml ... ?>)
support implicit declarations of referenced arguments, esp. important for e.g.
[preg_match](http://www.php.net/preg_match)("#...#", $string, $matches);, before the
$matcheswas said to be undefined. Additionally references should be marked and shown as such now in the popups of e.g. function arguments.
support implicit array declarations, e.g.
$a = 1; // now $a is an array
fix bug which made the class browser not aware of changes in PHP class structures. Now we can see new classes, methods and members directly after writing them in a PHP file.
/// commentsyntax for doc-comments, especially useful for type hints of variables.
report error when someone tries to declare a class constant with an invalid type (i.e. not bool, int, float or string)
I’m very happy to say that we seem to get more and more (happy) users!