-
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
ESLint style single line ignore and lightbulb improvements #60668
Comments
This is a language change. Not something Roslyn can do directly, I think. It should start as a discussion in dotnet/csharplang |
Duplicate of dotnet/csharplang#1070 |
Hi @sharwell - I don't see that option in the lightbulb for VS Code - I think that may be a visual studio only option. |
@333fred for feedback on vscode. |
roslyn/src/Features/CSharp/Portable/CodeFixes/Suppression/CSharpSuppressionCodeFixProvider.cs Lines 26 to 27 in e162905
This is the only codefix that doesn't have It seems there is a wrapper roslyn/src/Features/Core/Portable/CodeFixes/Suppression/WrapperCodeFixProvider.cs Line 19 in e162905
But it also doesn't have the attribute (and its constructor is not parameterless). Things around this CodeFixProvider is special cased here: roslyn/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs Lines 679 to 696 in e162905
|
The actual issue that I had in #60620 I now consider solved. (A better way of expressing it might be to say that it wasn't an issue; I just didn't understand correctly 😅)
I've got some developer experience feedback that has occurred to me, as a consequence of writing a blog post that talks about linting in C# as compared to JS/TS with ESLint. Essentially things that the JS/TS ecosystem has that are quite nice that dotnet does not.
I love the lightbulb 💡. When I'm developing, I love the auto fixes and suggestions that it provides.
I don't want to act upon each lint diagnostic. I may just want to ignore a particular one. This is made very easy in the JavaScript ecosystem for two reasons:
// eslint-disable-next-line
.// eslint-disable-next-line
to do just that.It would be awesome if a similar mechanisms existed in dotnet.
Single line ignore
Obviously I can ignore single lines in C#, but it takes me 2 lines of code to achieve it; like so:
What if instead, something like this existed:
Which disabled a single line of linting
Lightbulb
Imagine if the lightbulb with the C# extension offered the option to ignore a lint; just as the ESLint menu does. Quite the timesaver.
I'm not too sure where this feedback should go, but I thought I'd share it here to start with. What do people think? And more than that, is this the right place to discuss this?
The text was updated successfully, but these errors were encountered: