EditorConfigLanguage
EditorConfigLanguage copied to clipboard
Provide more completion options for dotnet_naming_*
Installed product versions
- Visual Studio: 2017 Community
- This extension: 1.17.202
Description
At this point, it is fairly hard to create naming convention rules; mostly because there is little to no documentation (outside the .editorconfig
files used by various dotnet repositories).
Such rules (or perhaps in general, dotted identifiers like group.subgroup.name
) could benefit from better completion, as well as more specific completion for the particular rules provided by dotnet_naming_style
, dotnet_naming_symbols
and dotnet_naming_rules
. For example, while it is supported to insert the full dotnet_naming_rule.<naming_rule_title>.style
line (and highlight <naming_rule_title>
so we can type right away), there is no support for deleting .style
and typing a dot to get intellisense offering style
, severity
and symbols
as options. It could also be a neat addition to suggest currently existing naming rule titles from the current file when typing the dot after dotnet_naming_rule
(to add other modifiers to them).
Sticking with .style
as example, it could provide a list of defined dotnet_naming_style
members as suggestion to make it easier to match up but hard to mess up. At this point, typo'ing in one of the places makes the file invalid and has its rules ignored (or they don't do what was intended, depending on the typo).
This should also provide suggestions for .symbols
, using dotnet_naming_symbols
as base.
Steps to recreate
- Create a new
.editorconfig
file (or open an existing one). Insert rules fordotnet_naming_style.pascal_case_style.capitalization = pascal_case
anddotnet_naming_style.camel_case_style.capitalization = camel_case
if there aren't any yet. - Start typing
dotnet_naming
to get suggestions - Accept
dotnet_naming_rule.<naming_rule_title>.style
and give it a name (replacing<naming_rule_title>
with some appropriate name) - Go to the end of the line (after the equal sign) and start typing
pascal_case_style
. - Duplicate the line, then delete from the end of the line until
.style
and hit the dot (or leave the dot in place, then use Ctrl+Space to invoke IntelliSense) in an attempt to create a new line for that same naming rule with.symbols
Current behavior
Step 3 inserts the snippet including the equal sign and highlights the string <naming_rule_title>
Step 4 does not suggest styles from the file; it doesn't suggest anything
Step 5 shows "no suggestions" (or, if you skip naming the rule in Step 3, it will show all 3 options)
Expected behavior
Step 3 stays as is
Step 4 suggests camel_case_style
and pascal_case_style
from the file
Step 5 shows severity
, style
and symbols
as options inside IntelliSense.