-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Improve completion support for obsolete members #26488
Comments
I hope someone is on this. |
To answer @CyrusNajmabadi's question from the previous thread, yes, VS's completion is able to present strikethrough text encoded using the unicode facilities for strikethrough, however, typing the regular text didn't match the strikethrough version from the completion list when I tried it. My guess is that you could probably get the desired behavior using the right combination of CompletionItem properties:
The same thing looks possible in language server protocol by providing both a label and sort text. @AmadeusW is the feature owner for completion and might know more. AFAIK we don't currently support dimming of items in the in-proc completion API. LSP protocol does have a property indicating deprecation status though, so, it's possible to add support for that in both places. |
When you are bolding items, you look at the display text though right? so we would lose bolding here, right? Note: my preference would be to not have the language set strikethrough, but instead expose a boolean stating if this is deprecated/obsolete. Then, the platform would apply the styling and could do the right thing for all clients in a consistent fashion. Would that make sense for you @gundermanc ? |
In my ideal world, it works like this (n.b.: I haven't seriously looked at how other languages / IDEs handle this):
In table form:
Perhaps another alternative would be to decorate the list item the same way that it would be decorated in the text editor after completion? e.g., if the completion would result in an error, then give it a red squiggly underline in the list too. Regardless, as an expert user, I would also appreciate being able to (opt-in) filter out all obsolete items from completion lists. |
@AmadeusW, as completion owner can you chime in? |
Personally I'd want to see it there anyway because I think it would cause confusion for people who knew about the now-obsolete API and the obsolete message would hopefully point me to the replacement API. |
Design meeting notes: we agreed we should go ahead with strikethrough, since VS code implemented that. If we get feedback we could also add a filter, but we seem to get be getting a small number of users using filters today. @genlu will chat with the editor team next to see if this is already supported. |
@jasonmalinowski will it also be possible to show obsolete members in the end of the suggestion list? |
Possibly! I'll let @genlu speak to the details. (I was just the note taker.) |
Looks like LSP spec offers CompletionItemTag.Deprecated - are we going to go with this for the LSP implementation? I can add a property to the VS CompletionItem |
Yup.
Awesome! Let us know when it's available. Thanks! |
I think this make sense, and making it the default would be my preference.. |
Apparently VS Code has a feature like this for symbols in the editor, not just in completion. Would be great to have that in the VS editor too: Original tweet that brought this to my attention: https://twitter.com/JustinNoelDev/status/1337007045011234817 |
This is a design issue related to completion. Implementation issue(s) will be created according to the approved design, once available.
Original issues:
Options for improving the use of these members include, but is not limited to the following:
The text was updated successfully, but these errors were encountered: