dotnet / roslynator

Roslynator is a set of code analysis tools for C#, powered by Roslyn.

Home Page:https://josefpihrt.github.io/docs/roslynator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some analyzers don't work in Rider with severity being set to "suggestion"

Atulin opened this issue · comments

Product and Version Used:

  • 2024.1 EAP 7
  • Roslynator.Analyzers 4.11.0
  • Roslynator.Formatting.Analyzers 4.11.0
  • .NET 8
  • C# 12

Steps to Reproduce:

  1. Create a solution with multiple projects
  2. Add the analyzers to said projects
  3. Create a .editorconfig file on the solution level
  4. Add
    [*.{cs,cshtml}]
    # Roslynator.Analyzers rules
    dotnet_diagnostic.rcs1260.severity = suggestion
    roslynator_trailing_comma_style = omit_when_single_line
    to the .editorconfig file

Actual Behavior:

The chosen trailing comma analyzer does not work, while others like trailing whitespace do. It starts working when severity is set to warning or higher.

image

Expected Behavior:

The chosen trailing comma analyzer works, while others like trailing whitespace still do. All of them work when severity is set to warning or higher.

image
(artistic rendition)

Addendum

While trying to solve the issue, I also noticed that even with the warning severity the rule does not work everywhere:
image

I raised this issue on Rider's issue tracker as well, just in case it's Rider's fault: https://youtrack.jetbrains.com/issue/RIDER-106663/Some-analyzers-dont-work-in-Rider-with-severity-being-set-to-suggestion