Skip to content

Interaction between EditorConfig style options and IDE* diagnostics #1787

Open
@alexrp

Description

@alexrp

(I don't actually know if this is a bug or by design.)

I'm using OmniSharp 1.35.1 which uses Roslyn's EditorConfig support.

My omnisharp.json has:

{
    "FormattingOptions": {
        "EnableEditorConfigSupport": true
    }
}

My .editorconfig has:

[*.cs]
csharp_prefer_braces = false

Yet, if I write C# code like this:

if (true)
    Foo();

OmniSharp will give an IDE0011 diagnostic (`Add braces to 'if' statement.').

If I add:

[*.cs]
csharp_prefer_braces = false
dotnet_diagnostic.IDE0011.severity = none

It gets silenced as expected.

Is it intentional that I have to specifically configure the IDE0011 severity in my .editorconfig as well? Or should it be picking up the formatting preference I've already configured with csharp_prefer_braces?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions