-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Include wrapping options in editorconfig formatting options #73938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@CyrusNajmabadi @sharwell @dotnet/roslyn-ide |
|
What about |
We can certainly use such prefix. |
src/Analyzers/CSharp/CodeFixes/UseCollectionExpression/CSharpCollectionExpressionRewriter.cs
Outdated
Show resolved
Hide resolved
...s/Core/CodeFixes/UseConditionalExpression/AbstractUseConditionalExpressionCodeFixProvider.cs
Show resolved
Hide resolved
src/Workspaces/CSharp/Portable/Options/CSharpEditorConfigOptionsEnumerator.cs
Outdated
Show resolved
Hide resolved
| /// 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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
...ces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/CSharpSyntaxFormattingOptions.cs
Show resolved
Hide resolved
|
|
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Wrapping options
dotnet_internal_wrapping_columndotnet_internal_conditional_expression_wrapping_lengthcsharp_internal_collection_expression_wrapping_lengthare 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
AnalyzerConfigOptionsto 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:
SyntaxWrappingOptionsintoSyntaxFormattingOptions-- it doesn't seem worth having separate types for wrapping operations as they also reference formatting options.