Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 426835

Summary: The 'missing semicolon' warning appears too often
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, mamacdon
Version: 5.0   
Target Milestone: 6.0 M1   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2014-01-28 16:12:04 EST
Consider the following invalid snippet:

var foo = {};
(var foo.bar

if you check the annotations on the second line after eslint runs you get the following:

Multiple annotations:
 Syntax error on token 'var', delete this token.
 Syntax error on token 'foo', delete this token.
 Syntax error on token '.', delete this token.
 Syntax error on token 'bar', delete this token.
 'bar' is not defined.
 Missing semicolon.
 Missing semicolon.
 Missing semicolon.

I would expect at most one missing semicolon warning - if any at all since the statement is incomplete. For reference the above warnings are reported after 'foo' after '.' and after 'bar'.

Should we try to suppress / ignore warnings like that that are confusing in a broken statement context?
Comment 1 Mark Macdonald CLA 2014-01-28 17:46:01 EST
(In reply to Michael Rennie from comment #0)
> Should we try to suppress / ignore warnings like that that are confusing in
> a broken statement context?

Yes, I think it would reduce confusion if we prevented these cascades of warnings. If a token has a parse error on it, we could just throw away any "semi" warnings for that token.
Comment 2 Michael Rennie CLA 2014-04-08 16:45:25 EDT
Pushed fix to:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=1265e93108c685be6b8964e2b1745911f71656d9

I added some post-processing to filter out reported eslint problems that are reported on the same node as a parser error. 

Closing as fixed. If we think we should do more filtering we can reopen or create a new bug.