Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompletionItem.kind is incorrect for interfaces #1012

Closed
yyoncho opened this issue Apr 27, 2019 · 2 comments · Fixed by #1016
Closed

CompletionItem.kind is incorrect for interfaces #1012

yyoncho opened this issue Apr 27, 2019 · 2 comments · Fixed by #1016

Comments

@yyoncho
Copy link
Contributor

yyoncho commented Apr 27, 2019

      {
        "label": "Runnable - java.lang",
        "kind": 7,
        "sortText": "999999164",
        "filterText": "Runnable",
        "insertText": "Runnable",
        "data": {
          "decl_signature": "Ljava.lang.Runnable;",
          "pid": "217",
          "rid": "86",
          "uri": "file:///.../src/main/java/temp/App.java"
        }
      },

Runnable is interface and jdt ls should return kind = 8(interface) not kind = 7(class)

@vasiltabakov
Copy link

vasiltabakov commented Apr 27, 2019

I can confirm the issue exists.

https://github.com/eclipse/eclipse.jdt.ls/blob/fc6b40e58808d23a324628a1e79e50f117c534de/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/CompletionProposalRequestor.java#L51

CompletionItemKind.Interface is not in the supported kinds. No idea why. CompletionProposals have flags and it should be easy to determine if TYPE_REF has the Flags.AccInterface flag.

It seems the proposal flags aren't used at all, wonder why that is.

@fbricon
Copy link
Contributor

fbricon commented Apr 28, 2019

It seems the proposal flags aren't used at all, wonder why that is.

We don't always write perfect code ;-)

And yes, it's pretty easy to fix once we use CompletionProposal.getFlags():

Screen Shot 2019-04-28 at 12 12 12 PM

@fbricon fbricon added this to the End April 2019 milestone Apr 29, 2019
fbricon added a commit to fbricon/eclipse.jdt.ls that referenced this issue Apr 29, 2019
One noticeable change is that, for methods, we no longer return
CompletionItemKind.Function but CompletionItemKind.Method instead.

Fixes eclipse-jdtls#1012

Signed-off-by: Fred Bricon <fbricon@gmail.com>
fbricon added a commit that referenced this issue Apr 29, 2019
One noticeable change is that, for methods, we no longer return
CompletionItemKind.Function but CompletionItemKind.Method instead.

Fixes #1012

Signed-off-by: Fred Bricon <fbricon@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants