Skip to content
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

C# statement after single-line comment in lambda expression indented incorrectly when surrounding it with a block #41323

Open
vsfeedback opened this issue Jan 30, 2020 · 0 comments
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com 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
Projects
Milestone

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


When I have a multi-line lambda expression including a single-line comment, and I surround that lambda expression with a block, the line following the single-line comment is not indented correctly when typing the closing brace of the block.

Steps to reproduce:

  1. Create a new C# Console App (.NET Framework 4.7.2).
  2. Insert the following code into the Main method:
			Action action = () =>
			{
				Console.WriteLine(); // Test
				Console.WriteLine();
				Console.WriteLine();
			};
  1. Insert a blank line after the opening brace of the Main method.
  2. Type an opening brace on that inserted line.
  3. If a closing brace has been inserted automatically, delete that.
  4. Insert a blank line after the closing brace and semicolon of the lambda expression.
  5. Type a closing brace on that inserted line.

Expected result:

		static void Main(string[] args)
		{
			{
				Action action = () =>
				{
					Console.WriteLine(); // Test
					Console.WriteLine();
					Console.WriteLine();
				};
			}
		}

Actual result:

		static void Main(string[] args)
		{
			{
				Action action = () =>
				{
					Console.WriteLine(); // Test
				Console.WriteLine();
					Console.WriteLine();
				};
			}
		}

Reporting this problem now failed three times in a row due to the following problem:
https://developercommunity.visualstudio.com/content/problem/750387/recording-steps-to-report-a-problem-didnt-finish-c.html
So I can only send this without a recording now.


Original Comments

Visual Studio Feedback System on 1/20/2020, 07:13 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

@sharwell sharwell added Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com 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 labels Jan 30, 2020
@sharwell sharwell added this to InQueue in Small Fixes via automation Jan 30, 2020
@sharwell sharwell added this to the Backlog milestone Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Developer Community The issue was originally reported on https://developercommunity.visualstudio.com 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
Projects
Small Fixes
  
InQueue
Development

No branches or pull requests

2 participants