Bug 150228 - Code assist for unresolved local variables
Summary: Code assist for unresolved local variables
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.3 M3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-11 05:26 EDT by Dani Megert CLA
Modified: 2007-03-29 05:07 EDT (History)
2 users (show)

See Also:


Attachments
Proposed fix (53.02 KB, patch)
2006-10-19 10:19 EDT, David Audel CLA
no flags Details | Diff
Addionnal fix (14.37 KB, patch)
2006-10-23 12:38 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2006-07-11 05:26:28 EDT
R3.2

Provide code assist for declarations that are already used later in the code:

	int f<code assist>
	System.out.print(foo);
Comment 1 Dani Megert CLA 2006-07-11 05:27:02 EDT
As discussed at the JDT Summit.
Comment 2 Olivier Thomann CLA 2006-07-11 05:46:26 EDT
Collect potential identifiers in the completion scanner.
Comment 3 Philipe Mulet CLA 2006-09-13 07:37:03 EDT
We could want to only collect identifiers not following a dot or other characters never prefixing a single name ref.
Comment 4 David Audel CLA 2006-10-19 10:19:00 EDT
Created attachment 52315 [details]
Proposed fix
Comment 5 David Audel CLA 2006-10-19 10:43:37 EDT
Released for 3.3 M3.

Test added
  CompletionTests#testCompletionVariableName16() -> testCompletionVariableName32()

Potential identifiers are collected from the end of the local variable to the end of the enclosing block.
Identifiers following a dot are ignored.
Identifiers followed by a ( or { are ignored.
Identifier starting with an uppercase are ignored because most of the type it would be a type reference and not an unresolved name.
Identifiers that would add name conflicts with another variable or field are ignored.

The source are only scanned and parsed with standard recovery (no statements recovery) to avoid to do too costly operation as binding resolution and statements recovery.
Comment 6 David Audel CLA 2006-10-23 12:38:16 EDT
Created attachment 52522 [details]
Addionnal fix

The released fix performances aren't good enough. This patch improve performance and limit to 100 the number of parsed lines.
Comment 7 David Audel CLA 2006-10-23 12:39:37 EDT
Addionnal fix released.
Comment 8 Olivier Thomann CLA 2006-10-30 14:58:26 EST
Verified for 3.3 M3 using warm-up build I20061030-0800