I like idea when lexers/parsers are havenât connection to specific project. Rather than some kind of API IPHPSettings ;)
Wy we need for highlighters for each php version for now:
1. New keywords should be highlighted based on php version.
2. Highlighting after short echo "<?=â should be always enabled since 5.4, on older version only when short tags are enabled
3. ASP tags are perfectly valid until 5.6. So yes, itâs still required for 5 - 5.6
4. Context sensitive keywords, since PHP for ex. âforEachâ can be used as method name. Itâs not clear what will happen in next PHP versions. I personally prefer correct highlighting in this cases..
Maybe in the future (couple years later), when we drop PHP 5.* support will be able to keep one highlighter between PHP Versions with configurable keyword visibility. Or maybe itâs possible to write one universal, confgurable highlighter for ex. in ANTLRv4 ? Â
+1 from me for removing IProject from lexer related elements and
one highlighter for all versions
I think removing IProject from code is very good idea. In general
it would be nice to decouple lexer/parser code from Eclipse api as
much as possible. I can imagine that lexer/parser/ast source code
would be interesting as separate bundles without
At the moment I cannot imagine any problem with only one
highlighter. Parser will do the validation and that should be
enough from user point.
I have a technical question :)
While I worked on bug 498877, I saw that the lexers need project
informations for various operations (like to retrieve task tags
defined for a specific project or to retrieve the PHP version of a
project to decide which highlighter version to use, ...).
Sadly there are cases where lexers are created on-the-fly by
eclipse to do some specific operations (document reparsing,
reconciling or workspace builds are done on temporary&buffered
documents for example) that are "detached" from any project
Technically speaking, in those cases we work with project
properties set to null ;)
So I would like to remove in the future all traces of "project"
properties inside of php tokenizer, highlighters, PhpScriptRegion,
PhpTokenContainer,... as it is not the way to go (looking how
eclipse works). A good example is the hacky way used to set the
project for document lexers in the PHPStructuredEditor class
Clearly that's a hack to find a way to provide a project value to
lexers created on-the-fly by eclipse ;)
For now in the PDT lexers, project informations seem only necessary
- see if a project supports ASP tags (is this still used?)
- retrieve task tags defined per project (patch for bug 498877 will
- choose the highlighter version depending on project
So my question is:
why do we actually need a highlighter per php version? Why just not
use the highlighter for the most recent supported php version
Is there any reason to not highlight most recently added php
keywords on older php versions (even if not "supported")?
It would simplify a lot of code just to use one highlighter + php
tokenizer + phpdoc scanner everywhere ;)
pdt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit