PHP range problems in movingranges code

Milian Wolff mail at milianw.de
Sun Jan 23 18:12:13 UTC 2011


Hey David,

I've some problems apparently in the PHP plugin with the moving range code. 
There are cases where the ranges are incorrectly updated apparently, like 
here: https://bugs.kde.org/show_bug.cgi?id=262189

Essentially this shows the problem in my eyes:

~~~~
$vara = 2;
//bla blub
$varb = 3;
~~~~ edit to:
$vara = ;
//bla blub
$varb = 3;
~~~~ syntax error on first line, parser aborts
~~~~ edit to:
$vara = ;

//bla blub
$varb = 3;
~~~~ note that context browser things that the
~~~~ range fo $varb is now inside the comment

If I would now "fix" the code, i.e. $vara = 1; it would update the code 
properly. But only since I introduced this - hack? - 
http://gitweb.kde.org/kdev-
php.git/commit/f2a27d7f6a3f9106f7490cd34a617d65b73697ff

What do you say? Is there anything I can to do improve this situation? I'd say 
Cpp does not notice this so badly since it has very good error recovery in the 
parser. But most language plugins don't have anything so good, hence improving 
the situation somewhat would be good I'd argue.

I also wonder how there can be such a difference between syntax highlighted 
code and what the context browser plugin sees, shouldn't it both use the most 
recent RangeInRevision == MovingRange?

Bye

-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110123/16abf33a/attachment.sig>


More information about the KDevelop-devel mailing list