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 269444 - Error hint on JSX inline comments
Summary: Error hint on JSX inline comments
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal with 3 votes (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-28 12:10 UTC by naitsirch
Modified: 2017-01-22 22:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot that shows the issue (19.34 KB, image/png)
2016-12-28 12:10 UTC, naitsirch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description naitsirch 2016-12-28 12:10:34 UTC
Created attachment 163304 [details]
Screenshot that shows the issue

In RactJS' JSX it is allowed to use inline comments with the following syntax: 
{/* this is a comment */}

The curly braces introduce the Javascript context, where multi-line comments are allowed. Transformers like BabelJS will ignore those expressions.

But in NetBeans 8.2 this syntax will lead to an error hint saying:

> Expected an operand but found }

I'll attach a screenshot which shows the issue.
Comment 1 naitsirch 2016-12-28 12:13:24 UTC
This is associated to issue #250778
Comment 2 eduard-skyfall 2017-01-22 22:45:08 UTC
Yes, I have the same problem. It highlights comments inside curly brackets as comments but flags them as errors. 

Also any comments outside of curly brackets are not flagged as errors but they are not grayed out as comments, they stay regular black colour.


render(){
return(

/* returning a component */ <- this will NOT be grayed out and will not be flagged as an error

<div>
{ /* status */ <- this comment will be grayed out but will be flagged as an error }
</div>

);}