Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362873 - Wrong highlighting of local variable after duplicate declaration
Summary: Wrong highlighting of local variable after duplicate declaration
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-04 05:17 EDT by Victor Homyakov CLA
Modified: 2013-06-19 11:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.