Bug 128073 - Content Assist should give static fields and methods declared in target type higher relevance
Summary: Content Assist should give static fields and methods declared in target type ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: 3.3 M1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-15 13:00 EST by Markus Keller CLA
Modified: 2006-08-04 10:20 EDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (36.84 KB, patch)
2006-07-05 04:29 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 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.