-
Notifications
You must be signed in to change notification settings - Fork 420
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
Proposal to add roslyn 'tags' to diagnostic response #1410
Proposal to add roslyn 'tags' to diagnostic response #1410
Conversation
I like this idea. Calling it tags also makes sense to me, as it's a known concept and already called like that in both Roslyn in VS Code. I'd suggest we could include the tags property into the API already but start by just reporting Also, it would be good to add a test, for example here https://github.com/OmniSharp/omnisharp-roslyn/blob/master/tests/OmniSharp.Roslyn.CSharp.Tests/DiagnosticsFacts.cs to make sure we don't break this (since it's not typed and served as a string array it's susceptible to easy breaking). |
Good points. I added few tests and tag filtering which passes only Unnessery tag for client. However without analyzers the 'happy path' with unnecessary tag is nonexistent. I added placeholder test for it to be implemented once analyzers are available. One question: Should we add Unnesessary tag for few selected CS warning like unnesessary import? This isn't implemented by roslyn but it gives bit extra to users without analyzers enabled. |
VSCode march update got a cool new feature to mark code fixes as preferred - preferred action is autoselected in the dropdown and can be triggered with a hotkey. Does roslyn provide a "preferred" tag or something that can be used to that effect? |
I think there isn't such tag in diagnostics results from Roslyn. However if there's fix all provider available for diagnostic, it could be reasonable assumption that it could work as preferred code action. This is something which could be prototyped to see if it works well 🤔 Does visual studio impelement some kind of preferred code action feature? Roslyn has most of it's features implemented in visual studio IDE so if it has feature like VSCode then i think it's definetly doable in VScode too. |
Blocked waiting on #1076 |
This is ready for review now @filipw @david-driscoll @SirIntruder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to go - thanks @savpek!
@filipw build ready (appvoyer was very slow for some reason) and passing. Could you merge this? I'd like to continue with dotnet/vscode-csharp#2873 🙂 |
🍻 |
Tags contains metadata from compiler like 'unused', 'telemetry', 'compiler' and so on. Interesting bit at this point is unused tag that can be used to implement 'fadeout' feature for unused code.
Feature like:
Does this api change looks good @rchande @filipw @david-driscoll @DustinCampbell ?
Theres multiple options to surface this on model, i think another option is to add "isFaded" flag or something. But personally i like this tag system better since it can support other scenarios as well. And it seems to be common way to deal this since both VSCode and roslyn implement same behavior.
To get actual value from this change this needs #1076. I don't know any CS diagnostics that hides anything, they seems to be IDE analyzers.