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
Allow debug adapters prioritize suggestions via breaking alphabetic sorting #78408
Comments
I experimented with addressing it and the simplest way I found was prepending zero-width space to the suggestions in order to push them lower the stack. VS Code shows these suggestions, but does not quite like applying them out of the box. With a single line change to That might sound hacky, but formally it looks Ok and allows not introducing any additional completions settings and/or DAP capabilities. I'm happy to submit a PR if you find the approach reasonable. |
@isidorn We can take the "hacky" fix for now, but we should start addressing this in a better way, which might involve extending the DAP. |
@pavelfeldman agree with your point that putting the useless properties at the end is the right thing to do. As for the hacky solution we can also go down that route, however for changes at |
Ok, I've created a DAP feature request for adding an optional sortText" to the "CompletionItem" type. |
Generally that's a fair change - the list of whitespace characters in definitely not complete. Anyways, the proper way to tackle this is @weinand's |
Any solution works for me. DAP |
@isidorn |
Debug console now supports the |
I've added sample code for completions to mock-debug and verified that sorting completion items work. |
Adding verified label per @weinand comments. And seems to work for Pavel as well. |
Suggestions returned by the debug adapter are currently sorted by label then by type. This prevents debug adapters from suggesting their own completion order. For example, for JavaScript objects, useless
__defineGetter__
suggestions are shown at the very top:Begin able to control the order allows adapters listing properties as they wish, for example by prototype, hence pushing the object's properties to the very bottom.
The text was updated successfully, but these errors were encountered: