madskristensen / EditorConfigLanguage

A Visual Studio extension
Other
128 stars 37 forks source link

csharp_preferred_modifier_order setting is not recognized #40

Closed olegsych closed 5 years ago

olegsych commented 6 years ago

Installed product versions

Description

The csharp_preferred_modifier_order setting introduced in Visual Studio 15.5 is not recognized by the language service.

Steps to recreate

  1. Add a new .editorconfig to a Visual Studio solution
  2. Add a csharp_preferred_modifier_order setting to the .editorconfig
    csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error

Current behavior

Expected behavior

MaceWindu commented 6 years ago

same for csharp_style_deconstructed_variable_declaration

Gav-Brown commented 6 years ago

Full list:

  1. dotnet_style_require_accessibility_modifiers
  2. csharp_preferred_modifier_order
  3. dotnet_prefer_inferred_tuple_names
  4. dotnet_prefer_inferred_anonymous_type_member_names
  5. csharp_style_deconstructed_variable_declaration
  6. csharp_style_pattern_local_over_anonymous_function

As a side note, Visual Studio Code Style Options in the UI also has:

  1. IDE0032:Prefer auto properties
  2. IDE0041:Prefer 'is null' over 'object.ReferenceEquals(..., null)'

Which also don't appear here, but Microsoft also don't document them, see https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference

MaceWindu commented 6 years ago

Checked mentioned here options with latest version of extension.

No squiggles:

Squiggles:

dotnet_prefer_inferred_anonymous_type_member_names is a typo in MS documentation, and should be dotnet_style_prefer_inferred_anonymous_type_member_names. BTW, they use both names in linked document.

So, for me it looks like only csharp_style_deconstructed_variable_declaration requires fix

Gav-Brown commented 6 years ago

@MaceWindu Thanks, I agree no squiggles but no auto-completion or intellisense either.

MaceWindu commented 6 years ago

Also checked roslyn code and I think: IDE0032 - dotnet_style_prefer_auto_properties IDE0041 - dotnet_style_prefer_is_null_check_over_reference_equality_method both don't give squiggles to me

MaceWindu commented 6 years ago

@Gav-Brown ah, maybe you are right. Didn't checked it

Gav-Brown commented 6 years ago

Thanks for looking up the IDE rule names. Nice investigative work!

Gav-Brown commented 6 years ago

I also (MS) had typo in dotnet_style_prefer_inferred_tuple_names

Gav-Brown commented 6 years ago

@MaceWindu It appears the squiggles come and go. You need to restart VS to get them to appear and then they only appear on first invalid name, So you need to comment them out one by one to detect them or check auto-completion list for the 8 missing rules above.

Gav-Brown commented 6 years ago

Just for info. If you turn on Show undocumented properties auto completion gives you a set of other available properties. I assume MS/Roslyn team should add the documentation for these.

csharp_indent_block_contents csharp_indent_braces csharp_space_after_colon_in_inheritance_clause csharp_space_after_comma csharp_space_after_dot csharp_space_after_semicolon_in_for_statement csharp_space_around_binary_operators csharp_space_around_declaration_statements csharp_space_before_colon_in_inheritance_clause csharp_space_before_comma csharp_space_before_dot csharp_space_before_open_square_brackets csharp_space_before_semicolon_in_for_statement csharp_space_between_empty_square_brackets csharp_space_between_method_call_empty_parameter_list_parentheses csharp_space_between_method_call_name_and_opening_parenthesis csharp_space_between_method_declaration_empty_parameter_list_parentheses csharp_space_between_method_declaration_name_and_open_parenthesis csharp_space_between_square_brackets

madskristensen commented 6 years ago

cc @kuhlenh