Open zspitz opened 3 years ago
ping @BhaaLseN re #13
Sounds like a familiar report :)
I have to admit though, since VS 2019 extended on the support for .editorconfig
(and even brought a UI editor at some point), I haven't used this extension since VS 2017. I didn't even change the naming settings since I got them dialed in back when and just forgot about them.
Just for reference though: I checked with VS 2022, and editing an .editorconfig
with the plain text thing provides some syntax completion, but it's more like "those are words i know" rather than "this word makes sense in this context". So there is still value in providing this sort of guidance for users looking to create their .editorconfig
👍
Installed product versions
Description
On top of the basic
key = value
syntax of .editorconfig, the .NET compilers (C#, VB.NET and perhaps others) can use .editorconfig files to enforce (or ignore) naming conventions for various code elements.Conceptually, this system has three kinds of entities, depending on whether the key starts with
dotnet_naming_style.
,dotnet_naming_symbols.
, ordotnet_naming_rule.
:Entities are defined by one or more properties in the following syntax:
where
<kind>
is one of the above values,<title>
is the name of the entity, and<propertyName>
and<propertyValue>
are specific to each entity kind.There are some really powerful opportunities for improving the language service here. Using the following sample:
Intellisense
dotnet_naming_symbols.
private_fields
private_static_fields
public_symbols
public_symbols
is used as the value for a naming rulesymbols
property.dotnet_naming_rule.public_members_must_be_capitalized.symbols =
dotnet_naming_symbols.private_fields.
applicable_kinds
applicable_accessibilities
required_modifiers
dotnet_naming_symbols.private_fields.applicable_kinds =
abstract
async
const
must_inherit
readonly
static
shared
Symbol renaming
Invoking the Rename refactoring on an entity name should modify all uses of that name -- both the keys in property setters, and the values in the naming rule setters. For example, Rename refactoring the
underscored
in the value of the following line:to
under_scored
, should result in the following other changes:Question: should this affect only the current file, or .editorconfig files in the parent folders as well?
Find all references
Invoking "Find all references" on a specific name should return all property setters with that kind+name, as well as all the places it's used in the value of a property setter.
Hover
capitalization
Capitalization style for words within the symbol
local
Symbols defined within a method
underscored
.capitalization = pascal_case ([*.{cs,vb}])
.required_prefix = _ ([*.{cs,vb}])
2. The glob pattern should be visually different from the value
Navigation
"Go to definition" on a specific name should navigate to the first property setting with that kind+name. Alternatively, it should follow the same strategy VS does with C# partial classes -- it would automatically open the Find all references pane on that kind+name.
Validation
The last line in the sample should have a red squiggly underneath it, because there are no property setters matching the
public_symbols
symbol group.Missing required properties should also be recognized as errors.
Duplicate keys should also be flagged as errors.
Current behavior
The language service doesn't surface any of these behaviors.