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

Bug 362873

Summary: Wrong highlighting of local variable after duplicate declaration
Product: [WebTools] JSDT Reporter: Victor Homyakov <vkhomyackov>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Victor Homyakov CLA 2011-11-04 05:17:30 EDT
When local variable is declared twice, it is highlighted as a different variable. Example:

function foo() {
  var x = 1;
  x = x + 1;

  var x;
  x = x + 1;
  return x;
}

After positioning cursor at the first "x" it is highlighted only on the 2nd and 3rd lines. After positioning on the last "x" it is highlighted only on lines 5,6,7.

Expected behavior:
Either produce error/warning about duplicate declaration, or highlight all occurrences, or both.
Comment 1 Victor Homyakov CLA 2012-07-06 04:20:54 EDT
Bug is still not fixed in WTP 3.4.0.