NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Syntax error highlighting - A suggestion


Joined: 22 Aug 2005
Posts: 7
Reply with quote
I think the parse error highlighting in PhpED is a very useful feature; However in its current implementation, it can be extremely annoying and distracting.
The problem is that it will highlight errors in statements which are in the process of being written.
Maybe a better way of doing this would be to exclude the statement block in which the cursor currently lies from syntax checking?
Any thoughts?
View user's profileFind all posts by jogleurSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Actually it does not highlight the errors in the statement block being written Smile if there is no error. Code Inight does its best to avoid wrong errors in all cases.
And with incomplete statements the errors are shown for the next statements. For example if you have
<?php
|
$a = 55;

and want to add $b = 44 in the position maked with |, you'll see errors highlighted in the next line while typing the new statement and will not see any errors in the block you're typing. As soon as you finish the statement, the errors/warning won't be shown anymore.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 Aug 2005
Posts: 7
Reply with quote
Quote:
Actually it does not highlight the errors in the statement block being written if there is no error. Code Inight does its best to avoid wrong errors in all cases.


Quite right, but in fairness it is hard to avoid an error in a statement in the process of being written, when it is being inserted into existing code - impossible in fact Very Happy

$b=1;
echo $ <-----incomplete statement haven't yet put in b;
$b++; <-----This line highlighted, because with no ; it is parsed as same statement

Quote:
And with incomplete statements the errors are shown for the next statements. For example if you have


Well my point is exactly that - When a statement is incomplete - i.e before the ; is written, then the succeeding line is rightly parsed as the same statement.
It was my suggestion that this statement be ignored by phped when error checking.
View user's profileFind all posts by jogleurSend private message


Joined: 21 Oct 2004
Posts: 81
Location: UK
Reply with quote
I mentioned this before - it's annoying. I ran into a variation today in a Smarty template file that had <html> and <body> marked as errors because they weren't closed - this template file was just the header.

Not checking the next line (with content) would be good. I'd also like to be able to turn it on and off with a keyboard shortcut. I'd like to only turn it on for a second or so before uploading/testing/debugging, for a quick check over my code, and then turn it straight off again, after fixing any errors it finds.
View user's profileFind all posts by QuboidSend private message
Syntax error highlighting - A suggestion
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic