Roslyn: Ruleset editor equivalent for .editorconfig.

Created on 13 Dec 2019  路  14Comments  路  Source: dotnet/roslyn

The ruleset editor is very useful for example when disabling an entire category. This is useful when disabling StyleCop documentation analyzers in test projects for example.

image

Area-IDE Feature Request Need Design Review

Most helpful comment

Editorconfig UI Proposal

Entry points

View -> Other Windows

image

Analyzer Project Node in Solution Explorer

image

Right click in .editorconfig file

image

Ctrl+Q Search

Shows up in search for editor config in the ctrl+q search.

Features

Minimum UI Proposal

  • Search
  • Set editorconfig values
  • Filter based on columns

image

Maximal UI Proposal

Additional Features:

  • Categorized sections

    • Code Style

    • Naming Style

    • IDE Analyzers

    • Analyzers

  • Access to editors from Tools->Options

    • Show previews of style settings

    • Allows editing of nameing styles

image

All 14 comments

As I understand this is covered by https://github.com/madskristensen/EditorConfigLanguage/ but not yet for rules.
@madskristensen right?

@xperiandri No, the repo you linked provides the language service only and no other UI for dealing with .editorconfig files.

@JohanLarsson You can now do this operation with a single .editorconfig entry, see https://github.com/dotnet/roslyn/pull/38886#issue-321838740

Tagging @mikadumont for the more generic request for a UI over .editorconfig.

NOTE: You can find a rule's category by looking at the "Category" column in error list, which is hidden by default.

image

Looks like the category column shows something else.

@sharwell you want to fix this in StyleCop analyzers to have the correct category?

Pretty sure StyleCop does it right. I think the bug is in the error list UI.

Ah, I didn鈥檛 notice your diagnostics were from build, not Intellisense. Unfortunately, the diagnostics shown from explicit build cannot find the category as the build output does not have this data. Switching to Build + Intellisense should show the correct values.

For transparency, we've discussed the option of an editorconfig UI a few times internally. While no decisions have been made, there are two important recurring themes:

  1. The custom UI is "challenging" to create and maintain. Aside from the obvious time it takes for design work and the relatively high amount of work that UI testing takes, we have extremely strict requirements for accessibility that must be met. For anything we can deliver as a text editor, the latter two points are resolved automatically so we can put all the real work into the design. The current rule set editor has been hit particularly hard by accessibility issues.
  2. We want to find a way to deliver the EditorConfig Language Service as a default installation item for Visual Studio, and then work to improve the user experience when working with this extension.

Editorconfig UI Proposal

Entry points

View -> Other Windows

image

Analyzer Project Node in Solution Explorer

image

Right click in .editorconfig file

image

Ctrl+Q Search

Shows up in search for editor config in the ctrl+q search.

Features

Minimum UI Proposal

  • Search
  • Set editorconfig values
  • Filter based on columns

image

Maximal UI Proposal

Additional Features:

  • Categorized sections

    • Code Style

    • Naming Style

    • IDE Analyzers

    • Analyzers

  • Access to editors from Tools->Options

    • Show previews of style settings

    • Allows editing of nameing styles

image

Notes from today's design meeting (7/13):
It was determined that we need a more complete proposal. Some questions to be answered:

  • How will we support 3rd party analyzers?
  • LSP? We should have higher confidence that this would be able to translate well to the LSP world.

Overview

Three sections:

  • Category Tree

    • List all editorconfig files that apply to the solution

    • Lists all the categories under each editorconfig

    • Selecting a category updates the Tabular Data Control section

  • Tabular Data Control

    • Whitespace

    • Code Style

    • Naming Style

    • Analyzers

  • Setting Application Sample

    • The same as tools -> options. Shows what the setting will do once applied

image

Whitespace

| Description | Preference |
|:------------|:-----------|
| | |

image

Code Style

Columns:

| Description | Preference | Severity |
|:------------|:-----------|:---------|
| | | |

image

Naming Style

| Reoder | Specification | Required Style | Severity | (Remove) |
|:-------|:--------------|:---------------|:---------|:---------|
| | | | | |

image

Analyzers

| ID | Description | Severity |
|:---|:------------|:---------|
| | | |

image

Side note:
RuleSet designer resets comments in ruleset file. Editorconfig designer should preserve them.

Was this page helpful?
0 / 5 - 0 ratings