-
Notifications
You must be signed in to change notification settings - Fork 408
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
Introduce completion item collapse for method overloads #3053
Conversation
4aecd71
to
50841f1
Compare
50841f1
to
0333b8e
Compare
A few oddities I noticed :
|
88ce96a
to
19d03b9
Compare
....ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/CompletionProposalRequestor.java
Outdated
Show resolved
Hide resolved
....ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/CompletionProposalRequestor.java
Outdated
Show resolved
Hide resolved
19d03b9
to
d4baefa
Compare
Signed-off-by: Hope Hadfield <[email protected]>
d4baefa
to
d70aeda
Compare
@@ -319,20 +328,33 @@ private static final StringBuilder appendParameterSignature(StringBuilder buffer | |||
*/ | |||
private void createMethodProposalLabel(CompletionProposal methodProposal, CompletionItem item) { | |||
StringBuilder description = this.createMethodProposalDescription(methodProposal); | |||
String proposalName = String.valueOf(methodProposal.getName()); | |||
boolean skipDetail = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you do this because you noticed that the regular detail
field was being set for completion items that were using the labelDetails
field, so you tried to preserve that behaviour for regular methods ? But opted to eliminate it for collapsed types ?
According to https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem I don't really see anything that says label details make the regular detail
field obsolete so I guess we opted to keep it around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I didn't want to alter the behaviour for non-collapsed proposals, but removed it for the collapsed proposals because it contained proposal details that would only be related to one of multiple collapsed proposals. There was nothing relevant to include in the field so I just left it as null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess that's fine. Also skipDetail
seems to be true
only when a type should be collapsed & is not a constructor so you probably could have used the exact same check, or used skipDetail even earlier to avoid the other check.
I guess I was aiming towards moving the if (!skipDetail)
block into the block above, but because it's used in 2/4 cases, might as well save space like we are now.
Fixes #2282
Before:
After:
The list of methods should ideally be displayed in signature help after selecting the completion item, though there exists a bug in which this isn't always the case.