Code style rule severity (silent) correctly overrides rule default in build but not in VS Intellisense
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
**Version Used**:
`Visual Studio 2022 17.14.0 Preview 3` (same behaviour with `Visual Studio 2022 17.13.6`)
`.NET 9.0.300-preview.0.25177.5` (same behaviour with `9.0.203` and `8.0.408` (with `latest-all`))
No extensions installed manually in the Preview version.
**Steps to Reproduce**:
minimal repro repo -
This repo includes an .editorconfig with:
```
[*.{cs}]
dotnet_analyzer_diagnostic.category-Style.severity = warning
dotnet_style_prefer_collection_expression = true:silent
```
a csproj with
```
net9.0
true
true
```
(should `latest-all` be needed too if already using .net9? It doesn't make a difference to this test anyway)
and some code that violates `dotnet_style_prefer_collection_expression = true`.
I'm trying to set `warning` as the default level for the code style rules, and override them to silent when needed. `dotnet_style_prefer_collection_expression` is not specifically important, it's just the style option I've chosen to test with. I tried a couple of others too and got the same behaviour.
I'm setting `TreatWarningsAsErrors` to `true` just to make it obvious when there's a warning/error in the build. I don't believe it's relevant to the results at all here, and I could have left it out and got the same behaviour.
**Expected Behavior**:
Code that violates `dotnet_style_prefer_collection_expression = true` should not show a warning/error in VS build, command line build, or VS intellisense (but should have a quick action to fix), .
i.e. intellisense and build have the same behaviour.
**Actual Behavior**:
The VS build and command line build work as expected and don't show the warning/error, but VS intellisense does show the warning/error (`IDE0300`).
i.e. intellisense and build don't have the same behaviour.

It looks like a bug with intellisense to me, but I'm sorry if I've misunderstood how it's supposed to work!
**More Info**:
I could also set `dotnet_diagnostic.IDE0300.severity = silent`, but based on reading https://github.com/dotnet/roslyn/issues/52991, it seems best to avoid using both those and the code style option severities if possible. Or am I already incorrectly mixing them by using `dotnet_analyzer_diagnostic.category-Style.severity = warning`, and this is resulting in the odd difference in behaviour between build and Intellisense? If that's the case, is there any other way to default code style options to warnings?
Also, I've found that if I use `:none` instead of `:silent`, build and Intellisense behave the same and don't show the warning/error. However, you lose the quick action with `:none`.
Thanks very much for you help, and sorry again if I've misunderstood.
Contributor guide
Assessment
This issue has not been assessed yet.