Skip to content

Commit a15f64a

Browse files
Decouple EditorFeatures.Test.Utilities from VS services (#78821)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities depended on Microsoft.VisualStudio.Editor which brought along various VS layer services. Further, we had some stub implementations of those VS services there. Digging into this this coupling wasn't really necessary: 1. There were EditorFeatures tests using the editor adapters stub, but those tests pass just fine without it, so that was easy to move to the VS specific tests. 2. StubVsServiceExporters didn't appear to be used either, so unsure why those were in this layer at all. Those were also moved. 3. We had implementations of some settings services, which it's easier to just delete and remove the options persister from the composition in the first place. This also better ensures that we don't have code that might try creating registry keys from ILocalRegistry which we absolutely don't want.
2 parents 6c492e1 + ef33d32 commit a15f64a

12 files changed

+179
-494
lines changed

src/EditorFeatures/Test2/IntelliSense/VisualBasicCompletionCommandHandlerTests.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2607,7 +2607,7 @@ Class C
26072607
End Sub
26082608
End Class
26092609
}]]></Document>,
2610-
extraExportedTypes:={GetType(MockSnippetInfoService), GetType(SnippetCompletionProvider), GetType(StubVsEditorAdaptersFactoryService)}.ToList())
2610+
extraExportedTypes:={GetType(MockSnippetInfoService), GetType(SnippetCompletionProvider)}.ToList())
26112611

26122612
state.Workspace.GlobalOptions.SetGlobalOption(CompletionOptionsStorage.SnippetsBehavior, LanguageNames.VisualBasic, SnippetsRule.AlwaysInclude)
26132613

@@ -2628,7 +2628,7 @@ Class C
26282628
End Sub
26292629
End Class
26302630
}]]></Document>,
2631-
extraExportedTypes:={GetType(MockSnippetInfoService), GetType(SnippetCompletionProvider), GetType(StubVsEditorAdaptersFactoryService)}.ToList())
2631+
extraExportedTypes:={GetType(MockSnippetInfoService), GetType(SnippetCompletionProvider)}.ToList())
26322632

26332633
state.Workspace.GlobalOptions.SetGlobalOption(CompletionOptionsStorage.SnippetsBehavior, LanguageNames.VisualBasic, SnippetsRule.AlwaysInclude)
26342634

@@ -2650,7 +2650,7 @@ Class C
26502650
End Sub
26512651
End Class
26522652
}]]></Document>,
2653-
extraExportedTypes:={GetType(MockSnippetInfoService), GetType(SnippetCompletionProvider), GetType(StubVsEditorAdaptersFactoryService)}.ToList())
2653+
extraExportedTypes:={GetType(MockSnippetInfoService), GetType(SnippetCompletionProvider)}.ToList())
26542654

26552655
state.Workspace.GlobalOptions.SetGlobalOption(CompletionOptionsStorage.SnippetsBehavior, LanguageNames.VisualBasic, SnippetsRule.AlwaysInclude)
26562656

src/EditorFeatures/TestUtilities/Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
<ItemGroup>
2323
<PackageReference Include="Moq" />
2424
<PackageReference Include="BasicUndo" />
25-
<PackageReference Include="Microsoft.VisualStudio.Editor" />
2625
<PackageReference Include="Microsoft.VisualStudio.Platform.VSEditor" />
27-
<PackageReference Include="Microsoft.VisualStudio.Text.Internal" />
2826
</ItemGroup>
2927
<ItemGroup>
3028
<InternalsVisibleTo Include="IdeBenchmarks" />

src/EditorFeatures/TestUtilities/StubLocalRegistry.cs

Lines changed: 0 additions & 105 deletions
This file was deleted.

src/EditorFeatures/TestUtilities/StubSettingsManagerHost.cs

Lines changed: 0 additions & 188 deletions
This file was deleted.

0 commit comments

Comments
 (0)