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

Fix method ref CompletionItemKind #1574

Merged

Conversation

0dinD
Copy link
Contributor

@0dinD 0dinD commented Oct 16, 2020

@0dinD 0dinD force-pushed the fix-method-ref-completionitemkind branch from bc97f01 to ad50e2d Compare October 16, 2020 19:42
@0dinD
Copy link
Contributor Author

0dinD commented Oct 16, 2020

My change has caused a test failure, since there was an assertion where the CompletionItemKind of a static method import was expected to be CompletionItemKind.Module. This makes no sense to me, since I thought CompletionProposal.METHOD_NAME_REFERENCE was only for method references, not method imports, seeing as there is also CompletionProposal.METHOD_IMPORT. But it seems like neither of the cases produce a CompletionProposal.METHOD_IMPORT, and instead they both get CompletionProposal.METHOD_NAME_REFERENCE, for whatever reason. I suspect this is why the decision was made to give method references CompletionItemKind.Module in the first place.

However, I still don't think CompletionItemKind.Module makes any sense even for method imports, since they are also still methods, not modules/packages. It's also inconsistent with what CompletionItemKind other type members are given: classes, fields, enums etc. are given their respective CompletionItemKind, not CompletionItemKind.Module.

After updating the test case, I saw another test failure on the CI server, but this one seems very random as I don't think my changes affected anything to do with that test. I also ran the same test locally, and found that it passes with no failures.

@snjeza
Copy link
Contributor

snjeza commented Oct 16, 2020

test this please

@fbricon fbricon added this to the End October 2020 milestone Oct 19, 2020
@fbricon fbricon merged commit 1643ebf into eclipse-jdtls:master Oct 19, 2020
@fbricon
Copy link
Contributor

fbricon commented Oct 19, 2020

Thanks @0dinD!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Method references are given the CompletionItemKind.Module type by the completion provider
3 participants