private static Type[] GetNeutralAndCSharpAndVisualBasicTypes() { var types = new[] { // ROSLYN typeof(CodeAnalysis.CSharp.IntroduceVariable.CSharpIntroduceVariableService), // Ensures that CSharpFeatures is included in the composition typeof(CodeAnalysis.VisualBasic.IntroduceVariable.VisualBasicIntroduceVariableService), // Ensures that BasicFeatures is included in the composition typeof(CSharp.ContentType.ContentTypeDefinitions), // CSharp Content Type typeof(VisualBasic.ContentType.ContentTypeDefinitions), // VB Content Type typeof(VisualBasic.Formatting.Indentation.VisualBasicIndentationService), typeof(CSharp.Formatting.Indentation.CSharpIndentationService), typeof(CodeAnalysis.CSharp.CSharpCompilationFactoryService), typeof(CodeAnalysis.VisualBasic.VisualBasicCompilationFactoryService), typeof(CodeAnalysis.CSharp.CSharpSyntaxTreeFactoryServiceFactory), // CSharpServicesCore typeof(CodeAnalysis.VisualBasic.VisualBasicSyntaxTreeFactoryServiceFactory), // BasicServicesCore typeof(CodeAnalysis.CSharp.CodeGeneration.CSharpCodeGenerationServiceFactory), typeof(CodeAnalysis.VisualBasic.CodeGeneration.VisualBasicCodeGenerationServiceFactory), typeof(CodeAnalysis.CSharp.CSharpSyntaxFactsServiceFactory), typeof(CodeAnalysis.VisualBasic.VisualBasicSyntaxFactsServiceFactory), typeof(CodeAnalysis.CSharp.CSharpSymbolDeclarationService), typeof(CodeAnalysis.VisualBasic.VisualBasicSymbolDeclarationService), typeof(CSharp.LanguageServices.CSharpSymbolDisplayServiceFactory), typeof(CSharp.Interactive.CSharpInteractiveEvaluator), typeof(VisualBasic.LanguageServices.VisualBasicSymbolDisplayServiceFactory), typeof(VisualBasic.Interactive.VisualBasicInteractiveEvaluator), typeof(CodeAnalysis.CSharp.Simplification.CSharpSimplificationService), typeof(CodeAnalysis.VisualBasic.Simplification.VisualBasicSimplificationService), typeof(CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService), typeof(CodeAnalysis.VisualBasic.Rename.VisualBasicRenameRewriterLanguageServiceFactory), typeof(CodeAnalysis.CSharp.CSharpSemanticFactsServiceFactory), typeof(CodeAnalysis.VisualBasic.VisualBasicSemanticFactsServiceFactory), typeof(CodeAnalysis.CSharp.CodeGeneration.CSharpSyntaxGenerator), typeof(CodeAnalysis.VisualBasic.CodeGeneration.VisualBasicSyntaxGenerator), typeof(CSharp.LanguageServices.CSharpContentTypeLanguageService), typeof(VisualBasic.LanguageServices.VisualBasicContentTypeLanguageService), typeof(CodeAnalysis.CSharp.Execution.CSharpOptionsSerializationService), typeof(CodeAnalysis.VisualBasic.Execution.VisualBasicOptionsSerializationService), typeof(CodeAnalysis.Execution.DesktopReferenceSerializationServiceFactory), typeof(TestExportProvider) }; return(ServiceTestExportProvider.GetLanguageNeutralTypes() .Concat(types) .Concat(DesktopTestHelpers.GetAllTypesImplementingGivenInterface( typeof(CodeAnalysis.CSharp.Formatting.DefaultOperationProvider).Assembly, typeof(ISyntaxFormattingService))) .Concat(DesktopTestHelpers.GetAllTypesImplementingGivenInterface( typeof(CodeAnalysis.VisualBasic.Formatting.DefaultOperationProvider).Assembly, typeof(ISyntaxFormattingService))) .Concat(DesktopTestHelpers.GetAllTypesImplementingGivenInterface( typeof(CodeAnalysis.CSharp.Formatting.DefaultOperationProvider).Assembly, typeof(IFormattingRule))) .Concat(DesktopTestHelpers.GetAllTypesImplementingGivenInterface( typeof(CodeAnalysis.VisualBasic.Formatting.DefaultOperationProvider).Assembly, typeof(IFormattingRule))) .Concat(DesktopTestHelpers.GetAllTypesImplementingGivenInterface( typeof(CodeAnalysis.CSharp.Formatting.DefaultOperationProvider).Assembly, typeof(ICodeGenerationService))) .Concat(DesktopTestHelpers.GetAllTypesImplementingGivenInterface( typeof(CodeAnalysis.VisualBasic.Formatting.DefaultOperationProvider).Assembly, typeof(ICodeGenerationService))) .Concat(TestHelpers.GetAllTypesWithStaticFieldsImplementingType(typeof(CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions).Assembly, typeof(CodeAnalysis.Options.IOption))) .Distinct() .ToArray()); }
protected override ExportProvider GetExportProvider() { // Get all the liveshare request handlers in this assembly. var liveShareRequestHelperTypes = DesktopTestHelpers.GetAllTypesImplementingGivenInterface( typeof(LoadHandler).Assembly, typeof(ILspRequestHandler)); // Get all of the roslyn request helpers in M.CA.LanguageServer var roslynRequestHelperTypes = DesktopTestHelpers.GetAllTypesImplementingGivenInterface( typeof(RoslynHandlers.IRequestHandler).Assembly, typeof(RoslynHandlers.IRequestHandler)); var exportProviderFactory = ExportProviderCache.GetOrCreateExportProviderFactory( TestExportProvider.EntireAssemblyCatalogWithCSharpAndVisualBasic .WithPart(typeof(MockDocumentNavigationServiceFactory)) .WithParts(liveShareRequestHelperTypes) .WithParts(roslynRequestHelperTypes)); return(exportProviderFactory.CreateExportProvider()); }