Skip to content

Conversation

@tmat
Copy link
Member

@tmat tmat commented Jun 11, 2024

Wrapping options

  • dotnet_internal_wrapping_column
  • dotnet_internal_conditional_expression_wrapping_length
  • csharp_internal_collection_expression_wrapping_length

are currently only available from global options. They are only set by tests at this moment. We do not allow the user to change the values via Tools > Options or editorconfig. See #30422 (comment).

These options are read from analyzers and the code doing so is different between features and code style.

This change unifies the code by making these options undocumented editorconfig options. This means that tooling such as editorconfig generator, Tools > Options UI, etc. won't generate/display these options but the options will be available via AnalyzerConfigOptions to analyzers. Setting these in a proper editorconfig file will work, but is not officially supported. In future, once #30422 (comment) is resolved, we may decide to make these options official.

Ultimately, the goal is for all options used by analyzers that are currently only available from global options to be converted to (ndocumented) editorconfig options.

Possible follow-up:

  • Fold SyntaxWrappingOptions into SyntaxFormattingOptions -- it doesn't seem worth having separate types for wrapping operations as they also reference formatting options.

@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 11, 2024
@tmat tmat marked this pull request as ready for review June 11, 2024 16:09
@tmat tmat requested a review from a team as a code owner June 11, 2024 16:09
@tmat
Copy link
Member Author

tmat commented Jun 11, 2024

@CyrusNajmabadi @sharwell @dotnet/roslyn-ide

@sharwell
Copy link
Contributor

What about dotnet_unsupported_ as the prefix?

@tmat
Copy link
Member Author

tmat commented Jun 11, 2024

What about dotnet_unsupported_ as the prefix?

We can certainly use such prefix.

/// Internal option -- not exposed to editorconfig tooling via <see cref="EditorConfigOptions"/>.
/// </summary>
public static readonly Option2<int> CollectionExpressionWrappingLength = new(
$"csharp_internal_collection_expression_wrapping_length",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What actually stops it from being exposed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean "exposed"? Not able to use it in editorconfig file?

@CyrusNajmabadi
Copy link
Member

unsupported works for me as well.

@tmat
Copy link
Member Author

tmat commented Jun 13, 2024

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@tmat tmat enabled auto-merge (squash) June 14, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants