-
Notifications
You must be signed in to change notification settings - Fork 1.7k
"textDocument/completion" answer items not alphabetically sorted #40346
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
Comments
The spec does not require the server to send items in any particular order. The client can choose to sort in whatever way makes sense. Alpha sorting on See the spec at https://microsoft.github.io/language-server-protocol/specification#textDocument_completion Closing this issue for now since I don't think we plan on adding server side sorting. |
We might want to re-think that. Server already computes relevance information, and it seems a shame to not share that with LSP clients. |
Would be great to receive server sorted proposals so that clients don't
have to implement language specific sorting. At least lsp4e currently
assumes that the server proposals are ranked already based on relevance and
this seems the best place to do this decision.
Brian Wilkerson <[email protected]> schrieb am Mi., 29. Jan. 2020,
20:02:
… Reopened #40346 <#40346>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#40346?email_source=notifications&email_token=AABCFBUMSV335VETC2JNTADRAHHDZA5CNFSM4KMTIXN2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOWJBKDVQ#event-2990711254>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCFBXE3P25L2XDQTNXETLRAHHDZANCNFSM4KMTIXNQ>
.
|
It seems like it would be fairly easy to sort before returning the items. It looks like LSP also defines a @DanTup In case you have ideas. |
We are already sorting (via
I think this is the correct thing to do - it will put the most relevant things at the top (mostly - we do still have #38739). I don't think we should spend resources sorting the collection though as the client should always be sorting based on As for VS Code, it will use the order we provide it initially, but as soon as the user types any characters (such that the results are filtered client-side), it will take over sorting using its own relevance calculations (something I think is bad in some ways - it has no language context - but good in others - since the server only got to provide the order for the full unfiltered list). @jonas-jonas does this seem to match what you're seeing? |
I believe there's nothing to do here - we provide Unless anyone thinks this is incorrect, I think we can probably close this? (I don't have permission to do so though). |
I agree. Happy to re-open if more discussion is needed. |
In Dartboard we noticed that
textDocument/completion
items are not alphabetically sorted, which makes it hard to predict for the user. In VSCode these entries seem to be sorted on the client? What is this sorting based on? Is it just the default behavior, or is there some way to determine how a response's items should be sorted in the LSP?The text was updated successfully, but these errors were encountered: