13

Analyzer feedback severity levels are explained in the documentation. But in my eyes silent and none severity levels seem both to have the same meaning - "I don't want this rule checked for":

For none:

Suppressed completely.

For silent:

Non-visible to user. The diagnostic is reported to the IDE diagnostic engine, however.

What exactly is the effect of "reporting to IDE" for VS2019 and in what scenarios should one prefer silent over none?

Imre Pühvel
  • 4,468
  • 1
  • 34
  • 49

3 Answers3

9

I think silent shows up in the editor as the "three dots" or ghosted text, while none doesn't show up. I might recall this not behaving consistently in the past, but it seems to happen in Visual Studio 16.10.0. I like Imre's suggestions.

enter image description here

It seems like:

  • suggestion, error, and warning show up in the editor and Error List.
  • silent shows up only in the editor.
  • none shows up in neither.
Vimes
  • 10,577
  • 17
  • 66
  • 86
  • Interesting.. that is, contrary to the quoted definition in OP, "silent" is visible to the user;)´´. Go figure. – Imre Pühvel Jun 02 '21 at 12:17
  • Exactly. I think they meant "non-visible in the Error List". It seems that `suggestion`/`error`/`warning` show up in the editor and Error List; `silent` shows up only in the editor; and `none` shows up nowhere. The error list is sometimes out of date, so I'm not totally sure. – Vimes Jun 02 '21 at 18:34
  • I don't get the three dots in silent :( – kofifus Aug 06 '21 at 00:13
  • This actually makes sense for `silent`: "The diagnostic is reported to the IDE diagnostic engine", meaning that you see the `...` in the IDE, but not in the `Error List`. It's just not obvious at first what `IDE diagnostic engine` means. – user276648 Apr 19 '22 at 08:10
  • See ['Hidden' severity versus 'None' severity](https://learn.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers#hidden-severity-versus-none-severity), which corresponds to `silent` vs `none`. – user276648 Apr 19 '22 at 08:13
  • @kofifus I also don't get the "3 dots" in silent. It's a bit of a shame, actually. I do have certain things I consider so unimportant I don't want them cluttering up the Information message list, but I wouldn't mind the 3 dots staying! – Jez Oct 31 '22 at 17:11
5

Due to lack of better information and until proven wrong, I'm considering them equal for practical effect.

Still, considering this as an opportunity to define a useful semantic difference, I would suggest to:

  • USE none when you object to given rule in chosen scope. This rule is not mandatory to be followed.
  • USE silent for rules which must be followed, but are causing too much noise and are suppressed temporarily while still communicating the desired target state.
Imre Pühvel
  • 4,468
  • 1
  • 34
  • 49
4

The distinction is explained in the documentation:

Hidden (silent) severity rules that are enabled by default differ from disabled or None severity rules in certain aspects.

  • If any code fix is registered for a Hidden severity rule, Visual Studio offers the fix as a light bulb code-refactoring action even if the hidden diagnostic isn't visible to the user. The fix isn't offered if the severity rule is disabled as None.
  • Hidden severity rules can be bulk configured by entries that set rule severity of multiple analyzer rules at once in an EditorConfig file. None severity rules can’t be configured this way. Instead, they must be configured through entries that set rule severity in an EditorConfig file for each rule ID.
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742