-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Formatter requires two passes in the presence of directives inside lambda block bodies, inside argument lists #57465
Labels
Area-IDE
Bug
IDE-Formatter
Code formatter and/or smart indent
Resolution-Fixed
The bug has been fixed and/or the requested behavior has been implemented
Milestone
Comments
dotnet-issue-labeler
bot
added
Area-IDE
untriaged
Issues and PRs which have not yet been triaged by a lead
labels
Oct 29, 2021
jinujoseph
added
Bug
help wanted
The issue is "up for grabs" - add a comment if you are interested in working on it
IDE-Formatter
Code formatter and/or smart indent
and removed
untriaged
Issues and PRs which have not yet been triaged by a lead
labels
Nov 4, 2021
Triage notes : Important for razor scenarios |
Another repro in Razor: dotnet/razor#5693 |
This was referenced Nov 16, 2021
sharwell
added a commit
to sharwell/roslyn
that referenced
this issue
Feb 18, 2022
sharwell
added a commit
to sharwell/roslyn
that referenced
this issue
Feb 18, 2022
sharwell
added a commit
to sharwell/roslyn
that referenced
this issue
Feb 22, 2022
sharwell
added
Resolution-Fixed
The bug has been fixed and/or the requested behavior has been implemented
and removed
help wanted
The issue is "up for grabs" - add a comment if you are interested in working on it
labels
Feb 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area-IDE
Bug
IDE-Formatter
Code formatter and/or smart indent
Resolution-Fixed
The bug has been fixed and/or the requested behavior has been implemented
Given the following code:
Formatting the document once results in:
Note the position of the
if (true)
. It has been moved by the formatter, but not by enough.Foratting the document again results in:
This is now properly formatted, and subsequent formatting does nothing, as you would expect.
Removing the
#nullable enable
from the file fixes the issue, and the formatter does the right thing on the first pass. Alternatively, changing the code so the lambda is assigned to a discard rather than passing it as an argument, also fixes the issue, even if the#nullable enable
is left in place.This bug is the cause of dotnet/razor#5676 in Razor, which generates code in a similar form to the example here.
The text was updated successfully, but these errors were encountered: