我想将 m_ 用于非常量私有成员,将 c_ 用于 const 成员。但是,editorconfig 不允许我为非常量成员指定规则,仅据我所知。无论一般私有成员或 const 成员的规范顺序如何,以下内容都不起作用:
# Prefix private/protected fields with m_
dotnet_naming_rule.prefix_private_members.symbols = private_fields
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private;protected;protected_internal
dotnet_naming_rule.prefix_private_members.style = private_prefix_style
dotnet_naming_style.private_prefix_style.capitalization = camel_case
dotnet_naming_style.private_prefix_style.required_prefix = m_
dotnet_naming_rule.prefix_private_members.severity = warning
# Prefix private/protected const fields with c_
dotnet_naming_rule.prefix_const_members.symbols = const_fields
dotnet_naming_symbols.const_fields.applicable_kinds = field
dotnet_naming_symbols.const_fields.applicable_accessibilities = private;protected;protected_internal
dotnet_naming_symbols.const_fields.required_modifiers = const
dotnet_naming_rule.prefix_const_members.style = const_prefix_style
dotnet_naming_style.const_prefix_style.capitalization = camel_case
dotnet_naming_style.const_prefix_style.required_prefix = c_
dotnet_naming_rule.prefix_const_members.severity = warning
我该怎么办?我还尝试使用 Pascal 大小写而不是 c_ 来区分 const,但是由于字段的 camel_case 通常与此冲突,因此冲突仍然存在。