This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 248494 - Incorrectly displaying syntax errors
Summary: Incorrectly displaying syntax errors
Status: RESOLVED WORKSFORME
Alias: None
Product: javascript
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.0.1
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: Roman Svitanic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-07 16:11 UTC by yaronel
Modified: 2015-03-02 09:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Syntax error in JSON object. (160.38 KB, image/png)
2014-11-07 17:15 UTC, yaronel
Details
CSS syntax highlighting stuck (178.00 KB, image/png)
2014-11-10 14:45 UTC, yaronel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yaronel 2014-11-07 16:11:31 UTC
Netbeans highlights syntax errors in plain old javascript where they do not exist.
Not using any templating engine or anything that introduces unsupported 
characters.

This started happening ever since I upgraded to Netbeans 8. It does not happen in Netbeans 7+.
 

I suspect that the syntax checker is not hung up by some other process and is not running. That is because if I keep the tab open for a period of time (a few minutes) it eventually hides the errors.

Also something that might help, sometimes when it happens it says it's searching for external changes, and it says the process is suspended and it just hangs.
Comment 1 yaronel 2014-11-07 17:15:37 UTC
Created attachment 150360 [details]
Syntax error in JSON object.

Here is an example of errors in a JSON object.
As you can see there is no actual syntax error in the object.

Notice the "checking for external changes" on the bottom right.
It shows sometimes, and looks like it's hanging.
Comment 2 Petr Pisl 2014-11-10 04:45:56 UTC
I can not reproduce on a simple json file. Is it possible to attach the file, where it happens? What is the message of the error?

Thanks.
Comment 3 yaronel 2014-11-10 14:13:53 UTC
I am sorry I can't attach the file, and I am not sure it will help anyways.
It doesn't seem to happen in specific files, just sporadically on whatever file you are currently working. It really looks like whatever job that suppose to validate the syntax is just not running for a while, maybe because it gets stuck doing a different job? That's why eventually when it gets to it the errors disappear. But that can take a few minutes.

Also note, the example I attached is not a JSON file, but a javascript script that happens to have a JSON object in it. Though, I can confirm I encountered this problem with a pure JSON file as well.

The error message is something unrelated, such as "Expected a } but instead got ," - something a long these lines. I can't reproduce the problem on demand, it just happens during the day while I am working with Netbeans.

Let me know if there is any other information I can produce.

Thanks.
Comment 4 yaronel 2014-11-10 14:45:19 UTC
Created attachment 150396 [details]
CSS syntax highlighting stuck

This seems to me related to the same problem.
Notice the CSS code is just black, and not highlighted for syntax.
At the bottom right, the same notice "Checking for external changes..." appears and seem to be hanging.

After a couple of minutes the message disappears and the syntax highlighting works again.

I am using a git repository for this project. Maybe that is somehow related.
Comment 5 Petr Pisl 2014-11-10 14:47:45 UTC
The css editor is different from js editor. Every editor has its own parser/lexer/hints .... It's hard imagine that is somehow connected. If there is a reproducible case, it would help a lot.
Comment 6 yaronel 2014-11-10 15:16:14 UTC
I see.

Well, the more I think about it, it seems to be more of a global issue then relating only to the javascript / css parser.
It keeps checking for external changes and when it does everything seems to be halted. Syntax highlighting, code completion, go to declaration.

What is it doing checking for external changes? And why does it stuck everything else?

I am sorry I can't give you a reproducible example, but you can see from the screenshots that it is happening to me frequently and in different places through the day. So there is some problem here.
Comment 7 Petr Pisl 2014-11-11 09:51:40 UTC
Please, could you attach your userdir[1] after the problem situation? Probably there can be a some log, which could help. Thanks.

[1] http://wiki.netbeans.org/FaqWhatIsUserdir
Comment 8 yaronel 2014-11-11 14:05:10 UTC
Which log file do you want me to attach?
Comment 9 Roman Svitanic 2015-03-02 09:38:04 UTC
I am not able to reproduce the issue on the current dev build:
Product Version: NetBeans IDE Dev (Build 20150302-84205dde7ed0)
Java: 1.7.0_75; Java HotSpot(TM) 64-Bit Server VM 24.75-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_75-b13
System: Mac OS X version 10.10.2 running on x86_64; UTF-8; en_US (nb)

If you can still reproduce the issue using recent dev build, please attach messages.log and reopen this issue. Moreover, it would be great if you could attach JSON/JS file on which the issue can be reproduced (e.g. refactored version of your code). Thanks!