diff --git a/src/EditorFeatures/CSharpTest/CodeActions/IntroduceVariable/IntroduceVariableTests.cs b/src/EditorFeatures/CSharpTest/CodeActions/IntroduceVariable/IntroduceVariableTests.cs index 9ec5243d3e9c6c79de49608cb23031608d6b28e0..15bda16ef3d2901f2955b349e38061cfbc36ed27 100644 --- a/src/EditorFeatures/CSharpTest/CodeActions/IntroduceVariable/IntroduceVariableTests.cs +++ b/src/EditorFeatures/CSharpTest/CodeActions/IntroduceVariable/IntroduceVariableTests.cs @@ -7328,5 +7328,43 @@ private static object Foo() } }", index: 1, options: ImplicitTypingEverywhere()); } + + [WorkItem(12591, "https://github.com/dotnet/roslyn/issues/12591")] + [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsIntroduceVariable)] + public async Task TestWhitespaceSelection1() + { + await TestInRegularAndScriptAsync( +@"public class Class1 +{ + void M() + { + Foo(1,[| Bar()|]); + } + + private void Foo(int v1, object v2) + { + } + + private object Bar() + { + } +}", +@"public class Class1 +{ + void M() + { + object {|Rename:v2|} = Bar(); + Foo(1, v2); + } + + private void Foo(int v1, object v2) + { + } + + private object Bar() + { + } +}"); + } } }