-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
Highlight deprecated symbols #1765
Comments
Showing an error when using a symbol that is a #1764 does emit tokens with a "deprecated" modifier but it depends on the editor/client on whether they do anything with this information like highlighting the token as strike-through. I've checked VS Code, Sublime Text 4 and Helix but none of them highlighted a symbol as strike-through. I was able to get symbols highlighted as strike-through in VS Code with the following setting: "editor.semanticTokenColorCustomizations": {
"rules": {
"*.deprecated": {
"strikethrough": true
}
}
}, Not really sure which editor you were using but I am curious to see if your editor is special in that regard or rust_analyzer uses a different approach to get |
Probably making use of |
I'm using neovim (master branch). Neovim's documentation on its diagnostic framework suggests it supports the
Interesting, I'll test with
That does appear to be the case (using the |
Unfortunately, setting If you were able to get it working in VS Code, perhaps this is editor specific? |
So I eventually figured this out, and it was a pretty dumb reason: I wasn't passing the client capabilities to the LSP server. After passing the capabilities to the setup call in my neovim lua, it worked: require('lspconfig').zls.setup({
capabilities = client_capabilities,
}) |
I recently saw #1764 which highlights deprecated symbols in the completion list and I think this is an awesome feature.
Is it possible to extend that feature and highlight the deprecated symbols via diagnostics? For example, like
rust_analyzer
's deprecation highlights (note howfoo()
is hightlighted - er, struck-through - on line 6):The text was updated successfully, but these errors were encountered: