Open ssoher opened 1 year ago
This is typically handled through diagnostics with "unnecessary" tag. Does server report relevant diagnostic for that part of the code? If it does then https://lsp.sublimetext.io/customization/#diagnostics has information how to modify color scheme to support that.
They are neither reported as diagnostics nor the coloring works on the tags markup.unnecessary.lsp
and markup.deprecated.lsp
. It'd be cool if this feature is added, compilation directives are used quite commonly, especially for cross platform work. Would help having the non-compiled code "greyed out".
If not supported right now then it would need to be added in https://github.com/OmniSharp/omnisharp-roslyn. This is just a think wrapper package that makes it easy to use it in Sublime.
nor the coloring works on the tags
markup.unnecessary.lsp
andmarkup.deprecated.lsp
I'm not sure what exactly doesn't work. If server doesn't provide diagnostics with those tags then it will obviously not work. Otherwise it obviously should work if your color scheme is extended accordingly.
nor the coloring works on the tags
markup.unnecessary.lsp
andmarkup.deprecated.lsp
I'm not sure what exactly doesn't work. If server doesn't provide diagnostics with those tags then it will obviously not work. Otherwise it obviously should work if your color scheme is extended accordingly.
Adding the little snippet I've mentioned in my first comment does not produce a diagnostic.
Does it work in VSCode?
And also you might want to try to disable this seemingly relevant option: https://github.com/sublimelsp/LSP-OmniSharp/blob/73285c66290afbf2d35b5532fa04ea88cc81c556/LSP-OmniSharp.sublime-settings#L21-L23
It does work in VSCode.
Changing "csharp.suppressHiddenDiagnostics": true
to false
did not change the result. Still no diagnostics produced for false resulting compiler directive blocks.
Should be checked with latest Omnisharp version also. Related I guess: https://github.com/sublimelsp/LSP-OmniSharp/issues/24
@rchl yes, already did. couldn't get it to work.
Then it would need to be investigated how VSCode extension does it. Whether through LSP server, syntax file or maybe even some custom code in the extension.
I'm not smart enough to get this whole server to run on my mac so I'm not gonna look into it but if you want to debug a bit then you could post here the response to the textDocument/codeAction
request while in a file that should report unnecessary code (and where VSCode does report it).
But after brief look it seems like the server reports code actions with Unnecessary
tag for unused imports, for example, but there is also some custom code in the VSCode extension that triggers a custom codeCheck request to the server and maps certain results to diagnostics with Unnecessary
tags.
This silly server has so much custom logic in the extension that it almost defeats the purpose of having an LSP server... It would be a full time job to get this mapped to our package.
Consider the following code, I want to "dim" or use custom coloring on the unreachable or unused code. Couldn't find a way to achieve this with semantic highlighting, the LSP documentation doesn't provide a semantic token specifically for this it seems, or I did not notice it. Is this possible and supported and if so what is the correct way to add this to a custom color scheme?