Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

No formatting of indentation on positional parameter if line above contains attribute and comment #77205

Open
just-ero opened this issue Feb 13, 2025 · 0 comments
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@just-ero
Copy link

just-ero commented Feb 13, 2025

Full issue information + repro project:
https://github.com/just-ero/roslyn-issues-repros/tree/main/4.14.0/004_FormatIndentations_PositionalParameters_AttributeComment

Version

Roslyn: 4.14.0-2.25106.12

Steps to Reproduce

  1. Add the following code wherever syntactically applicable:
    class AAttribute : Attribute;
    
    record R(
        [A] // Comment.
    	int I);
    Note: The line with the attribute and the comment is indented with 4 spaces. The line with the positional parameter is indented with 1 tab.
  2. Apply the Format document action.
    Note: The document's indentations should be set to 4 spaces.

Expected Behavior

The indentation on the line with the positional parameter is changed to that of the overall document's.

Actual Behavior

It is not.
The same problem occurs for class primary constructors.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 13, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant