From 98503449cd27483c36cca81b4e06ae5dadcf039a Mon Sep 17 00:00:00 2001 From: David Wengier Date: Thu, 28 Nov 2024 12:57:02 +1100 Subject: [PATCH] Add test for indented usings --- .../Cohost/CohostCodeActionsEndpointTest.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostCodeActionsEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostCodeActionsEndpointTest.cs index e97e100bdeb..3f9ad5ea9b4 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostCodeActionsEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostCodeActionsEndpointTest.cs @@ -896,6 +896,34 @@ @using System """)]); } + [Fact] + public async Task PromoteUsingDirective_Indented() + { + await VerifyCodeActionAsync( + input: """ +
+ @using [||]System +
+ +
+ Hello World +
+ """, + expected: """ +
+
+ +
+ Hello World +
+ """, + codeActionName: LanguageServerConstants.CodeActions.PromoteUsingDirective, + additionalExpectedFiles: [ + (FileUri(@"..\_Imports.razor"), """ + @using System + """)]); + } + [Fact] public async Task PromoteUsingDirective_Mvc() {