diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs index 7370b711fc1..a1bfb08d661 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostDocumentFormattingEndpointTest.cs @@ -26,8 +26,9 @@ public class CohostDocumentFormattingEndpointTest(HtmlFormattingFixture htmlForm // and provide regression prevention. The tests here are not exhaustive, but they validate the the cohost endpoints // call into the formatting engine at least, and handles C#, Html and Razor formatting changes correctly. - [Fact] - public Task Formatting() + [Theory] + [CombinatorialData] + public Task Formatting(bool fuse) => VerifyDocumentFormattingAsync( input: """ @preservewhitespace true @@ -104,10 +105,13 @@ private void M(string thisIsMyString) } } - """); + """, + fuse: fuse); - private async Task VerifyDocumentFormattingAsync(string input, string expected) + private async Task VerifyDocumentFormattingAsync(string input, string expected, bool fuse) { + UpdateClientInitializationOptions(opt => opt with { ForceRuntimeCodeGeneration = fuse }); + var document = await CreateProjectAndRazorDocumentAsync(input); var inputText = await document.GetTextAsync(DisposalToken); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs index 3919a1298df..587a3aaa6f5 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnAutoInsertEndpointTest.cs @@ -10,6 +10,7 @@ using Microsoft.CodeAnalysis.Text; using Microsoft.VisualStudio.LanguageServer.Protocol; using Microsoft.VisualStudio.LanguageServices.Razor.LanguageClient.Cohost; +using Microsoft.VisualStudio.LicenseManagement.Interop; using Microsoft.VisualStudio.Razor.Settings; using Roslyn.Test.Utilities; using Xunit; @@ -84,8 +85,9 @@ The end. delegatedResponseText: "\"$0\""); } - [Fact] - public async Task CSharp_OnForwardSlash() + [Theory] + [CombinatorialData] + public async Task CSharp_OnForwardSlash(bool fuse) { await VerifyOnAutoInsertAsync( input: """ @@ -102,7 +104,8 @@ void TestMethod() {} void TestMethod() {} } """, - triggerCharacter: "/"); + triggerCharacter: "/", + fuse: fuse); } [Fact] @@ -161,8 +164,9 @@ void TestMethod() fuse: fuse); } - [Fact] - public async Task CSharp_OnEnter_TwoSpaceIndent() + [Theory] + [CombinatorialData] + public async Task CSharp_OnEnter_TwoSpaceIndent(bool fuse) { await VerifyOnAutoInsertAsync( input: """ @@ -180,11 +184,13 @@ void TestMethod() } """, triggerCharacter: "\n", - tabSize: 2); + tabSize: 2, + fuse: fuse); } - [Fact] - public async Task CSharp_OnEnter_UseTabs() + [Theory] + [CombinatorialData] + public async Task CSharp_OnEnter_UseTabs(bool fuse) { const char tab = '\t'; await VerifyOnAutoInsertAsync( @@ -203,7 +209,8 @@ void TestMethod() { } """, triggerCharacter: "\n", - insertSpaces: false); + insertSpaces: false, + fuse: fuse); } private async Task VerifyOnAutoInsertAsync( diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs index 1919956dad4..305704c6412 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostOnTypeFormattingEndpointTest.cs @@ -56,8 +56,9 @@ await VerifyOnTypeFormattingAsync( triggerCharacter: '\n'); } - [Fact] - public async Task CSharp() + [Theory] + [CombinatorialData] + public async Task CSharp(bool fuse) { await VerifyOnTypeFormattingAsync( input: """ @@ -70,11 +71,13 @@ await VerifyOnTypeFormattingAsync( if (true) { } } """, - triggerCharacter: '}'); + triggerCharacter: '}', + fuse: fuse); } - [Fact] - public async Task FormatsSimpleHtmlTag_OnType() + [Theory] + [CombinatorialData] + public async Task FormatsSimpleHtmlTag_OnType(bool fuse) { await VerifyOnTypeFormattingAsync( input: """ @@ -98,11 +101,14 @@ await VerifyOnTypeFormattingAsync( """, triggerCharacter: ';', - html: true); + html: true, + fuse: fuse); } - private async Task VerifyOnTypeFormattingAsync(TestCode input, string expected, char triggerCharacter, bool html = false) + private async Task VerifyOnTypeFormattingAsync(TestCode input, string expected, char triggerCharacter, bool html = false, bool fuse = false) { + UpdateClientInitializationOptions(opt => opt with { ForceRuntimeCodeGeneration = fuse }); + var document = await CreateProjectAndRazorDocumentAsync(input.Text); var inputText = await document.GetTextAsync(DisposalToken); var position = inputText.GetPosition(input.Position);