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

Summary: Error hint on JSX inline comments
Product: javascript Reporter: naitsirch <naitsirch>
Component: EditorAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Screenshot that shows the issue

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>

);}