dotnet/roslyn

Extract method does not respect whitespace when extracting a return statement

Aperta

#40.023 aperta il 26 nov 2019

 (0 commenti) (0 reazioni) (0 assegnatari)C# (4257 fork)batch import
Area-IDEBugFeature - Extract Methodhelp wanted

Metriche repository

Star
 (20.414 stelle)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

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

Guida contributor