| Summary: | [content assist] Perfect matches should be sorted higher | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Robin Stocker <robin> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, eostroukhov, Lars.Vogel, marcel.bruch, nikolaymetchev |
| Version: | 4.4 | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 417961 | ||
|
Description
Robin Stocker
(In reply to Marcel Bruch from bug 417961 comment 8) > It looks like there is no code yet that provides access to RHS of the > assignment in CompletionEngine. The referenceContext does not provide that > information (only field declarations but not it's initializations). Any idea > how this should be solved? > > Should the type resolution consider the import statements (which are > available) and do a "is-proposed-type-a-super-type-of-any-imported-type" > thingy? If the proposal should really be smarter then it needs the imports and also the hierarchy, which, as we know, might be expensive. That's why we currently don't do this. Instead we remember the already used types in the UI layer and then use them to suggest smarter proposals (ContentAssistHistory.RHSHistory). (In reply to Dani Megert from comment #1) > If the proposal should really be smarter then it needs the imports and also > the hierarchy, which, as we know, might be expensive. Just to be clear (and make sure I did not oversee anything): I have no information of the actual RHS when CompletionEngine is triggered. So, I'd only guess that any supertype of any imported type would be a better fit than others - which is still a heuristic which will fail in many cases. It's not exactly what is requested. > That's why we > currently don't do this. Instead we remember the already used types in the > UI layer and then use them to suggest smarter proposals > (ContentAssistHistory.RHSHistory). Understood. Is this a +1 to build the supertype hierarchy for each imported type and rank proposals higher that are in this set? At least as an experiment? I'd like to know beforehand if this is the considered best solution. (In reply to Marcel Bruch from comment #2) Sorry for the delay. This somehow got lost in my inbox. > (In reply to Dani Megert from comment #1) > > If the proposal should really be smarter then it needs the imports and also > > the hierarchy, which, as we know, might be expensive. > > Just to be clear (and make sure I did not oversee anything): I have no > information of the actual RHS when CompletionEngine is triggered. Correct. > Is this a +1 to build the supertype hierarchy for each imported > type and rank proposals higher that are in this set? At least as an > experiment? I'd like to know beforehand if this is the considered best > solution. Yes, we should try this to see how it feels, but abort when the given progress monitor is cancelled (after a timeout). See CompletionProposal.CONSTRUCTOR_INVOCATION for more details. *** This bug has been marked as a duplicate of bug 175326 *** |