Bug 501243 - Code completion does not show enum types nested in a base interface.
Summary: Code completion does not show enum types nested in a base interface.
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-12 08:33 EDT by Frank Benoit CLA
Modified: 2022-10-28 05:21 EDT (History)
3 users (show)

See Also:


Attachments
Suggestion MyEnum is missing (7.31 KB, image/png)
2016-09-12 08:33 EDT, Frank Benoit CLA
no flags Details
BaseItf (82 bytes, application/octet-stream)
2016-09-12 08:33 EDT, Frank Benoit CLA
no flags Details
TopItf (92 bytes, application/octet-stream)
2016-09-12 08:34 EDT, Frank Benoit CLA
no flags Details
Use (89 bytes, application/octet-stream)
2016-09-12 08:34 EDT, Frank Benoit CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Benoit CLA 2016-09-12 08:33:10 EDT
Created attachment 264100 [details]
Suggestion MyEnum is missing

This was working in Eclipse 4.4.1.

In Eclipse Neon, the suggestion of "MyEnum" is not shown. See screenshot.
And attached source files.
Comment 1 Frank Benoit CLA 2016-09-12 08:33:54 EDT
Created attachment 264101 [details]
BaseItf
Comment 2 Frank Benoit CLA 2016-09-12 08:34:14 EDT
Created attachment 264102 [details]
TopItf
Comment 3 Frank Benoit CLA 2016-09-12 08:34:29 EDT
Created attachment 264103 [details]
Use
Comment 4 Jay Arthanareeswaran CLA 2016-09-13 02:35:26 EDT
For easy reference, here are the classes involved:

package prj;
public class Use {
	static int myVal = TopItf.MyEnum.ONE.ordinal();
}
interface BaseItf {
	public enum MyEnum { ONE, TWO; }
}
interface TopItf extends BaseItf {
	enum Sec {};
	void func();
}

One more observation is that if we use BaseItf.MyE|, the completion is offered. And this is in sync with the following code in CompletionEngine:

if (this.insideQualifiedReference
    || typeName.length == 0) { // do not search up the hierarchy
         findMemberTypes(...

Basically, we don't bother with the super types or interfaces if the qualified name is used. It seems to suggest we expect the user to use the exact type that contains the member type. It can be argued that because this code is allowed, we should offer the completion as well, which I agree with.

Keeping it in my 4.7 list.
Comment 5 Frank Benoit CLA 2017-06-23 08:43:57 EDT
Seems to be missing the 4.7 release.
Will it be done?
Comment 6 Manoj N Palat CLA 2018-05-21 06:13:51 EDT
Bulk move out of 4.8
Comment 7 Eclipse Genie CLA 2020-06-07 12:14:04 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 8 Eclipse Genie CLA 2022-10-28 05: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.