dotnet/roslyn

Extract method does not respect whitespace when extracting a return statement

Open

#40,023 opened on Nov 26, 2019

View on GitHub
 (0 comments) (0 reactions) (0 assignees)C# (20,414 stars) (4,257 forks)batch import
Area-IDEBugFeature - Extract Methodhelp wanted

Description

Version Used: 16.4.0 P6

Steps to Reproduce:

  1. Highlight a single return statement
  2. Ctrl+. and select extract method code action

Expected Behavior: Newline above return statement preserved

Actual Behavior: Newline not preserved. Seems to be an edge case since extracting regular statements seems to correctly preserve the newline if present.

newlinenotrespected

Contributor guide