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

Bug 436186

Summary: Syntax-style problems should be reported on token that causes the problem
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3    
Version: 6.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Rennie CLA 2014-05-29 11:43:45 EDT
There are many places where we could improve how / where we report problems, but the biggest one is for syntax-style errors. The intention here would be to report the token that is actually causing the issue and not just on the unexpected token.

Consider the following example:

define('', function() {
function f() {
	if(true) {
	}
	}
	return null;
}
});

after the parser runs the last ')' will be tagged with a parse error. The problem is that the ')' is not the problem with the file, but is simply the first unexpected token - the problem is the extra '}' right before it.

Fixing this to flag the *real* problem token would be a huge win for:

1. directing users to actually fix the problem with the file
2. provide more accurate locations for quick fixes (eventually)

I already added support for this style of problem marking in our missing token checks, so it shouldn't be too hard to extend to any unexpected token
Comment 1 John Arthorne CLA 2015-05-05 16:19:18 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html