Code Monkey home page Code Monkey logo

editorconfiglanguage's Introduction

EditorConfig

Build status

Download this extension from the VS Marketplace or get the CI build.


The EditorConfig Project helps developers define and maintain consistent coding styles between different editors and IDEs.

Visual Studio 2017 natively supports .editorconfig files, but it doesn't give language support for editing those files. This extension provides that

For Visual Studio version 2010 to 2015, get the EditorConfig extension instead.

See the change log for changes and road map.

Need help getting started with commands? Check out Microsoft's Reference Guide for details and examples of coding styles available

Features

To make it really easy to add a .editorconfig file, you can now right-click any folder, project, solution folder and hit Add -> .editorconfig File

Classification

Full colorization of the full .editorconfig syntax.

Classification

Visual Studio 2017 lets you add C# and .NET specific rules to the .editorconfig file. In addition to enabling various rules, a severity is also added to control how Visual Studio is going to handle these rules.

C# and .NET style analyzers

Each severity is clearly marked by an icon to make it easy to identify.

The extension provides Intellisense for both keywords and values.

Classification

Classification

Various code snippets have been added to make it easier to work with .editorconfig files.

To insert a snippet, right-click inside the editor or hit Ctrl+K,Ctrl+X.

Snippets

This will show a list of available snippets to insert.

Snippets

Error squiggles are shown for invalid values.

Classification

Properties that are being overridden by a duplicate property in the same section is easy to identify.

Validate duplicates

If a parent document contains the exact same property and value in a section with the same globbing pattern, a suggestion shows up to remove it.

Validate parent

See the complete list of error codes.

To suppress any error in the .editorconfig document, use the light bulb feature:

Suppress error

That will add a special comment at the top of the file to let the validator know what error messages to suppress.

Suppress Comment

Another way to suppress the error is by right-clicking the error in the Error List.

Suppress from Error list

Hover the mouse over any keyword to see a full description.

Classification

Sorting properties, deleting sections, and adding missing rules is easy with the commands being shown as light bulbs in the editor margin.

Light bulbs

Typing Ctrl+K,D will invoke Visual Studio's Format Document command. By default that will align all the equal (=) delimeters and add 1 space character around both equal- and colon characters. This behavior is configurable in the settings (see below).

Code formatting

Dropdown menus at the top of the editor makes it easy to navigate the document.

Navigational drop downs

A project can have multiple .editorconfig files and the rules in each cascades from the top-most and down. It is based on folder structure.

The inheritance visualizer is located at the bottom right corner of the editor window and makes it easy to see this relationship.

Inheritance visualizer

You can navigate to the immediate parent document by hitting F12. You can change the shortcut under Tools -> Options -> Environment -> Keyboard and find the command called EditorConfig.NavigateToParent.

Note, the inheritance visualizer is only visible when the current file isn't the root of the hierarchys or by specifying the root = true property.

Change the behavior of the editor from Tools -> Options or simply by right-clicking in the editor.

Open EditorConfig settings

Settings

Check out the contribution guidelines if you want to contribute to this project.

For cloning and building this project yourself, make sure to install the Extensibility Tools 2015 extension for Visual Studio which enables some features used by this project.

References to available formatting/code options directly from Roslyn codebase

Apache 2.0

editorconfiglanguage's People

Contributors

advanium avatar allisonchou avatar binaryn3xus avatar daniel-liuzzi avatar dee-see avatar giggio avatar jmarolf avatar madskristensen avatar misinformeddna avatar natemcmaster avatar pawchen avatar rik-smeets avatar seangwright avatar sharwell avatar tdavisjr avatar thefanatr avatar tonyhallett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

editorconfiglanguage's Issues

Please provide a way to supply or ignore third-party editorconfig properties

There are third-party tools (like ReSharper) which provide its own editorconfig properties. Currently usages of such properties are highlighted.
Ideally, there should be a way to import a list of such external properties and their possible values from some text-based (JSON?) format. I'll file a suggestion to editorconfig for format standardisation.
Another possible way is to ignore certain prefixes (ReSharper uses resharper_ prefix for its properties).

Exception from HRESULT: 0x80070057 (E_INVALIDARG)

If I try to add .editorconfig file under some directory(not under the solution), following error message is displayed.

The parameter is incorrect.
Exception from HRESULT: 0x80070057 (E_INVALIDARG)

dotnet_style_prefer_is_null_check_over_reference_equality_method is unknown

Installed product versions

  • Visual Studio: 2017 Professional
  • This extension: 1.17.237

Description

dotnet_style_prefer_is_null_check_over_reference_equality_method is unknown. This keyword is defined in the documentation (https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference)

More generally I think the list should be updated to support VS15.7 features.

Current behavior

A warning is present

Expected behavior

It should be supported

.editorconfig when_on_single_line issue a warning

Version Used: Visual Studio Community v15.5.3

Steps to Reproduce:

Add the following rules:

csharp_style_expression_bodied_operators = when_on_single_line:error
csharp_style_expression_bodied_indexers = when_on_single_line:error
csharp_style_expression_bodied_accessors = when_on_single_line:error
csharp_style_expression_bodied_methods = when_on_single_line:error
csharp_style_expression_bodied_properties = when_on_single_line:error

Expected Behavior:

  1. Should not issue a warning.

  2. Should show when_on_single_line in the intellisense.

Actual Behavior:

  1. when_on_single_line issue the following warning "EC114: whenon_single_line is not a valid value for...", also, notice the typo.

  2. Doesn't show the value in the intellisense.

dotnet_separate_import_directive_groups is unknown

Installed product versions

  • Visual Studio: Community 2017 Version 15.9.7
  • This extension: 1.17.246

Description

dotnet_separate_import_directive_groups is unknown. This keyword is defined in the documentation.

Current behavior

EC112 warning is displayed.

Expected behavior

No warning is present. It is supported by the extension.

editorconfig file does nothing

Installed product versions

  • Visual Studio: [example 2017 Professional]
  • This extension: [example 1.1.21]

Description

.editorconfig file does nothing

Steps to recreate

1: Create new .Net ClassLibrary project
2: Add .editorconfig file (tried project level, solution level, etc.)
3: Add rule with : Error set
4: Add code which breaks rule

Current behavior

No error, no warning

Expected behavior

Build error

Lines containing only one `#` are not colored as comment

Installed product versions

  • Visual Studio: [example 2019 preview 1 Professional]
  • This extension: [example 1.17.246]

Description

Lines containing only one # are not colored as comment:

image

Current behavior

Lines containing only one # are not colored as comment

Expected behavior

Lines containing only one # are colored as comment

Tag "csharp_style_expression_bodied_local_functions" not recognized

Installed product versions

  • Visual Studio: Professional 2019 (Version 16.3.5)
  • This extension: 1.17.260

Description

The tag "csharp_style_expression_bodied_local_functions" is not recognized yet.
Source: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#expression-bodied-members

Steps to recreate

Add "csharp_style_expression_bodied_local_functions = true:suggestion" to .editorconfig

Current behavior

Tag is underlined (EC112).

Expected behavior

Tag should be recognized similair to "csharp_style_expression_bodied_methods".

Some undocumented should be documented

Installed product versions

  • Visual Studio: 2017 Community 15.9.7
  • This extension: 1.17.246

Description

csharp_indent_block_contents and csharp_indent_braces were in the Roslyn .editorConfig

Steps to recreate

Current behavior

Undocumented in EditorConfig.json

Expected behavior

Documented in EditorConfig.json

Current Extension Does Not Include Current Schema From Master Branch

Installed product versions

  • Visual Studio: 2017 Community 15.9.7
  • This extension: 1.17.246

Description

In the Schema folder inside the extension folder
\AppData\Local\Microsoft\VisualStudio\15.0_fa800525\Extensions\lu0luhxe.b0c EditorConfig.json is not up to date.
For instance this is the applicable kinds
{ "name": "dotnet_naming_symbols.<naming_symbols_title>.applicable_kinds", "description": "Application kinds.", "values": [ "*", "class", "struct", "interface", "enum", "property", "method", "field", "event", "delegate", "parameter" ], "defaultValue": [ "*" ], "multiple": true, "documentationLink": "https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions" },

Steps to recreate

Install the extension

Current behavior

Due to the missing applicable_kinds getting Incorrect EC114 warnings as per Issue 61 and Issue 60

Expected behavior

{ "name": "dotnet_naming_symbols.<naming_symbols_title>.applicable_kinds", "description": "Application kinds.", "values": [ "*", "namespace", "class", "struct", "interface", "enum", "property", "method", "field", "event", "delegate", "parameter", "type_parameter", "local", "local_function" ], "defaultValue": [ "*" ], "multiple": true, "documentationLink": "https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions" },
as per merged pull request 53

Why there is no "dotnet_sort_system_directives_first" error highlighting.

Installed product versions

  • Visual Studio: VS enterprise 2017
  • This extension: 1.17.204

I'm learning editorconfig and I noticed:
Violation of dotnet_style_predefined_type_for_locals_parameters_members is highlighted.
But violation of dotnet_sort_system_directives_first not highlighted.

And question:
I can sort usings via "Remove and Sort Usings". Can I sort but don't remove? Or this is the only one way?

Incorrect EC114 warnings for "local" value

Installed product versions

  • Visual Studio: 2017 Professional
  • This extension: 1.17.246

Description

Displaying warning EC114 - "local" is not valid value in the following two cases:
dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local

Steps to recreate

  1. Add to you .editorconfig file
    dotnet_naming_symbols.constants.applicable_kinds = field, local
    dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local
  2. Build your solution and check warnings

Current behavior

Displaying warning EC114 - "local" is not valid value for the following:
dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local

Expected behavior

Don't display EC114 warning for local value of dotnet_naming_symbols.constants.applicable_kinds and
dotnet_naming_symbols.locals_and_parameters.applicable_kinds (check https://github.com/dotnet/roslyn/blob/master/.editorconfig).

warningec114

Visual Studio hangs when there are multiple kinds

Installed product versions

  • Visual Studio: 2017 Enterprise version 15.5.1
  • This extension: 1.17.226

Description

Visual Studio will hang after adding a rule with multiple kinds

Steps to recreate

  1. Add this: csharp_new_line_before_open_brace = control_blocks, methods, properties, types
  2. Hit enter key then start typing a new rule

Current behavior

Visual Studio hangs

Expected behavior

Visual Studio should not hang

Error Mismatch for validation

Installed product versions

  • Visual Studio: 2017 Enterprise
  • This extension: 1.17.212

Description

For certain csharp properties, I am getting an error that does not match what the config text is. See screenshot.

Steps to recreate

  1. Create a new .editorconfig
  2. Add 'csharp_prefer_braces' or 'csharp_prefer_simple_default_expression'
  3. Wait for validation squiggly to display in green
  4. Hover mouse over it and get error "The keyword "csharpprefer_simple_default_expression" is unknown"

Current behavior

It is showing a mismatch for the value in the error message. When you hover over the validation that is correct, it shows an incorrect name in the error message.

Expected behavior

Show the correct one. Maybe even fix these two variables at the same time 👍 😄

image

Intellisense throws exception at position 0.

Installed product versions

  • Visual Studio: 2017
  • This extension: 1.15.194

Description

Intellisense throws exception at position 0.

Steps to recreate

  1. Add new line at start of file
  2. Place cursor at Ln 1, Col 1
  3. Press Ctrl + Space

Current behavior

"Speciefied argument is out of range of valid values. Parameter name: position"

Expected behavior

Suggest "root"

Template has space at the end of each line

When a new .editorconfig file is created from a template, there is a space at the end of each setting line. The trailing space slows text selection for editing or requires a regex search and replace step to eliminate.

  • Visual Studio: 15.8.1
  • This extension: 1.17.242

Incorrect EC114 warnings for "local_function" value in VS2017

Installed product versions

  • Visual Studio: 2017 Professional
  • This extension: 1.17.246

Description

Displaying warning EC114 - "local_function" is not valid value in the following case:
dotnet_naming_symbols.local_functions.applicable_kinds = local_function

Steps to recreate

  1. Add to you .editorconfig file
    dotnet_naming_symbols.local_functions.applicable_kinds = local_function
  2. Check warnings

Current behavior

Displaying warning EC114 - "local_function" is not valid value for dotnet_naming_symbols.local_functions.applicable_kinds = local_function

warningec114_for_local_function

Expected behavior

Don't display EC114 warning for local_function value of dotnet_naming_symbols.local_functions.applicable_kinds (check https://github.com/dotnet/roslyn/blob/master/.editorconfig).

Should warn on invalid globs like [{*.cs, *.vb}]

Installed product versions

  • Visual Studio: 2017 Enterprise RC.4
  • This extension: 1.14.175

Description

Globs with spaces in them aren't matched, but there is no indication.

Steps to recreate

  1. Create a Solution with one C# and one VB project.
  2. Add .editorconfig with the following contents to the solution directory:
# Dotnet code style settings:
[*.{cs, vb}]
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
  1. Close all files, then open the .editorconfig file and the .vb file.

Current behavior

No warning from the .editor config file, but it is not applied to the .vb file

Expected behavior

The space in the glob isn't legal, so there should be an indication of that.

Visual studio 15.5 Preview 4 hangs when ident_size is set

Installed product versions

  • Visual Studio Enterprise 15.5 Preview 4.0
  • This extension: 1.17.226

Description

Visual Studio hangs after ident size is set

Steps to recreate

  1. Open .editorconfig file
  2. Type with statement completion
root = true

[*.cs]
charset = utf-8
end_of_line = crlf
indent_size = 2
  1. Press Ctrl+Space on the new line
  2. Visual Studio will hang

Current behavior

Visual Studio hangs

Expected behavior

Statement completion popup opens

dotnet_style_require_accessibility_modifiers is unknown

Installed product versions

  • Visual Studio: 2017 Enterprise 15.7.6
  • This extension: 1.17.237

Description

dotnet_style_require_accessibility_modifiers is unknown. This keyword is defined in the documentation

Current behavior

EC112 warning is present

Expected behavior

No warning is present. It is supported by the extension.

Incorrect `indent_size` autocomplete.

Installed product versions

  • Visual Studio: Visual Studio 2017 RC 15.0.26014.0
  • This extension: EditorConfig Language Service 1.8.103

Current behavior

Autocomplete for indent_size lists tab as sole (incorrect) option.

Expected behavior

List no options, and solely allow numeric values to be entered.

Crash when opening specific .editorconfig file

Installed product versions

  • Visual Studio: 2017 Community latest update (15.2/26430.14)
  • This extension: [1.17.207]

Description

Extension crashes as soon as I open .editorconfig from roslyn repo:
https://github.com/dotnet/roslyn/blob/1be9034dcf0392fb0c15d5ffac7a4f35d4bcd51b/.editorconfig (now it's latest master)

Error from ActivityLog.xml

System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A;   at EditorConfig.BraceMatchingTaggerProvider.CreateTagger[T](ITextView textView, ITextBuffer buffer) in C:\projects\editorconfiglanguage\src\BraceCompletion\BraceMatchingTaggerProvider.cs:line 16&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.GatherTaggers(ITextBuffer textBuffer)

Steps to recreate

  1. Add .editor config as in here: https://github.com/dotnet/roslyn/blob/1be9034dcf0392fb0c15d5ffac7a4f35d4bcd51b/.editorconfig
  2. Open VS 2017 Community
  3. Open .editorconfig
  4. Get a dialog about exception crashed

Current behavior

Exception is crashing

Expected behavior

Should not crash

The keyword 'csharp_style_simple_default_expression' is unknown

Installed product versions

  • Visual Studio 2017 Enterprise 15.8.8
  • This extension: 1.17.146

Description

'csharp_style_simple_default_expression' setting is not recognized.

Steps to recreate

  1. Open a new .editorconfig file
  2. Add the text : "csharp_style_simple_default_expression = true:suggestion"
  3. See message EC112 in Error List pane

Current behavior

This setting has been introduced with C# 7.1 but is not known to EC.

Expected behavior

Should accept this setting and propose available values per Microsoft documentation.

Unknown property with severity breaks error checking

Installed product versions

  • Visual Studio: 2017 Enterprise 15.6.3
  • This extension: 1.17.237

Description

If the editorconfig file contains an unknown property that includes a severity, no errors, warnings or suggestions are shown any more. Since some Roslyn properties are not yet supported (see #40) this breaks the error checking for all editorconfig files that include one of those properties.

Steps to recreate

  1. Add a new editorconfig file
  2. Add some code that triggers an error, warning or suggestion
  3. Add the line asdf = true : none anywhere in the file
  4. Try to trigger a new error, warning or suggestion
  5. Reopen the editorconfig file

Current behavior

  • Step 3 doesn't show the warning about the unknown property, neither in the error list nor in the code file.
  • Step 4 doesn't show the new warning, error or suggestion. Again neither in the error list nor in the code file.
  • After step 5 the error list is completely empty and no new errors, warnings or suggestions will be added. But in the code file all 3 problems are highlighted now.

Expected behavior

All errors, warnings and suggestions should always be visible, both in the error list and the code file.

dotnet_diagnostic.[warning code].severity throws a warning as unknown.

Installed product versions

  • Visual Studio: 2019 Enterprise
  • This extension: 1.17.260

Description

When I use the new syntax for suppressing analyzer warnings, the EditorConfig Language Service extension marks it as a warning that it is unknown (EC112).

Steps to recreate

  1. Add the following to editorconfig:

dotnet_diagnostic.CA2007.severity = none

Current behavior

Warnings list contains:

Warning EC112 The keyword "dotnet_diagnostic.CA2007.severity" is unknown.

Expected behavior

No warnings should be added to the list and I should be provided with an autocomplete list for severity levels.

Error when adding new .editorconfig file

Installed product versions

  • Visual Studio 2017 Community
  • This extension: 1.17.202

Description

image

Steps to recreate

  1. Right-click the project in the solution explorer
  2. Select Add, new .editorconfig file

Current behavior

The file is created and opened, but the error message appears.

csharp_preferred_modifier_order setting is not recognized

Installed product versions

  • Visual Studio: 2017 Community 15.5.5
  • This extension: 1.17.233

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

  • The csharp_preferred_modifier_order setting is underlined with a green squiggly.
  • The tooltip says EC112. The keyword csharppreferred_modifier_order is unknown. Note the missing underscore between csharp and preferred.

Expected behavior

  • csharp_preferred_modifier_order setting is recognized by the language service;
  • Supported modifiers (public, virtual, async, etc.) are displayed in the auto-completion list when editing the setting value.
  • Supported severities (error, none, etc.) are displayed in the auto-completion list when editing setting value

Formatting options incorrectly allow severities

Description

Formatting options do not support severity, but this extension doesn't report a warning when a severity is specified.

Steps to recreate

[*.cs]
# Newline settings
csharp_new_line_before_else = true:warning

Current behavior

No warning is reported for :warning.

Expected behavior

A warning should be reported for :warning, since csharp_new_line_before_else does not support severity.

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

  1. Create a new .editorconfig file (or open an existing one). Insert rules for dotnet_naming_style.pascal_case_style.capitalization = pascal_case and dotnet_naming_style.camel_case_style.capitalization = camel_case if there aren't any yet.
  2. Start typing dotnet_naming to get suggestions
  3. Accept dotnet_naming_rule.<naming_rule_title>.style and give it a name (replacing <naming_rule_title> with some appropriate name)
  4. Go to the end of the line (after the equal sign) and start typing pascal_case_style.
  5. 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.

Add editorconfig to new files list

Installed product versions

  • Visual Studio: 2017 Enterprise
  • This extension: 1.16.201

Description

I'd like to see the option for editorconfig files added to the new files list. The default file would contain all of the available settings VS2017 supports making it easy to get started setting one up (and possibly the option for an empty one). This could be somewhat redundant if #6 was done, but having a default file with all available settings could be a good short term option.

NullReferenceException at EditorConfig.EditorConfigQuickInfoControllerProvider.TryCreateIntellisenseController

Installed product versions

  • Visual Studio: 2017 Enterprise 17.8.1
  • This extension: 1.17.242

Description

When opening an editorconfig file in diff mode the IDE showed an error message like "Extension failed to load. Please see ActivityLog.xml". Inside of the XML file was this error:

System.NullReferenceException: Object reference not set to an instance of an object.
   at EditorConfig.EditorConfigQuickInfoControllerProvider.TryCreateIntellisenseController(ITextView textView, IList`1 subjectBuffers) in C:\projects\editorconfiglanguage\src\QuickInfo\EditorConfigQuickInfoControllerProvider.cs:line 0
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.IntellisenseManagerConnectionListener.<>c__DisplayClass8_1.<SubjectBuffersConnected>b__1(IIntellisenseControllerProvider provider)
   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)

Steps to recreate

I haven't tried to reproduce it yet.

Tooltip flickering on popup

Installed product versions

  • OS: Windows 10 (Fresh Install)
  • Visual Studio: 2017 Community
  • This extension: 1.17.237

Description

Tooltips flicker 2 times before staying in place after popping up.

Example of tooltip flickering

(As stateted in the OS section, this is a fresh install so it's possible this may be an issue on my end)

Steps to recreate

  1. Hover over a property label

Current behavior

Tooltip is flickering before staying put.

Expected behavior

Tooltip should not flicker.

Visual Studio crashes when typing some properties

Installed product versions

  • Visual Studio: 2017 15.5.1
  • This extension: 1.17.226

Description

Visual Studio crashes when typing some properties, like csharp_prefer_braces and dotnet_naming_symbols.<naming symbols title>.applicable_accessibilities.

Steps to recreate

  1. Open an .editorconfig file.
  2. Write csharp_prefer_braces =, it crashes (workaround: enable "Show undocumented properties").
  3. After restarting Visual Studio, because it crashed, write dotnet_naming_symbols.some_name.applicable_accessibilities = i, it crashes again, disabling validation doesn't work.

Current behavior

Visual Studio crashes.

Expected behavior

Visual Studio should not crash.

EC103 ** wildcard validation is not correct

Installed product versions

  • Visual Studio: 2017 Enterprise
  • This extension: 1.17.237

Description

EC103 validation wants you to use **/*.foo to match files in subfolders, while the spec says **.foo should work, and it does work.

** Matches any string of characters

Steps to recreate

Have the following file structure:

.editorconfig
foo\bar\baz.cs

Have the following .editorconfig:

root = true

[foo/**.cs]
indent_style = space
indent_size = 10

Current behavior

EC103 appears, saying the pattern doesn't match any file, even though formatting is applied to baz.cs.

Expected behavior

EC103 should not appear.

csharp_new_line_before_open_brace Not Working

Installed product versions

  • Visual Studio: 2017
  • This extension: 1.16.198

Description

The csharp_new_line_before_open_brace setting seems stuck on all. I was going to raise this in the roslyn repo but thought it might be a tooling issue in VS 2017.

Steps to recreate

  1. Add the following to .editorconfig:
[*.cs]
csharp_new_line_before_open_brace = all:warning
  1. Open a .cs file and hit Ctrl+K and Ctrl+D to format the code.
  2. The braces are formatted to use JavaScript style where they are on the same line as the class/method etc.
class Foo {
}
  1. Try values other than all and they all produce the same result.

Error In VS2017

  • Visual Studio: 2017 update 1

When I start typing something to add to my editorconfig file I get the error: An exception has been encountered. This maybe be caused by an extension.

This the error that I see in the ActivityLog.xml
System.TypeInitializationException: The type initializer for 'EditorConfig.SchemaCatalog' threw an exception. ---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: t. Path '[0].values', line 6, position 7. at Newtonsoft.Json.JsonTextReader.ReadStringValue(ReadType readType) at Newtonsoft.Json.JsonTextReader.ReadAsString() at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor1 creator, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject(JsonReader reader, JsonObjectContract objectContract, JsonProperty containerMember, JsonProperty containerProperty, String id, Boolean& createdFromNonDefaultCreator) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at EditorConfig.SchemaCatalog.ParseJson() in C:\projects\editorconfiglanguage\src\Schema\SchemaCatalog.cs:line 48 at EditorConfig.SchemaCatalog..cctor() in C:\projects\editorconfiglanguage\src\Schema\SchemaCatalog.cs:line 19 --- End of inner exception stack trace --- at EditorConfig.EditorConfigCompletionSource.AugmentCompletionSession(ICompletionSession session, IList1 completionSets) in C:\projects\editorconfiglanguage\src\Completion\CompletionSource.cs:line 55 at Microsoft.VisualStudio.Language.Intellisense.Implementation.CompletionSession.Start() at EditorConfig.CompletionController.StartSession() in C:\projects\editorconfiglanguage\src\Completion\CompletionController.cs:line 196 at EditorConfig.CompletionController.HandleTypeChar(IntPtr pvaIn) in C:\projects\editorconfiglanguage\src\Completion\CompletionController.cs:line 94 at EditorConfig.CompletionController.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) in C:\projects\editorconfiglanguage\src\Completion\CompletionController.cs:line 71 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at EditorConfig.F1Help.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) in C:\projects\editorconfiglanguage\src\Commands\F1Help.cs:line 18 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at EditorConfig.NavigateToParent.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) in C:\projects\editorconfiglanguage\src\Commands\NavigateToParent.cs:line 43 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at EditorConfig.SignatureHelpCommand.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) in C:\projects\editorconfiglanguage\src\SignatureHelp\SignatureHelpController.cs:line 48 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at EditorConfig.HideDefaultCommands.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) in C:\projects\editorconfiglanguage\src\Commands\HideDefaultCommands.cs:line 22 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at EditorConfig.EnableSnippetsCommand.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) in C:\projects\editorconfiglanguage\src\CodeExpansions\EnableSnippetsCommand.cs:line 84 at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.InnerExec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.Exec(Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) at Microsoft.VisualStudio.Editor.Implementation.VsKeyboardFilter.SendCommand(Guid cmdGroup, UInt32 cmdID, Object inParam) at Microsoft.VisualStudio.Editor.Implementation.VsKeyboardFilter.TextInput(TextCompositionEventArgs args) at Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.<>c.b__6_0(KeyProcessor p, TextCompositionEventArgs args) at Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.<>c__DisplayClass10_1`1.b__0() at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)

insert_final_newline is not working with vs2017

Installed product versions

  • Visual Studio: 2017 pro, 64bit
  • This extension: 1.17.202

Description

I have set:

insert_final_newline = true

But it takes no effect.

Steps to recreate

  1. Create .editorconfig file
  2. Add insert_final_newline = true in [.*] section
  3. Edit file, remove final newline
  4. Save file

Current behavior

File saved, no newline inserted.

Expected behavior

Newline should be inserted if there's no newline already.

Note: I also have ReSharper installed. I have ReShaprer's support to editorconfig feature turned off.

EditorConfig Language Service Visual Studio plugin won't update

Installed product versions

  • Visual Studio: 15.3.5 Enterprise
  • This extension: 1.15.194

Description

The EditorConfig Language Service shows updates available to be installed, but upon restarting Visual Studio, the old version is still installed

Steps to recreate

  1. Go to Notifications in Visual Studio
  2. Click "An update to "EditorConfig Language Service" is available
  3. See Current Version: 1.15.194, New Version 1.17.216
  4. Scheduled for Update: EditorConfig language Service
  5. Close and restart Visual Studio

Current behavior

After restart of Visual Studio, version 1.15.194 of EditorConfig Language Service is installed

Expected behavior

After restart of Visual Studio, the latest version (as of now 1.17.216) of EditorConfig Language Service is installed

'local', 'type_parameter', 'local_function' kinds are not accepted by EC Language Service

Installed product versions

  • Visual Studio: Enterprise 2017 Version 15.8.8
  • This extension: 1.17.246

Description

EditorConfig Language Service 1.17.246, under VS2017, does not recognize the values 'local', 'type_parameter' and 'local_function'

Steps to recreate

  1. Create .editorconfig file
  2. Enter the text "dotnet_naming_symbols.<naming_symbols_title>.applicable_kinds = local"
  3. See warning message
  4. Same for 'type_parameter' and 'local_function'

Current behavior

Per Microsoft documentation, those kinds are valid.

Expected behavior

EC should accept above values for applicable kinds.

Roslyn.editorconfig parse failure

Installed product versions

  • Visual Studio: 2017 RC
  • This extension: 1.10.133

Description

The Roslyn editorconfig file fails to parse.

Steps to recreate

Download this file and open in VS: https://github.com/dotnet/roslyn/blob/master/.editorconfig

Current behavior

EC104 A severity must be specified.
EC114 "all" is not a valid value for the "csharp_new_line_before_open_brace" property"

Expected behavior

I am assuming that since Microsoft made the file it is correct. Is the parser wrong or is their file incorrect?

[Feature] Filter out used items in intellisense

Currently, when editing a .editorconfig file, when autocomplete is invoked, the autocomplete box will show all possible values, regardless of whether they have already been set.

image

It would be nice to have the values not show up in autocomplete if they have already been defined in the file. This would apply mainly to the csharp_ and dotnet_ values.

Thanks for the awesome extension! :)

Dotnet snippet triggers warning

Installed product versions

  • Visual Studio: 2017 Enterprise 15.6.3
  • This extension: 1.17.237

Description

The included snippet "Dotnet code style settings" triggers a warning because it contains a space in the globbing pattern [*.{cs, vb}].

Steps to recreate

  1. Add a new editorconfig file
  2. Use the snippet "Dotnet code style settings"

Current behavior

The warning EC117 "Spaces in globbing patterns are allowed, but are often the result of a typo. Make sure the globbing pattern is accurate." is shown.

Expected behavior

The snippet shouldn't contain the space in the globbing pattern so that no warning is triggered.

type_parameter and local_function not recognised

Installed product versions

  • Visual Studio: 2017 Community 15.8.2
  • This extension: 1.17.246

Description

The following lines are underlined green:

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum, delegate, type_parameter
dotnet_naming_symbols.parameters_locals.applicable_kinds = parameter, local, local_function

with the messages

  • " typeparameter" is not a valid value for …
  • " localfunction" is not a valid value for …

Note also the missing underscore and the additional space in the quotes.

See the documentation that explains these values: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference

Also, the missing underscore in the error message tool tip is probably a formatting issue with WPF. although I see no underlined character after the missing underscore. The underlining probably only works in menus when pressing the Alt key alone.

csharp_indent_case_contents_when_block is unknown

Installed product versions

  • Visual Studio: 2017 Enterprise - 15.9.4
  • This extension: 1.17.250

Description

The extension pops a EC112 The keyword "csharp_indent_case_contents_when_block" is unknown on the same named option in a .editorconfig generated with Intellicode.

Steps to recreate

Create .editorconfig that has the option csharp_indent_case_contents_when_block = true as documented here, or with intellicode

Current behavior

An EC112 warning will appear from the extension.

Expected behavior

No warning, it's a supported option as far as documentation tells.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.