roslyn
roslyn copied to clipboard
Directory separator does not work for .editorconfig
Directory separator does not work correctly in .editorconfig section. Next does not work:
root=true
[generated/**]
generated_code = true
At the same time, next will work:
root=true
[generated**]
generated_code = true
Unfortunately, it is not so strict as first one - as will also apply generated to generated_not_really\somefile.cs
Moving this to Roslyn as .editorconfig support is implemented by the compiler.
@iskiselev /
is used in .editorconfig
in this repository and it's working as expected. Do you have a complete repro project where things don't work as expected? That will help investigating the issue.
Closing as the requested info hasn't been provided. If you can provide that info we will re-open this issue.
Please clone https://github.com/iskiselev/style_issues/tree/d5cc8df239e28ec72f815690983029d946f9b781
Run dotnet build
command.
It will fail with ...\a\no_style\Test.cs(1,1): error IDE0161: Convert to file-scoped namespace
Please check, that .editorconfig
specify:
[{no_style/**}]
generated_code = true
So, it should ignore formatting in a\no_style\Test.cs
. Please validate, that if you change section header to either ~~[no_style/**]
~~, [{**/no_style/**}]
or [{no_style**}]
it will work correctly.
@jaredpar , can you reopen it as I've provided example and caught some additional condition to reproduce it?
It looks like [{no_style/**}]
matches no_style
folder in the current directory, but doesn't match no_style
in a nested directory (e.g, a/no_style
). This might be by-design, but @jaredpar can confirm.
btw, this has nothing to do with { }
, so [no_style/**]
will produce the same behavior.
I found that [{**/no_style,no_style}/**]
works well.
@mavasani, @RikkiGibson
Should it be reopen or it would be easier to open new issue to track it?