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

Bug 422787

Summary: [eslint] Region flagged by "Missing semicolon" is too large
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: JS ToolsAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: maciej.bendkowski
Version: 5.0   
Target Milestone: 5.0 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2013-11-28 12:27:50 EST
1. Create a js file with this code:
foo(function() {
   // blah blah
})
2. You get a "missing semicolon" warning on the entire 3 lines. 

It would be nicer if the semicolon message was just on the closing ')' of the function call. Sometimes having it on the entire region obscures more valuable warnings inside the region.
Comment 1 Maciej Bendkowski CLA 2013-11-29 08:46:51 EST
I think it's a more general problem. I've got the same issue in case of missing parentheses. The whole function up to where the missing bracket should be was marked with the warning.
Comment 2 Maciej Bendkowski CLA 2013-11-29 09:04:32 EST
Also, I noticed this particular warning occurs when there's a missing comma ',' instead of a missing semicolon ';'.
Comment 3 Mark Macdonald CLA 2013-11-29 11:19:16 EST
(In reply to Maciej Bendkowski from comment #1)
> I think it's a more general problem. I've got the same issue in case of
> missing parentheses. The whole function up to where the missing bracket
> should be was marked with the warning.

Opening a separate bug for that. There's supposed to be a "Parse error" shown at the end of the file, but it's being hidden.

> Also, I noticed this particular warning occurs when there's a missing comma ',' 
> instead of a missing semicolon ';'.

Can you post the code you're using? In general, recovering from a parse error can cause cascading errors which are not intuitive. There may be something the validator can do to highlight the root cause and suppress distracting messages.
Comment 4 Mark Macdonald CLA 2013-12-06 13:52:16 EST
Fixed. The warning now appears only on the token before where the semicolon should be.

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