Bug 196119 - [assist] package proposals could be unqualified
Summary: [assist] package proposals could be unqualified
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-11 04:34 EDT by David Audel CLA
Modified: 2019-04-07 09:31 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2007-07-11 04:34:31 EDT
from bug 188876

package proposals are always fully qualified and could be unqualified.

If the following class is existing

package p1.p2.p3;
public class Foo {}

1) the completion of

import p1| // complete at |

propose the completion strings
'p1.*;'
'p1.p2.*;'
'p1.p2.p3.*;'

2) the completion of

import p1.p2| // complete at |

propose the completion strings
'p1.p2.*;'
'p1.p2.p3.*;'

we could propose instead the completion strings
'p2.*;'
'p2.p3.*;'

3) the completion of

void foo() {
  p1| // complete at |
}

propose the completion strings
'p1'
'p1.p2'
'p1.p2.p3'

4) the completion of

void foo() {
  p1.p2| // complete at |
}

propose the completion strings
'p1.p2'
'p1.p2.p3'

we could propose instead the completion strings
'p2'
'p2.p3'


The completion of package has some specificity 
- package and subpackage are proposed
- jdt/text use completion string as label in the proposals list.
  jdt/text could use instead CompletionProposal#getDeclaringSignature() outside an import statement but inside an import statement only the completion string contains the on demand character '*'. 

So if we want to propose unqualified package (eg 'p2.p3;*;') 
- jdt/text should display unqualified package as label 'p2.p3.*;'
or
- jdt/core should add API to identify on demand imports to allow jdt/text to build the fully qualifed label
Comment 1 David Audel CLA 2007-07-11 04:38:22 EDT
The completion string 'p1.p2.*; is not applied in the following test case

import p1.
       p2 | // complete at

Propose an unqualified completion string could solve this bug.
Comment 2 David Audel CLA 2007-07-11 04:46:14 EDT
daniel - do you think display unqualified package in the list of proposals would be good ?
Comment 3 Dani Megert CLA 2007-07-11 09:09:59 EDT
No I don't like that as we render the package icon and hence the name behind it should be the full package name. I also discussed it with Martin and he feels the same about this.
Comment 4 Eclipse Genie CLA 2019-04-06 11:21:14 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Dani Megert CLA 2019-04-07 09:31:03 EDT
We don't want to add this.