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

Strikeout CompletionItems (and Symbols?) that are deprecated #50972

Closed
rcjsuen opened this issue Jun 1, 2018 · 34 comments · Fixed by #78092
Closed

Strikeout CompletionItems (and Symbols?) that are deprecated #50972

rcjsuen opened this issue Jun 1, 2018 · 34 comments · Fixed by #78092
Assignees
Labels
feature-request Request for new features or functionality on-testplan suggest IntelliSense, Auto Complete
Milestone

Comments

@rcjsuen
Copy link
Contributor

rcjsuen commented Jun 1, 2018

Ctrl+Space is nice and all but when you are new to a library you just see a list of functions and you won't realize that some of them are deprecated. Would it be possible to add a strikeout line via the line-through text-decoration or some kind of icon overlay to indicate that something is deprecated?

image

@vscodebot
Copy link

vscodebot bot commented Jun 1, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added editor editor-core Editor basic functionality labels Jun 1, 2018
@octref octref added suggest IntelliSense, Auto Complete and removed editor editor-core Editor basic functionality labels Jun 1, 2018
@octref
Copy link
Contributor

octref commented Jun 1, 2018

@jrieken I'm interested in this too, for deprecated html/css properties.

@ivanvoznyakovsky
Copy link

it'd also be great to strikeout deprecated props/methods in the editor itself like webstorm does it. ie
screen shot 2018-08-17 at 13 29 37

@KamasamaK
Copy link

@ivanvoznyakovsky The only way to currently set whether the property or method is deprecated would be to use invalid.deprecated in the TM syntax. I have proposed the capability of doing this through the API in #56694

@jcrben
Copy link

jcrben commented Nov 28, 2018

Raised a couple times previously:

At least we currently should see when using trying to use an @deprecated function (#26541)

@KamasamaK
Copy link

KamasamaK commented Dec 12, 2018

@jcrben Those are issues for language support. This issue is more general, and I think this is an issue to support the deprecated property on the completion and symbol items in the LSP spec with a visual change. Perhaps also to add those properties to the native API.

When this is done, I would expect more language support would follow. It's possible that some language servers already do set that property but you don't know since VS Code ignores it.

Specifically on those issues you posted, I don't agree with the notion that it should be done in a separate extension or that it should use the decorations API. Deprecation is a standard practice in software development, and in the case of JavaScript/TypeScript there is JSDoc to determine this, which is already being parsed and used for other doc tags.

@Tyler-Murphy
Copy link

I'd like something similar to this. I'd like to be able to prevent deprecated things from showing up in the list of suggestions at all.

@jrieken
Copy link
Member

jrieken commented Jul 26, 2019

@michaeljsalo

This comment has been minimized.

@fbricon
Copy link
Contributor

fbricon commented Aug 22, 2019

Testing on vscode-java with initial deprecated support in jdt.ls, in Insiders build ada79d7 :
Screen Shot 2019-08-22 at 4 49 05 PM

I'll keep testing with newer builds next week.

cc @akaroml

@rcjsuen
Copy link
Contributor Author

rcjsuen commented Aug 22, 2019

What a time to be alive...

@jrieken
Copy link
Member

jrieken commented Aug 26, 2019

Closing. We have the UX for outline, workspace symbols, and completions. The API is proposed and will be finalised in #23927

@fbricon
Copy link
Contributor

fbricon commented Aug 26, 2019

@jrieken I tested today's insiders build (185308c 2019-08-26T09:43:06.818Z) and I no longer see the completion/symbols striked through O_o. Is there something I need to enable in my extension now?

@jrieken
Copy link
Member

jrieken commented Aug 26, 2019

What version of the proposed API did you code this against?

@fbricon
Copy link
Contributor

fbricon commented Aug 26, 2019

latest LSP release. Which adds the deprecated property to completion items, workspace and document symbols. completion items worked last week, as per my screenshot.
I tried to add vscode.proposed.d.ts by calling npx vscode-dts dev. But I'm not sure where the file is supposed to go. In my project root? my project source folder? Either way I don't get the strikethroughs.

@fbricon
Copy link
Contributor

fbricon commented Aug 26, 2019

enableProposedApi is set to true too. Wasn't necessary last week.

@jrieken
Copy link
Member

jrieken commented Aug 26, 2019

latest LSP release.

I don't think that's weird up (@dbaeumer) yet. It might have worked by accident because the first proposal used the same names. The proposed API (CompletionItem.tags, SymbolInformation#tags) is described here: #23927

@fbricon
Copy link
Contributor

fbricon commented Aug 26, 2019

do you plan to get VS Code support the deprecated properties of the current LSP version?
On the Java side, those new tags are not yet supported by the LSP4J bindings, so it'll take us more time to have that deprecated support that way.

@jrieken
Copy link
Member

jrieken commented Aug 26, 2019

LSP and vscode.d.ts are two separate things. The LSP-vscode-client fulfils the vscode.d.ts-contract, e.g it will map the deprecated-field that LSP defines onto the completion item tag that vscode.d.ts defines. The sequence is that we finalise the API next milestone, that LSP adopts the new API, and that things then come together.

Since you are on the LSP side and since to my knowledge deprecation is already supported there (but not yet wired up), there is nothing you have to do

@fbricon
Copy link
Contributor

fbricon commented Aug 26, 2019

ok, can you please let me know when this is wired up in vscode then?

@danielhofinger
Copy link

danielhofinger commented Aug 26, 2019 via email

@fbricon
Copy link
Contributor

fbricon commented Aug 26, 2019

I didn't add you. But you can unsubscribe from notifications from this issue by clicking on the "Unsubscribe" button here.

@KamasamaK
Copy link

@fbricon This is already working in VS Code with the proposed API. What you're likely waiting for is support in microsoft/vscode-languageserver-node.

@akaroml
Copy link
Member

akaroml commented Aug 27, 2019

I didn't add you. But you can unsubscribe from notifications from this issue by clicking on the "Unsubscribe" button here.

Hey Fred, I think the enableProposedApi is no longer needed because the changes are already in the latest release of the vscode-languageclient v5.3.0-next.9. Could you try to upgrade the client to see whether it works? Thanks.

@dbaeumer
Copy link
Member

@jrieken is correct. It is not wired up yet. I only wire up new API if it is at least released in a stable build. I don't make a dependency on Insider in LSP libs (I once did and it confused a lot of users).

However you can implement this yourself using a custom middleware if you really need to do so.

@danielhofinger
Copy link

danielhofinger commented Aug 27, 2019 via email

@dbaeumer
Copy link
Member

@danielhofinger you need to unsubscribe yourself from the issue using the GitHub UI.

@danielhofinger
Copy link

Alright, thanks! @dbaeumer

@fbricon
Copy link
Contributor

fbricon commented Aug 27, 2019

@jrieken is correct. It is not wired up yet. I only wire up new API if it is at least released in a stable build. I don't make a dependency on Insider in LSP libs (I once did and it confused a lot of users).

However you can implement this yourself using a custom middleware if you really need to do so.

I don't think I'm gonna start messing with custom middleware code (don't even know what to do). So I'll just wait for you to wire things up in the insiders build at least

@Tyler-Murphy
Copy link

#77239 was marked as a duplicate of this issue and closed.

@jrieken said:

I'd say this is a dupe of #50972 and it would be us adding some API flag and then allows users to configure how the suggest UX is handling that flag

Does the closure of this issue address #77239? Should #77239 be reopened?

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-testplan suggest IntelliSense, Auto Complete
Projects
None yet
Development

Successfully merging a pull request may close this issue.

13 participants