From 073d39f84f1cefe918118a068aa83433ad486dfb Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 30 Dec 2024 14:59:03 -0800 Subject: [PATCH] Set fallback AnalyzerConfigOptions when test host is cleared. --- tests/TestUtility/OmniSharpTestHost.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/TestUtility/OmniSharpTestHost.cs b/tests/TestUtility/OmniSharpTestHost.cs index 65cdbf25a1..01ffb730fb 100644 --- a/tests/TestUtility/OmniSharpTestHost.cs +++ b/tests/TestUtility/OmniSharpTestHost.cs @@ -163,6 +163,10 @@ public void ClearWorkspace() { Workspace.RemoveProject(projectId); } + + // The fallback AnalyzerConfigOptions seem to be reset when all the Projects are removed from the Workspace. + // Calling initialize again here will set them so that they are available. + WorkspaceInitializer.Initialize(_serviceProvider, _compositionHost); } public Task GetResponse(