Open
Description
I'm using VS Code 1.52 on Windows with Omnisharp v1.23.7 (my visual studio version of MSBuild is 1.8.2.56705, dont know if this is relevant.
.editorconfig
# C# files
[*.cs]
#### Naming styles ####
## Naming rules
# private fields (_foo)
dotnet_naming_rule.private_field_members_should_be_camel_case_begins_with_underscore.severity = warning
dotnet_naming_rule.private_field_members_should_be_camel_case_begins_with_underscore.symbols = private_field_members
dotnet_naming_rule.private_field_members_should_be_camel_case_begins_with_underscore.style = camel_case_begins_with_underscore
## Symbol specifications
# fields
dotnet_naming_symbols.private_field_members.applicable_kinds = field
dotnet_naming_symbols.private_field_members.applicable_accessibilities = private
dotnet_naming_symbols.private_field_members.required_modifiers =
# Naming styles
dotnet_naming_style.camel_case_begins_with_underscore.required_prefix = _
dotnet_naming_style.camel_case_begins_with_underscore.required_suffix =
dotnet_naming_style.camel_case_begins_with_underscore.word_separator =
dotnet_naming_style.camel_case_begins_with_underscore.capitalization = camel_case
# Diagnostics
dotnet_diagnostic.IDE1006.severity = warning
CSPROJ
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
</Project>
C# class
public class Class1
{
private int foo;
public int Foo => this.foo;
}
The rule violation is correctly identified. When I select Fix Name Violation: _foo
the class is correctly modified.
public class Class1
{
private int _foo;
public int Foo => this._foo;
}
However the warning does not go away, the message is
Naming rule violation: Prefix '_' does not match expected prefix '_' [quickfixbugs, quickfixbugs]csharp(IDE1006)
(restarting Omnisharp makes the warning go away)
If I select this the the class becomes
public class Class1
{
private int _oo;
public int Foo => this._oo;
}
It is now happy, but this is wrong.