Skip to content

wrong .editorconfig used for (some/all?) csharp settings #457

@peeveen

Description

@peeveen

Platform: Windows

Folder structure:

home
|--.editorconfig
|-- repos
    |-- test
        |-- .editorconfig
        |-- blah.cs

Home folder .editorconfig looks like this:

# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = tab
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

[*.cs]
csharp_new_line_before_open_brace = none

Repo-specific .editorconfig file is identical apart from using the value all for the C# setting.

I created a dummy class in blah.cs.
It is auto-formatted like this:

class blah {

}

I would expect the opening brace to be on a new line due to csharp_new_line_before_open_brace = all in the repo-specific .editorconfig file.

If I change the HOME folder version to have a value of all, the class is then formatted as expected.
But nothing I do in the repo-specific version will make a difference to the C# formatting.
Things like indentation (tabs/spaces) work okay: the repo-specific version overrides the home folder version.
Am I missing something obvious?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions