Bug 128073

Summary: Content Assist should give static fields and methods declared in target type higher relevance
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, eclipse, gunnar
Version: 3.2   
Target Milestone: 3.3 M1   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Markus Keller CLA 2006-02-15 13:00:25 EST
I20060215-0010

Content Assist should give constants declared in target type higher relevance, since constants from supertypes would lead to warnings anyway.

Example: I have org.eclipse.jdt.core.compiler.CategorizedProblem imported and invoke content assist after this:
    int bla= CategorizedProblem.

Expected: all the CAT_* proposals for constants from CategorizedProblem should come first; constants from the superinterface IProblem come after

Was: all constants sorted alphabetically
Comment 1 Dani Megert CLA 2006-02-16 03:26:34 EST
adapted summary: this is true for static methods as well.
Comment 2 Tom Hofmann CLA 2006-06-27 04:23:25 EDT
This would be a great 3.3 enhancement ;-)
Comment 3 David Audel CLA 2006-07-05 04:29:36 EDT
Created attachment 45739 [details]
Proposed patch

This patch give an higher relevance to static fields and methods declared in target type when the completed node is a qualified name. Member types have always this higher relevance otherwise the relevance for fields and method would be always higher.
Comment 4 David Audel CLA 2006-07-05 04:33:02 EDT
Released for 3.3 M1.

Test added
  CompletionTest#testStaticMembers1()
Comment 5 Frederic Fusier CLA 2006-08-04 10:20:59 EDT
Verified for 3.3 M1 using build I20060804-0010.