From d896ff649e1d4426f8ff60d97731b8cefcfecfe4 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Mon, 20 Jan 2020 16:11:18 -0800 Subject: [PATCH] Fix RS0034 by defining missing constructors --- ...gnOutParametersAboveReturnCodeFixProvider.cs | 5 +++++ ...AssignOutParametersAtStartCodeFixProvider.cs | 5 +++++ .../CSharpRefactoringHelpersService.cs | 5 +++++ ...witchStatementToExpressionCodeFixProvider.cs | 5 +++++ ...mplementExplicitlyCodeRefactoringProvider.cs | 5 +++++ ...mplementImplicitlyCodeRefactoringProvider.cs | 5 +++++ ...LocalForExpressionCodeRefactoringProvider.cs | 5 +++++ ...ocalFunctionStaticCodeRefactoringProvider.cs | 5 +++++ ...pturedVariablesAsArgumentsCodeFixProvider.cs | 5 +++++ .../CSharpMakeMemberStaticCodeFixProvider.cs | 5 +++++ ...ationNearReferenceCodeRefactoringProvider.cs | 4 ++++ ...rpPopulateSwitchExpressionCodeFixProvider.cs | 5 +++++ ...arpPopulateSwitchStatementCodeFixProvider.cs | 4 ++++ ...everseForStatementCodeRefactoringProvider.cs | 5 +++++ ...nitializerExpressionSignatureHelpProvider.cs | 5 +++++ ...SharpSimplifyInterpolationCodeFixProvider.cs | 5 +++++ ...eExpressionBodyForLambdaCodeStyleProvider.cs | 8 ++++++++ .../ConfigureCodeStyleOptionCodeFixProvider.cs | 5 +++++ .../ConfigureSeverityLevelCodeFixProvider.cs | 5 +++++ ...actTypeImportCompletionService.CacheEntry.cs | 4 ++++ ...onMethodImportCompletionHelper.CacheEntry.cs | 4 ++++ ...HostSolutionCrawlerWorkspaceEventListener.cs | 5 +++++ ...MiscSolutionCrawlerWorkspaceEventListener.cs | 5 +++++ .../UseSystemHashCodeCodeFixProvider.cs | 5 +++++ .../Handler/Completion/CompletionHandler.cs | 5 +++++ .../Completion/CompletionResolveHandler.cs | 5 +++++ .../FoldingRanges/FoldingRangesHandler.cs | 5 +++++ .../Handler/Formatting/FormatDocumentHandler.cs | 5 +++++ .../Formatting/FormatDocumentOnTypeHandler.cs | 5 +++++ .../Formatting/FormatDocumentRangeHandler.cs | 5 +++++ .../Highlights/DocumentHighlightHandler.cs | 5 +++++ .../Protocol/Handler/Hover/HoverHandler.cs | 5 +++++ .../Handler/Initialize/InitializeHandler.cs | 5 +++++ .../References/FindImplementationsHandler.cs | 5 +++++ .../Handler/Symbols/DocumentSymbolsHandler.cs | 5 +++++ .../Handler/Symbols/WorkspaceSymbolsHandler.cs | 5 +++++ .../VisualBasicRefactoringHelpersService.vb | 4 ++++ ...LocalForExpressionCodeRefactoringProvider.vb | 4 ++++ ...sicMoveDeclarationNearRefactoringProvider.vb | 4 ++++ ...sicPopulateSwitchStatementCodeFixProvider.vb | 4 ++++ ...ollectionInitializerSignatureHelpProvider.vb | 4 ++++ ...BasicSimplifyInterpolationCodeFixProvider.vb | 4 ++++ .../PersistentStorageLocationService.cs | 5 +++++ .../FSharpCommentSelectionService.cs | 5 +++++ .../FSharpDocumentNavigationService.cs | 5 +++++ ...ectExistsUIContextProviderLanguageService.cs | 5 +++++ .../Experimentation/ExperimentationOptions.cs | 5 +++++ .../ContainingMemberColumnDefinition.cs | 6 ++++++ .../ContainingTypeColumnDefinition.cs | 6 ++++++ ...ientServiceFactory.WorkspaceEventListener.cs | 5 +++++ ...ualStudioPersistentStorageLocationService.cs | 5 +++++ .../LiveShare/Impl/ClassificationsHandler.cs | 17 +++++++++++++++++ .../RoslynClassificationService.Exports.cs | 10 ++++++++++ .../CSharpRemoteBlockStructureService.cs | 5 +++++ .../CSharpRemoteBraceCompletionService.cs | 5 +++++ .../CSharpRemoteCompilationFactoryService.cs | 5 +++++ .../CSharpRemoteDocumentDifferenceService.cs | 5 +++++ .../CSharpRemoteLineSeparatorService.cs | 5 +++++ ...teRenameTrackingLanguageHeuristicsService.cs | 5 +++++ .../CSharpRemoteSyntaxFactsService.cs | 5 +++++ .../CSharpRemoteSyntaxTreeFactoryService.cs | 5 +++++ .../CSharpRemoteCommentSelectionService.cs | 5 +++++ ...moteDocumentationCommentFormattingService.cs | 5 +++++ .../Comments/VBRemoteCommentSelectionService.cs | 5 +++++ ...moteDocumentationCommentFormattingService.cs | 5 +++++ .../Debugging/CSharpRemoteBreakpointService.cs | 5 +++++ .../Debugging/CSharpRemoteDebugInfoService.cs | 5 +++++ .../Debugging/VBRemoteBreakpointService.cs | 5 +++++ .../Debugging/VBRemoteDebugInfoService.cs | 5 +++++ .../CSharpRemoteEditorFormattingService.cs | 5 +++++ .../Formatting/CSharpRemoteFormattingService.cs | 5 +++++ .../CSharpRemoteIndentationService.cs | 4 ++++ .../CSharpRemoteSyntaxFormattingService.cs | 5 +++++ .../VBRemoteEditorFormattingService.cs | 5 +++++ .../Formatting/VBRemoteFormattingService.cs | 5 +++++ .../Formatting/VBRemoteIndentationService.cs | 5 +++++ .../VBRemoteSyntaxFormattingService.cs | 5 +++++ .../VBRemoteBlockStructureService.cs | 5 +++++ .../VBRemoteBraceCompletionService.cs | 5 +++++ .../VBRemoteCompilationFactoryService.cs | 5 +++++ .../VBRemoteDocumentDifferenceService.cs | 5 +++++ .../VBRemoteLineSeparatorService.cs | 5 +++++ ...teRenameTrackingLanguageHeuristicsService.cs | 5 +++++ .../VBRemoteSyntaxFactsService.cs | 5 +++++ .../VBRemoteSyntaxTreeFactoryService.cs | 5 +++++ .../Impl/Client/RoslynLSPClientService.cs | 15 +++++++++++++++ .../LiveShare/Impl/LSPSDKInitializeHandler.cs | 6 ++++++ .../Impl/LexicalClassificationsHandler.cs | 9 +++++++++ src/VisualStudio/LiveShare/Impl/LoadHandler.cs | 17 +++++++++++++++++ .../LiveShare/Impl/ProjectsHandler.Exports.cs | 17 +++++++++++++++++ .../Impl/SyntaxClassificationsHandler.cs | 9 +++++++++ .../MockDocumentNavigationServiceFactory.cs | 5 +++++ .../VisualStudioTestExportProvider.vb | 6 ++++++ ...ectExistsUIContextProviderLanguageService.vb | 4 ++++ .../CSharpSyntaxKindsServiceFactory.cs | 5 +++++ .../ExternalAccess/Pythia/Api/PythiaOptions.cs | 5 +++++ .../Services/RemoteExperimentationService.cs | 5 +++++ .../RemotePersistentStorageLocationService.cs | 10 ++++++++++ .../VisualBasicSyntaxKindsServiceFactory.vb | 4 ++++ 99 files changed, 553 insertions(+) diff --git a/src/Features/CSharp/Portable/AssignOutParameters/AssignOutParametersAboveReturnCodeFixProvider.cs b/src/Features/CSharp/Portable/AssignOutParameters/AssignOutParametersAboveReturnCodeFixProvider.cs index 8aa0876cf05..1e3c150d94b 100644 --- a/src/Features/CSharp/Portable/AssignOutParameters/AssignOutParametersAboveReturnCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/AssignOutParameters/AssignOutParametersAboveReturnCodeFixProvider.cs @@ -16,6 +16,11 @@ namespace Microsoft.CodeAnalysis.CSharp.AssignOutParameters [ExportCodeFixProvider(LanguageNames.CSharp), Shared] internal class AssignOutParametersAboveReturnCodeFixProvider : AbstractAssignOutParametersCodeFixProvider { + [ImportingConstructor] + public AssignOutParametersAboveReturnCodeFixProvider() + { + } + protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location) { context.RegisterCodeFix(new MyCodeAction( diff --git a/src/Features/CSharp/Portable/AssignOutParameters/AssignOutParametersAtStartCodeFixProvider.cs b/src/Features/CSharp/Portable/AssignOutParameters/AssignOutParametersAtStartCodeFixProvider.cs index 87ec0ac59c5..fc4a6c5c2ac 100644 --- a/src/Features/CSharp/Portable/AssignOutParameters/AssignOutParametersAtStartCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/AssignOutParameters/AssignOutParametersAtStartCodeFixProvider.cs @@ -14,6 +14,11 @@ namespace Microsoft.CodeAnalysis.CSharp.AssignOutParameters [ExportCodeFixProvider(LanguageNames.CSharp), Shared] internal class AssignOutParametersAtStartCodeFixProvider : AbstractAssignOutParametersCodeFixProvider { + [ImportingConstructor] + public AssignOutParametersAtStartCodeFixProvider() + { + } + protected override void TryRegisterFix(CodeFixContext context, Document document, SyntaxNode container, SyntaxNode location) { // Don't offer if we're already the starting statement of the container. This case will diff --git a/src/Features/CSharp/Portable/CodeRefactorings/CSharpRefactoringHelpersService.cs b/src/Features/CSharp/Portable/CodeRefactorings/CSharpRefactoringHelpersService.cs index 01190a8a1e1..9ff12a85735 100644 --- a/src/Features/CSharp/Portable/CodeRefactorings/CSharpRefactoringHelpersService.cs +++ b/src/Features/CSharp/Portable/CodeRefactorings/CSharpRefactoringHelpersService.cs @@ -14,6 +14,11 @@ namespace Microsoft.CodeAnalysis.CSharp.CodeRefactorings [ExportLanguageService(typeof(IRefactoringHelpersService), LanguageNames.CSharp), Shared] internal class CSharpRefactoringHelpersService : AbstractRefactoringHelpersService { + [ImportingConstructor] + public CSharpRefactoringHelpersService() + { + } + protected override IEnumerable ExtractNodesSimple(SyntaxNode? node, ISyntaxFactsService syntaxFacts) { if (node == null) diff --git a/src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs b/src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs index a0cf5248df1..2304bfc1625 100644 --- a/src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/ConvertSwitchStatementToExpression/ConvertSwitchStatementToExpressionCodeFixProvider.cs @@ -25,6 +25,11 @@ namespace Microsoft.CodeAnalysis.CSharp.ConvertSwitchStatementToExpression [ExportCodeFixProvider(LanguageNames.CSharp), Shared] internal sealed partial class ConvertSwitchStatementToExpressionCodeFixProvider : SyntaxEditorBasedCodeFixProvider { + [ImportingConstructor] + public ConvertSwitchStatementToExpressionCodeFixProvider() + { + } + public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create(IDEDiagnosticIds.ConvertSwitchStatementToExpressionDiagnosticId); diff --git a/src/Features/CSharp/Portable/ImplementInterface/CSharpImplementExplicitlyCodeRefactoringProvider.cs b/src/Features/CSharp/Portable/ImplementInterface/CSharpImplementExplicitlyCodeRefactoringProvider.cs index af4db80e335..acb2d81c0bb 100644 --- a/src/Features/CSharp/Portable/ImplementInterface/CSharpImplementExplicitlyCodeRefactoringProvider.cs +++ b/src/Features/CSharp/Portable/ImplementInterface/CSharpImplementExplicitlyCodeRefactoringProvider.cs @@ -24,6 +24,11 @@ namespace Microsoft.CodeAnalysis.CSharp.ImplementInterface internal class CSharpImplementExplicitlyCodeRefactoringProvider : AbstractChangeImplementionCodeRefactoringProvider { + [ImportingConstructor] + public CSharpImplementExplicitlyCodeRefactoringProvider() + { + } + protected override string Implement_0 => FeaturesResources.Implement_0_explicitly; protected override string Implement_all_interfaces => FeaturesResources.Implement_all_interfaces_explicitly; protected override string Implement => FeaturesResources.Implement_explicitly; diff --git a/src/Features/CSharp/Portable/ImplementInterface/CSharpImplementImplicitlyCodeRefactoringProvider.cs b/src/Features/CSharp/Portable/ImplementInterface/CSharpImplementImplicitlyCodeRefactoringProvider.cs index bb9d5cee179..c1120c2c000 100644 --- a/src/Features/CSharp/Portable/ImplementInterface/CSharpImplementImplicitlyCodeRefactoringProvider.cs +++ b/src/Features/CSharp/Portable/ImplementInterface/CSharpImplementImplicitlyCodeRefactoringProvider.cs @@ -18,6 +18,11 @@ namespace Microsoft.CodeAnalysis.CSharp.ImplementInterface internal class CSharpImplementImplicitlyCodeRefactoringProvider : AbstractChangeImplementionCodeRefactoringProvider { + [ImportingConstructor] + public CSharpImplementImplicitlyCodeRefactoringProvider() + { + } + protected override string Implement_0 => FeaturesResources.Implement_0_implicitly; protected override string Implement_all_interfaces => FeaturesResources.Implement_all_interfaces_implicitly; protected override string Implement => FeaturesResources.Implement_implicitly; diff --git a/src/Features/CSharp/Portable/IntroduceVariable/CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs b/src/Features/CSharp/Portable/IntroduceVariable/CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs index 72f2fa6c086..9c947ea478c 100644 --- a/src/Features/CSharp/Portable/IntroduceVariable/CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs +++ b/src/Features/CSharp/Portable/IntroduceVariable/CSharpIntroduceLocalForExpressionCodeRefactoringProvider.cs @@ -16,6 +16,11 @@ internal class CSharpIntroduceLocalForExpressionCodeRefactoringProvider : ExpressionStatementSyntax, LocalDeclarationStatementSyntax> { + [ImportingConstructor] + public CSharpIntroduceLocalForExpressionCodeRefactoringProvider() + { + } + protected override bool IsValid(ExpressionStatementSyntax expressionStatement, TextSpan span) { // Expression is likely too simple to want to offer to generate a local for. diff --git a/src/Features/CSharp/Portable/MakeLocalFunctionStatic/MakeLocalFunctionStaticCodeRefactoringProvider.cs b/src/Features/CSharp/Portable/MakeLocalFunctionStatic/MakeLocalFunctionStaticCodeRefactoringProvider.cs index faa66d268a0..cac34c66181 100644 --- a/src/Features/CSharp/Portable/MakeLocalFunctionStatic/MakeLocalFunctionStaticCodeRefactoringProvider.cs +++ b/src/Features/CSharp/Portable/MakeLocalFunctionStatic/MakeLocalFunctionStaticCodeRefactoringProvider.cs @@ -15,6 +15,11 @@ namespace Microsoft.CodeAnalysis.CSharp.MakeLocalFunctionStatic [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = nameof(MakeLocalFunctionStaticCodeRefactoringProvider)), Shared] internal sealed class MakeLocalFunctionStaticCodeRefactoringProvider : CodeRefactoringProvider { + [ImportingConstructor] + public MakeLocalFunctionStaticCodeRefactoringProvider() + { + } + public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) { var (document, textSpan, cancellationToken) = context; diff --git a/src/Features/CSharp/Portable/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProvider.cs b/src/Features/CSharp/Portable/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProvider.cs index 6ec2dfcffb8..853ccf88d46 100644 --- a/src/Features/CSharp/Portable/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProvider.cs @@ -19,6 +19,11 @@ namespace Microsoft.CodeAnalysis.CSharp.MakeLocalFunctionStatic [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(PassInCapturedVariablesAsArgumentsCodeFixProvider)), Shared] internal sealed class PassInCapturedVariablesAsArgumentsCodeFixProvider : SyntaxEditorBasedCodeFixProvider { + [ImportingConstructor] + public PassInCapturedVariablesAsArgumentsCodeFixProvider() + { + } + // "CS8421: A static local function can't contain a reference to ." public override ImmutableArray FixableDiagnosticIds => ImmutableArray.Create("CS8421"); diff --git a/src/Features/CSharp/Portable/MakeMemberStatic/CSharpMakeMemberStaticCodeFixProvider.cs b/src/Features/CSharp/Portable/MakeMemberStatic/CSharpMakeMemberStaticCodeFixProvider.cs index 38388407ad1..4b4e4052697 100644 --- a/src/Features/CSharp/Portable/MakeMemberStatic/CSharpMakeMemberStaticCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/MakeMemberStatic/CSharpMakeMemberStaticCodeFixProvider.cs @@ -12,6 +12,11 @@ namespace Microsoft.CodeAnalysis.CSharp.MakeMemberStatic [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(CSharpMakeMemberStaticCodeFixProvider)), Shared] internal sealed class CSharpMakeMemberStaticCodeFixProvider : AbstractMakeMemberStaticCodeFixProvider { + [ImportingConstructor] + public CSharpMakeMemberStaticCodeFixProvider() + { + } + public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create( "CS0708" // 'MyMethod': cannot declare instance members in a static class diff --git a/src/Features/CSharp/Portable/MoveDeclarationNearReference/CSharpMoveDeclarationNearReferenceCodeRefactoringProvider.cs b/src/Features/CSharp/Portable/MoveDeclarationNearReference/CSharpMoveDeclarationNearReferenceCodeRefactoringProvider.cs index 55fe9483ad6..472a1e19e57 100644 --- a/src/Features/CSharp/Portable/MoveDeclarationNearReference/CSharpMoveDeclarationNearReferenceCodeRefactoringProvider.cs +++ b/src/Features/CSharp/Portable/MoveDeclarationNearReference/CSharpMoveDeclarationNearReferenceCodeRefactoringProvider.cs @@ -11,5 +11,9 @@ namespace Microsoft.CodeAnalysis.CSharp.MoveDeclarationNearReference [ExtensionOrder(After = PredefinedCodeRefactoringProviderNames.InlineTemporary)] class CSharpMoveDeclarationNearReferenceCodeRefactoringProvider : AbstractMoveDeclarationNearReferenceCodeRefactoringProvider { + [ImportingConstructor] + public CSharpMoveDeclarationNearReferenceCodeRefactoringProvider() + { + } } } diff --git a/src/Features/CSharp/Portable/PopulateSwitch/CSharpPopulateSwitchExpressionCodeFixProvider.cs b/src/Features/CSharp/Portable/PopulateSwitch/CSharpPopulateSwitchExpressionCodeFixProvider.cs index 6990f511a92..f66b3188040 100644 --- a/src/Features/CSharp/Portable/PopulateSwitch/CSharpPopulateSwitchExpressionCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/PopulateSwitch/CSharpPopulateSwitchExpressionCodeFixProvider.cs @@ -24,6 +24,11 @@ internal class CSharpPopulateSwitchExpressionCodeFixProvider SwitchExpressionArmSyntax, MemberAccessExpressionSyntax> { + [ImportingConstructor] + public CSharpPopulateSwitchExpressionCodeFixProvider() + { + } + protected override SwitchExpressionArmSyntax CreateDefaultSwitchArm(SyntaxGenerator generator, Compilation compilation) => SwitchExpressionArm(DiscardPattern(), Exception(generator, compilation)); diff --git a/src/Features/CSharp/Portable/PopulateSwitch/CSharpPopulateSwitchStatementCodeFixProvider.cs b/src/Features/CSharp/Portable/PopulateSwitch/CSharpPopulateSwitchStatementCodeFixProvider.cs index 71ac530f0df..b217eac1efa 100644 --- a/src/Features/CSharp/Portable/PopulateSwitch/CSharpPopulateSwitchStatementCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/PopulateSwitch/CSharpPopulateSwitchStatementCodeFixProvider.cs @@ -15,5 +15,9 @@ namespace Microsoft.CodeAnalysis.CSharp.PopulateSwitch internal class CSharpPopulateSwitchStatementCodeFixProvider : AbstractPopulateSwitchStatementCodeFixProvider< SwitchStatementSyntax, SwitchSectionSyntax, MemberAccessExpressionSyntax> { + [ImportingConstructor] + public CSharpPopulateSwitchStatementCodeFixProvider() + { + } } } diff --git a/src/Features/CSharp/Portable/ReverseForStatement/CSharpReverseForStatementCodeRefactoringProvider.cs b/src/Features/CSharp/Portable/ReverseForStatement/CSharpReverseForStatementCodeRefactoringProvider.cs index f2b228f5d17..ee2203b5af2 100644 --- a/src/Features/CSharp/Portable/ReverseForStatement/CSharpReverseForStatementCodeRefactoringProvider.cs +++ b/src/Features/CSharp/Portable/ReverseForStatement/CSharpReverseForStatementCodeRefactoringProvider.cs @@ -24,6 +24,11 @@ namespace Microsoft.CodeAnalysis.CSharp.ReverseForStatement [ExportCodeRefactoringProvider(LanguageNames.CSharp), Shared] internal class CSharpReverseForStatementCodeRefactoringProvider : CodeRefactoringProvider { + [ImportingConstructor] + public CSharpReverseForStatementCodeRefactoringProvider() + { + } + public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context) { var forStatement = await context.TryGetRelevantNodeAsync().ConfigureAwait(false); diff --git a/src/Features/CSharp/Portable/SignatureHelp/InitializerExpressionSignatureHelpProvider.cs b/src/Features/CSharp/Portable/SignatureHelp/InitializerExpressionSignatureHelpProvider.cs index 47629903ac1..010eb7d2208 100644 --- a/src/Features/CSharp/Portable/SignatureHelp/InitializerExpressionSignatureHelpProvider.cs +++ b/src/Features/CSharp/Portable/SignatureHelp/InitializerExpressionSignatureHelpProvider.cs @@ -15,6 +15,11 @@ namespace Microsoft.CodeAnalysis.CSharp.SignatureHelp [ExportSignatureHelpProvider(nameof(InitializerExpressionSignatureHelpProvider), LanguageNames.CSharp), Shared] internal partial class InitializerExpressionSignatureHelpProvider : AbstractOrdinaryMethodSignatureHelpProvider { + [ImportingConstructor] + public InitializerExpressionSignatureHelpProvider() + { + } + public override bool IsTriggerCharacter(char ch) => ch == '{' || ch == ','; diff --git a/src/Features/CSharp/Portable/SimplifyInterpolation/CSharpSimplifyInterpolationCodeFixProvider.cs b/src/Features/CSharp/Portable/SimplifyInterpolation/CSharpSimplifyInterpolationCodeFixProvider.cs index b915a1c5516..d4f9ad451fa 100644 --- a/src/Features/CSharp/Portable/SimplifyInterpolation/CSharpSimplifyInterpolationCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/SimplifyInterpolation/CSharpSimplifyInterpolationCodeFixProvider.cs @@ -13,6 +13,11 @@ internal class CSharpSimplifyInterpolationCodeFixProvider : AbstractSimplifyInte InterpolationSyntax, ExpressionSyntax, InterpolationAlignmentClauseSyntax, InterpolationFormatClauseSyntax, InterpolatedStringExpressionSyntax> { + [ImportingConstructor] + public CSharpSimplifyInterpolationCodeFixProvider() + { + } + protected override InterpolationSyntax WithExpression(InterpolationSyntax interpolation, ExpressionSyntax expression) => interpolation.WithExpression(expression); diff --git a/src/Features/CSharp/Portable/UseExpressionBodyForLambda/UseExpressionBodyForLambdaCodeStyleProvider.cs b/src/Features/CSharp/Portable/UseExpressionBodyForLambda/UseExpressionBodyForLambdaCodeStyleProvider.cs index 5ee0db0e412..3c488588025 100644 --- a/src/Features/CSharp/Portable/UseExpressionBodyForLambda/UseExpressionBodyForLambdaCodeStyleProvider.cs +++ b/src/Features/CSharp/Portable/UseExpressionBodyForLambda/UseExpressionBodyForLambdaCodeStyleProvider.cs @@ -227,11 +227,19 @@ public MyCodeAction(string title, Func> create [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(UseExpressionBodyForLambdaCodeFixProvider)), Shared] internal sealed class UseExpressionBodyForLambdaCodeFixProvider : UseExpressionBodyForLambdaCodeStyleProvider.CodeFixProvider { + [ImportingConstructor] + public UseExpressionBodyForLambdaCodeFixProvider() + { + } } [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = nameof(UseExpressionBodyForLambdaCodeRefactoringProvider)), Shared] internal sealed class UseExpressionBodyForLambdaCodeRefactoringProvider : UseExpressionBodyForLambdaCodeStyleProvider.CodeRefactoringProvider { + [ImportingConstructor] + public UseExpressionBodyForLambdaCodeRefactoringProvider() + { + } } [DiagnosticAnalyzer(LanguageNames.CSharp)] diff --git a/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureCodeStyle/ConfigureCodeStyleOptionCodeFixProvider.cs b/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureCodeStyle/ConfigureCodeStyleOptionCodeFixProvider.cs index 98e5a5bfabb..84b2a453acf 100644 --- a/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureCodeStyle/ConfigureCodeStyleOptionCodeFixProvider.cs +++ b/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureCodeStyle/ConfigureCodeStyleOptionCodeFixProvider.cs @@ -27,6 +27,11 @@ internal sealed partial class ConfigureCodeStyleOptionCodeFixProvider : IConfigu { private static readonly ImmutableArray s_boolValues = ImmutableArray.Create(true, false); + [ImportingConstructor] + public ConfigureCodeStyleOptionCodeFixProvider() + { + } + public bool IsFixableDiagnostic(Diagnostic diagnostic) { // We only offer fix for configurable code style diagnostics which have one of more editorconfig based storage locations. diff --git a/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureSeverity/ConfigureSeverityLevelCodeFixProvider.cs b/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureSeverity/ConfigureSeverityLevelCodeFixProvider.cs index 4ea6b9da58e..7ff584f8484 100644 --- a/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureSeverity/ConfigureSeverityLevelCodeFixProvider.cs +++ b/src/Features/Core/Portable/CodeFixes/Configuration/ConfigureSeverity/ConfigureSeverityLevelCodeFixProvider.cs @@ -26,6 +26,11 @@ internal sealed partial class ConfigureSeverityLevelCodeFixProvider : IConfigura (nameof(EditorConfigSeverityStrings.Warning), EditorConfigSeverityStrings.Warning), (nameof(EditorConfigSeverityStrings.Error), EditorConfigSeverityStrings.Error)); + [ImportingConstructor] + public ConfigureSeverityLevelCodeFixProvider() + { + } + // We only offer fix for configurable diagnostics. // Also skip suppressed diagnostics defensively, though the code fix engine should ideally never call us for suppressed diagnostics. public bool IsFixableDiagnostic(Diagnostic diagnostic) diff --git a/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractTypeImportCompletionService.CacheEntry.cs b/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractTypeImportCompletionService.CacheEntry.cs index a6170b765d6..da68130b679 100644 --- a/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractTypeImportCompletionService.CacheEntry.cs +++ b/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/AbstractTypeImportCompletionService.CacheEntry.cs @@ -141,6 +141,10 @@ public void Dispose() [ExportWorkspaceServiceFactory(typeof(IImportCompletionCacheService), ServiceLayer.Editor), Shared] private sealed class CacheServiceFactory : AbstractImportCompletionCacheServiceFactory { + [ImportingConstructor] + public CacheServiceFactory() + { + } } } } diff --git a/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ExtensionMethodImportCompletionHelper.CacheEntry.cs b/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ExtensionMethodImportCompletionHelper.CacheEntry.cs index eba893a7155..892ef49bab5 100644 --- a/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ExtensionMethodImportCompletionHelper.CacheEntry.cs +++ b/src/Features/Core/Portable/Completion/Providers/ImportCompletionProvider/ExtensionMethodImportCompletionHelper.CacheEntry.cs @@ -97,6 +97,10 @@ public void Dispose() [ExportWorkspaceServiceFactory(typeof(IImportCompletionCacheService), ServiceLayer.Editor), Shared] private sealed class CacheServiceFactory : AbstractImportCompletionCacheServiceFactory { + [ImportingConstructor] + public CacheServiceFactory() + { + } } private static IImportCompletionCacheService GetCacheService(Workspace workspace) diff --git a/src/Features/Core/Portable/SolutionCrawler/HostSolutionCrawlerWorkspaceEventListener.cs b/src/Features/Core/Portable/SolutionCrawler/HostSolutionCrawlerWorkspaceEventListener.cs index e9d611cf75d..7c99493e811 100644 --- a/src/Features/Core/Portable/SolutionCrawler/HostSolutionCrawlerWorkspaceEventListener.cs +++ b/src/Features/Core/Portable/SolutionCrawler/HostSolutionCrawlerWorkspaceEventListener.cs @@ -8,6 +8,11 @@ namespace Microsoft.CodeAnalysis.SolutionCrawler [ExportEventListener(WellKnownEventListeners.Workspace, WorkspaceKind.Host), Shared] internal class HostSolutionCrawlerWorkspaceEventListener : IEventListener, IEventListenerStoppable { + [ImportingConstructor] + public HostSolutionCrawlerWorkspaceEventListener() + { + } + public void StartListening(Workspace workspace, object serviceOpt) { var registration = workspace.Services.GetService(); diff --git a/src/Features/Core/Portable/SolutionCrawler/MiscSolutionCrawlerWorkspaceEventListener.cs b/src/Features/Core/Portable/SolutionCrawler/MiscSolutionCrawlerWorkspaceEventListener.cs index 311e1e15e61..86b9f218685 100644 --- a/src/Features/Core/Portable/SolutionCrawler/MiscSolutionCrawlerWorkspaceEventListener.cs +++ b/src/Features/Core/Portable/SolutionCrawler/MiscSolutionCrawlerWorkspaceEventListener.cs @@ -9,6 +9,11 @@ namespace Microsoft.CodeAnalysis.SolutionCrawler [ExportEventListener(WellKnownEventListeners.Workspace, WorkspaceKind.MiscellaneousFiles), Shared] internal class MiscSolutionCrawlerWorkspaceEventListener : IEventListener, IEventListenerStoppable { + [ImportingConstructor] + public MiscSolutionCrawlerWorkspaceEventListener() + { + } + public void StartListening(Workspace workspace, object serviceOpt) { // misc workspace will enable syntax errors and semantic errors for script files for diff --git a/src/Features/Core/Portable/UseSystemHashCode/UseSystemHashCodeCodeFixProvider.cs b/src/Features/Core/Portable/UseSystemHashCode/UseSystemHashCodeCodeFixProvider.cs index bd412dbe584..0af707fdd2a 100644 --- a/src/Features/Core/Portable/UseSystemHashCode/UseSystemHashCodeCodeFixProvider.cs +++ b/src/Features/Core/Portable/UseSystemHashCode/UseSystemHashCodeCodeFixProvider.cs @@ -21,6 +21,11 @@ namespace Microsoft.CodeAnalysis.UseSystemHashCode [ExportCodeFixProvider(LanguageNames.CSharp, LanguageNames.VisualBasic), Shared] internal class UseSystemHashCodeCodeFixProvider : SyntaxEditorBasedCodeFixProvider { + [ImportingConstructor] + public UseSystemHashCodeCodeFixProvider() + { + } + public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(IDEDiagnosticIds.UseSystemHashCode); diff --git a/src/Features/LanguageServer/Protocol/Handler/Completion/CompletionHandler.cs b/src/Features/LanguageServer/Protocol/Handler/Completion/CompletionHandler.cs index 039688ea273..d414848e0e9 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Completion/CompletionHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Completion/CompletionHandler.cs @@ -21,6 +21,11 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler [ExportLspMethod(LSP.Methods.TextDocumentCompletionName)] internal class CompletionHandler : IRequestHandler { + [ImportingConstructor] + public CompletionHandler() + { + } + public async Task HandleRequestAsync(Solution solution, LSP.CompletionParams request, LSP.ClientCapabilities clientCapabilities, CancellationToken cancellationToken) { diff --git a/src/Features/LanguageServer/Protocol/Handler/Completion/CompletionResolveHandler.cs b/src/Features/LanguageServer/Protocol/Handler/Completion/CompletionResolveHandler.cs index 6a268221849..ae96f2f4f15 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Completion/CompletionResolveHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Completion/CompletionResolveHandler.cs @@ -19,6 +19,11 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler [ExportLspMethod(LSP.Methods.TextDocumentCompletionResolveName)] internal class CompletionResolveHandler : IRequestHandler { + [ImportingConstructor] + public CompletionResolveHandler() + { + } + public async Task HandleRequestAsync(Solution solution, LSP.CompletionItem completionItem, LSP.ClientCapabilities clientCapabilities, CancellationToken cancellationToken) { diff --git a/src/Features/LanguageServer/Protocol/Handler/FoldingRanges/FoldingRangesHandler.cs b/src/Features/LanguageServer/Protocol/Handler/FoldingRanges/FoldingRangesHandler.cs index b6500459110..ebb4890f4f7 100644 --- a/src/Features/LanguageServer/Protocol/Handler/FoldingRanges/FoldingRangesHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/FoldingRanges/FoldingRangesHandler.cs @@ -13,6 +13,11 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler [ExportLspMethod(Methods.TextDocumentFoldingRangeName)] internal class FoldingRangesHandler : IRequestHandler { + [ImportingConstructor] + public FoldingRangesHandler() + { + } + public async Task HandleRequestAsync(Solution solution, FoldingRangeParams request, ClientCapabilities clientCapabilities, CancellationToken cancellationToken) { diff --git a/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentHandler.cs b/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentHandler.cs index 692aaeb5a57..5774eedabb2 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentHandler.cs @@ -11,6 +11,11 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler [ExportLspMethod(LSP.Methods.TextDocumentFormattingName)] internal class FormatDocumentHandler : FormatDocumentHandlerBase, IRequestHandler { + [ImportingConstructor] + public FormatDocumentHandler() + { + } + public async Task HandleRequestAsync(Solution solution, LSP.DocumentFormattingParams request, LSP.ClientCapabilities clientCapabilities, CancellationToken cancellationToken) { diff --git a/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentOnTypeHandler.cs b/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentOnTypeHandler.cs index 648db349936..d72736d981d 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentOnTypeHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentOnTypeHandler.cs @@ -17,6 +17,11 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler [ExportLspMethod(Methods.TextDocumentOnTypeFormattingName)] internal class FormatDocumentOnTypeHandler : IRequestHandler { + [ImportingConstructor] + public FormatDocumentOnTypeHandler() + { + } + public async Task HandleRequestAsync(Solution solution, DocumentOnTypeFormattingParams request, ClientCapabilities clientCapabilities, CancellationToken cancellationToken) { diff --git a/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentRangeHandler.cs b/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentRangeHandler.cs index d1560fe4d8e..ff209b0c3ae 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentRangeHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Formatting/FormatDocumentRangeHandler.cs @@ -11,6 +11,11 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler [ExportLspMethod(Methods.TextDocumentRangeFormattingName)] internal class FormatDocumentRangeHandler : FormatDocumentHandlerBase, IRequestHandler { + [ImportingConstructor] + public FormatDocumentRangeHandler() + { + } + public async Task HandleRequestAsync(Solution solution, DocumentRangeFormattingParams request, ClientCapabilities clientCapabilities, CancellationToken cancellationToken) { diff --git a/src/Features/LanguageServer/Protocol/Handler/Highlights/DocumentHighlightHandler.cs b/src/Features/LanguageServer/Protocol/Handler/Highlights/DocumentHighlightHandler.cs index a47ae8bf41c..3c82afa678a 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Highlights/DocumentHighlightHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Highlights/DocumentHighlightHandler.cs @@ -15,6 +15,11 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler [ExportLspMethod(Methods.TextDocumentDocumentHighlightName)] internal class DocumentHighlightsHandler : IRequestHandler { + [ImportingConstructor] + public DocumentHighlightsHandler() + { + } + public async Task HandleRequestAsync(Solution solution, TextDocumentPositionParams request, ClientCapabilities clientCapabilities, CancellationToken cancellationToken) { diff --git a/src/Features/LanguageServer/Protocol/Handler/Hover/HoverHandler.cs b/src/Features/LanguageServer/Protocol/Handler/Hover/HoverHandler.cs index cda877b7c17..f5d8606ed26 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Hover/HoverHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Hover/HoverHandler.cs @@ -14,6 +14,11 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler [ExportLspMethod(Methods.TextDocumentHoverName)] internal class HoverHandler : IRequestHandler { + [ImportingConstructor] + public HoverHandler() + { + } + public async Task HandleRequestAsync(Solution solution, TextDocumentPositionParams request, ClientCapabilities clientCapabilities, CancellationToken cancellationToken) { diff --git a/src/Features/LanguageServer/Protocol/Handler/Initialize/InitializeHandler.cs b/src/Features/LanguageServer/Protocol/Handler/Initialize/InitializeHandler.cs index b298bf23537..2664229c162 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Initialize/InitializeHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Initialize/InitializeHandler.cs @@ -28,6 +28,11 @@ internal class InitializeHandler : IRequestHandler HandleRequestAsync(Solution solution, InitializeParams request, ClientCapabilities clientCapabilities, CancellationToken cancellationToken) => Task.FromResult(s_initializeResult); } diff --git a/src/Features/LanguageServer/Protocol/Handler/References/FindImplementationsHandler.cs b/src/Features/LanguageServer/Protocol/Handler/References/FindImplementationsHandler.cs index 1454a103e18..caae00ac48a 100644 --- a/src/Features/LanguageServer/Protocol/Handler/References/FindImplementationsHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/References/FindImplementationsHandler.cs @@ -14,6 +14,11 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler [ExportLspMethod(LSP.Methods.TextDocumentImplementationName)] internal class FindImplementationsHandler : IRequestHandler { + [ImportingConstructor] + public FindImplementationsHandler() + { + } + public async Task HandleRequestAsync(Solution solution, LSP.TextDocumentPositionParams request, LSP.ClientCapabilities clientCapabilities, CancellationToken cancellationToken) { diff --git a/src/Features/LanguageServer/Protocol/Handler/Symbols/DocumentSymbolsHandler.cs b/src/Features/LanguageServer/Protocol/Handler/Symbols/DocumentSymbolsHandler.cs index 4a49da1ec7f..e1208bd5e36 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Symbols/DocumentSymbolsHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Symbols/DocumentSymbolsHandler.cs @@ -20,6 +20,11 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler [ExportLspMethod(Methods.TextDocumentDocumentSymbolName)] internal class DocumentSymbolsHandler : IRequestHandler { + [ImportingConstructor] + public DocumentSymbolsHandler() + { + } + public async Task HandleRequestAsync(Solution solution, DocumentSymbolParams request, ClientCapabilities clientCapabilities, CancellationToken cancellationToken) { diff --git a/src/Features/LanguageServer/Protocol/Handler/Symbols/WorkspaceSymbolsHandler.cs b/src/Features/LanguageServer/Protocol/Handler/Symbols/WorkspaceSymbolsHandler.cs index 7c9a5840247..94b225973bb 100644 --- a/src/Features/LanguageServer/Protocol/Handler/Symbols/WorkspaceSymbolsHandler.cs +++ b/src/Features/LanguageServer/Protocol/Handler/Symbols/WorkspaceSymbolsHandler.cs @@ -14,6 +14,11 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler [ExportLspMethod(Methods.WorkspaceSymbolName)] internal class WorkspaceSymbolsHandler : IRequestHandler { + [ImportingConstructor] + public WorkspaceSymbolsHandler() + { + } + public async Task HandleRequestAsync(Solution solution, WorkspaceSymbolParams request, ClientCapabilities clientCapabilities, CancellationToken cancellationToken) { diff --git a/src/Features/VisualBasic/Portable/CodeRefactorings/VisualBasicRefactoringHelpersService.vb b/src/Features/VisualBasic/Portable/CodeRefactorings/VisualBasicRefactoringHelpersService.vb index c26a70a8880..a49ad9f8728 100644 --- a/src/Features/VisualBasic/Portable/CodeRefactorings/VisualBasicRefactoringHelpersService.vb +++ b/src/Features/VisualBasic/Portable/CodeRefactorings/VisualBasicRefactoringHelpersService.vb @@ -11,6 +11,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeRefactorings Friend Class VisualBasicRefactoringHelpersService Inherits AbstractRefactoringHelpersService(Of ExpressionSyntax, ArgumentSyntax, ExpressionStatementSyntax) + + Public Sub New() + End Sub + Protected Overrides Iterator Function ExtractNodesSimple(node As SyntaxNode, syntaxFacts As ISyntaxFactsService) As IEnumerable(Of SyntaxNode) For Each baseExtraction In MyBase.ExtractNodesSimple(node, syntaxFacts) Yield baseExtraction diff --git a/src/Features/VisualBasic/Portable/IntroduceVariable/VisualBasicIntroduceLocalForExpressionCodeRefactoringProvider.vb b/src/Features/VisualBasic/Portable/IntroduceVariable/VisualBasicIntroduceLocalForExpressionCodeRefactoringProvider.vb index af48d21aa34..57eb9707d0c 100644 --- a/src/Features/VisualBasic/Portable/IntroduceVariable/VisualBasicIntroduceLocalForExpressionCodeRefactoringProvider.vb +++ b/src/Features/VisualBasic/Portable/IntroduceVariable/VisualBasicIntroduceLocalForExpressionCodeRefactoringProvider.vb @@ -15,6 +15,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.IntroduceVariable ExpressionStatementSyntax, LocalDeclarationStatementSyntax) + + Public Sub New() + End Sub + Protected Overrides Function IsValid(expressionStatement As ExpressionStatementSyntax, span As TextSpan) As Boolean ' Expression is likely too simple to want to offer to generate a local for. ' This leads to too many false cases where this is offered. diff --git a/src/Features/VisualBasic/Portable/MoveDeclarationNearReference/VisualBasicMoveDeclarationNearRefactoringProvider.vb b/src/Features/VisualBasic/Portable/MoveDeclarationNearReference/VisualBasicMoveDeclarationNearRefactoringProvider.vb index 257a32bbc77..c9b5110489a 100644 --- a/src/Features/VisualBasic/Portable/MoveDeclarationNearReference/VisualBasicMoveDeclarationNearRefactoringProvider.vb +++ b/src/Features/VisualBasic/Portable/MoveDeclarationNearReference/VisualBasicMoveDeclarationNearRefactoringProvider.vb @@ -10,5 +10,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.MoveDeclarationNearReference Class VisualBasicMoveDeclarationNearReferenceCodeRefactoringProvider Inherits AbstractMoveDeclarationNearReferenceCodeRefactoringProvider(Of LocalDeclarationStatementSyntax) + + + Public Sub New() + End Sub End Class End Namespace diff --git a/src/Features/VisualBasic/Portable/PopulateSwitch/VisualBasicPopulateSwitchStatementCodeFixProvider.vb b/src/Features/VisualBasic/Portable/PopulateSwitch/VisualBasicPopulateSwitchStatementCodeFixProvider.vb index 31d781b92b7..e3962933a16 100644 --- a/src/Features/VisualBasic/Portable/PopulateSwitch/VisualBasicPopulateSwitchStatementCodeFixProvider.vb +++ b/src/Features/VisualBasic/Portable/PopulateSwitch/VisualBasicPopulateSwitchStatementCodeFixProvider.vb @@ -12,5 +12,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.PopulateSwitch Friend Class VisualBasicPopulateSwitchStatementCodeFixProvider Inherits AbstractPopulateSwitchStatementCodeFixProvider(Of SelectBlockSyntax, CaseBlockSyntax, MemberAccessExpressionSyntax) + + + Public Sub New() + End Sub End Class End Namespace diff --git a/src/Features/VisualBasic/Portable/SignatureHelp/CollectionInitializerSignatureHelpProvider.vb b/src/Features/VisualBasic/Portable/SignatureHelp/CollectionInitializerSignatureHelpProvider.vb index 964b6e1552d..e67d679456c 100644 --- a/src/Features/VisualBasic/Portable/SignatureHelp/CollectionInitializerSignatureHelpProvider.vb +++ b/src/Features/VisualBasic/Portable/SignatureHelp/CollectionInitializerSignatureHelpProvider.vb @@ -13,6 +13,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.SignatureHelp Partial Friend Class CollectionInitializerSignatureHelpProvider Inherits AbstractOrdinaryMethodSignatureHelpProvider + + Public Sub New() + End Sub + Public Overrides Function IsTriggerCharacter(ch As Char) As Boolean Return ch = "{"c OrElse ch = ","c End Function diff --git a/src/Features/VisualBasic/Portable/SimplifyInterpolation/VisualBasicSimplifyInterpolationCodeFixProvider.vb b/src/Features/VisualBasic/Portable/SimplifyInterpolation/VisualBasicSimplifyInterpolationCodeFixProvider.vb index ee857235e88..8adc5932963 100644 --- a/src/Features/VisualBasic/Portable/SimplifyInterpolation/VisualBasicSimplifyInterpolationCodeFixProvider.vb +++ b/src/Features/VisualBasic/Portable/SimplifyInterpolation/VisualBasicSimplifyInterpolationCodeFixProvider.vb @@ -12,6 +12,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.SimplifyInterpolation InterpolationSyntax, ExpressionSyntax, InterpolationAlignmentClauseSyntax, InterpolationFormatClauseSyntax, InterpolatedStringExpressionSyntax) + + Public Sub New() + End Sub + Protected Overrides Function WithExpression(interpolation As InterpolationSyntax, expression As ExpressionSyntax) As InterpolationSyntax Return interpolation.WithExpression(expression) End Function diff --git a/src/Tools/AnalyzerRunner/PersistentStorageLocationService.cs b/src/Tools/AnalyzerRunner/PersistentStorageLocationService.cs index 6e1d7452b14..6750d9fa9ac 100644 --- a/src/Tools/AnalyzerRunner/PersistentStorageLocationService.cs +++ b/src/Tools/AnalyzerRunner/PersistentStorageLocationService.cs @@ -12,6 +12,11 @@ namespace AnalyzerRunner [Shared] internal class PersistentStorageLocationService : IPersistentStorageLocationService { + [ImportingConstructor] + public PersistentStorageLocationService() + { + } + public bool IsSupported(Workspace workspace) => true; public string TryGetStorageLocation(Solution _) diff --git a/src/Tools/ExternalAccess/FSharp/Internal/CommentSelection/FSharpCommentSelectionService.cs b/src/Tools/ExternalAccess/FSharp/Internal/CommentSelection/FSharpCommentSelectionService.cs index a68e6b54aff..831565c30c9 100644 --- a/src/Tools/ExternalAccess/FSharp/Internal/CommentSelection/FSharpCommentSelectionService.cs +++ b/src/Tools/ExternalAccess/FSharp/Internal/CommentSelection/FSharpCommentSelectionService.cs @@ -14,6 +14,11 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Internal.CommentSelection [ExportLanguageService(typeof(ICommentSelectionService), LanguageNames.FSharp)] internal class FSharpCommentSelectionService : ICommentSelectionService { + [ImportingConstructor] + public FSharpCommentSelectionService() + { + } + public Task FormatAsync(Document document, ImmutableArray changes, CancellationToken cancellationToken) { return Task.FromResult(document); diff --git a/src/Tools/ExternalAccess/FSharp/Navigation/FSharpDocumentNavigationService.cs b/src/Tools/ExternalAccess/FSharp/Navigation/FSharpDocumentNavigationService.cs index eaf9c8d1dea..2e45fbd0368 100644 --- a/src/Tools/ExternalAccess/FSharp/Navigation/FSharpDocumentNavigationService.cs +++ b/src/Tools/ExternalAccess/FSharp/Navigation/FSharpDocumentNavigationService.cs @@ -11,6 +11,11 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation [ExportWorkspaceService(typeof(IFSharpDocumentNavigationService)), Shared] internal class FSharpDocumentNavigationService : IFSharpDocumentNavigationService { + [ImportingConstructor] + public FSharpDocumentNavigationService() + { + } + /// /// Determines whether it is possible to navigate to the given position in the specified document. /// diff --git a/src/VisualStudio/CSharp/Impl/ProjectSystemShim/CSharpProjectExistsUIContextProviderLanguageService.cs b/src/VisualStudio/CSharp/Impl/ProjectSystemShim/CSharpProjectExistsUIContextProviderLanguageService.cs index 5e823ffa922..0f133eb7ec5 100644 --- a/src/VisualStudio/CSharp/Impl/ProjectSystemShim/CSharpProjectExistsUIContextProviderLanguageService.cs +++ b/src/VisualStudio/CSharp/Impl/ProjectSystemShim/CSharpProjectExistsUIContextProviderLanguageService.cs @@ -14,6 +14,11 @@ namespace Microsoft.VisualStudio.LanguageServices.CSharp.ProjectSystemShim [ExportLanguageService(typeof(IProjectExistsUIContextProviderLanguageService), LanguageNames.CSharp), Shared] internal sealed class CSharpProjectExistsUIContextProviderLanguageService : IProjectExistsUIContextProviderLanguageService { + [ImportingConstructor] + public CSharpProjectExistsUIContextProviderLanguageService() + { + } + public UIContext GetUIContext() { return UIContext.FromUIContextGuid(Guids.CSharpProjectExistsInWorkspaceUIContext); diff --git a/src/VisualStudio/Core/Def/Experimentation/ExperimentationOptions.cs b/src/VisualStudio/Core/Def/Experimentation/ExperimentationOptions.cs index fe3a1738d16..40477012a6a 100644 --- a/src/VisualStudio/Core/Def/Experimentation/ExperimentationOptions.cs +++ b/src/VisualStudio/Core/Def/Experimentation/ExperimentationOptions.cs @@ -15,6 +15,11 @@ internal static class ExperimentationOptions [ExportOptionProvider, Shared] internal class ExperimentationOptionsProvider : IOptionProvider { + [ImportingConstructor] + public ExperimentationOptionsProvider() + { + } + public ImmutableArray Options { get; } = ImmutableArray.Empty; } } diff --git a/src/VisualStudio/Core/Def/Implementation/FindReferences/ContainingMemberColumnDefinition.cs b/src/VisualStudio/Core/Def/Implementation/FindReferences/ContainingMemberColumnDefinition.cs index 53961d30c79..87e62c298ab 100644 --- a/src/VisualStudio/Core/Def/Implementation/FindReferences/ContainingMemberColumnDefinition.cs +++ b/src/VisualStudio/Core/Def/Implementation/FindReferences/ContainingMemberColumnDefinition.cs @@ -16,6 +16,12 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.FindReferences internal class ContainingMemberColumnDefinition : TableColumnDefinitionBase { public const string ColumnName = AbstractReferenceFinder.ContainingMemberInfoPropertyName; + + [ImportingConstructor] + public ContainingMemberColumnDefinition() + { + } + public override bool IsFilterable => true; public override string Name => ColumnName; public override string DisplayName => ServicesVSResources.Containing_member; diff --git a/src/VisualStudio/Core/Def/Implementation/FindReferences/ContainingTypeColumnDefinition.cs b/src/VisualStudio/Core/Def/Implementation/FindReferences/ContainingTypeColumnDefinition.cs index ef785706d87..cc670e5067f 100644 --- a/src/VisualStudio/Core/Def/Implementation/FindReferences/ContainingTypeColumnDefinition.cs +++ b/src/VisualStudio/Core/Def/Implementation/FindReferences/ContainingTypeColumnDefinition.cs @@ -16,6 +16,12 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.FindReferences internal class ContainingTypeColumnDefinition : TableColumnDefinitionBase { public const string ColumnName = AbstractReferenceFinder.ContainingTypeInfoPropertyName; + + [ImportingConstructor] + public ContainingTypeColumnDefinition() + { + } + public override bool IsFilterable => true; public override string Name => ColumnName; public override string DisplayName => ServicesVSResources.Containing_type; diff --git a/src/VisualStudio/Core/Def/Implementation/Remote/RemoteHostClientServiceFactory.WorkspaceEventListener.cs b/src/VisualStudio/Core/Def/Implementation/Remote/RemoteHostClientServiceFactory.WorkspaceEventListener.cs index 1fd11e8dd52..87b94f6cbe2 100644 --- a/src/VisualStudio/Core/Def/Implementation/Remote/RemoteHostClientServiceFactory.WorkspaceEventListener.cs +++ b/src/VisualStudio/Core/Def/Implementation/Remote/RemoteHostClientServiceFactory.WorkspaceEventListener.cs @@ -13,6 +13,11 @@ internal partial class RemoteHostClientServiceFactory : IWorkspaceServiceFactory [ExportEventListener(WellKnownEventListeners.Workspace, WorkspaceKind.Host), Shared] private sealed class RemoteHostWorkspaceEventListener : IEventListener { + [ImportingConstructor] + public RemoteHostWorkspaceEventListener() + { + } + public void StartListening(Workspace workspace, object serviceOpt) { var service = (RemoteHostClientService)workspace.Services.GetService(); diff --git a/src/VisualStudio/Core/Def/Storage/VisualStudioPersistentStorageLocationService.cs b/src/VisualStudio/Core/Def/Storage/VisualStudioPersistentStorageLocationService.cs index c0c29f80c91..f01be48b134 100644 --- a/src/VisualStudio/Core/Def/Storage/VisualStudioPersistentStorageLocationService.cs +++ b/src/VisualStudio/Core/Def/Storage/VisualStudioPersistentStorageLocationService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.Storage [ExportWorkspaceService(typeof(IPersistentStorageLocationService), ServiceLayer.Host), Shared] internal class VisualStudioPersistentStorageLocationService : DefaultPersistentStorageLocationService { + [ImportingConstructor] + public VisualStudioPersistentStorageLocationService() + { + } + public override bool IsSupported(Workspace workspace) => workspace is VisualStudioWorkspace; } diff --git a/src/VisualStudio/LiveShare/Impl/ClassificationsHandler.cs b/src/VisualStudio/LiveShare/Impl/ClassificationsHandler.cs index d524eba6d25..ad7152e3477 100644 --- a/src/VisualStudio/LiveShare/Impl/ClassificationsHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/ClassificationsHandler.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel.Composition; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; @@ -30,20 +31,36 @@ protected override async Task AddClassificationsAsync(IClassificationService cla [Obsolete("Used for backwards compatibility with old liveshare clients.")] internal class RoslynClassificationsHandler : ClassificationsHandler { + [ImportingConstructor] + public RoslynClassificationsHandler() + { + } } [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, RoslynMethods.ClassificationsName)] internal class CSharpClassificationsHandler : ClassificationsHandler { + [ImportingConstructor] + public CSharpClassificationsHandler() + { + } } [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, RoslynMethods.ClassificationsName)] internal class VisualBasicClassificationsHandler : ClassificationsHandler { + [ImportingConstructor] + public VisualBasicClassificationsHandler() + { + } } [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, RoslynMethods.ClassificationsName)] internal class TypeScriptClassificationsHandler : ClassificationsHandler { + [ImportingConstructor] + public TypeScriptClassificationsHandler() + { + } } } diff --git a/src/VisualStudio/LiveShare/Impl/Client/Classification/RoslynClassificationService.Exports.cs b/src/VisualStudio/LiveShare/Impl/Client/Classification/RoslynClassificationService.Exports.cs index e98187a3316..5227432ab0c 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/Classification/RoslynClassificationService.Exports.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/Classification/RoslynClassificationService.Exports.cs @@ -10,12 +10,22 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.Classificatio [ExportLanguageServiceFactory(typeof(IClassificationService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspClassificationServiceFactory : RoslynClassificationServiceFactory { + [ImportingConstructor] + public CSharpLspClassificationServiceFactory() + { + } + protected override string LiveShareContentType => StringConstants.CSharpLspLanguageName; } [ExportLanguageServiceFactory(typeof(IClassificationService), StringConstants.VBLspLanguageName), Shared] internal class VBLspClassificationServiceFactory : RoslynClassificationServiceFactory { + [ImportingConstructor] + public VBLspClassificationServiceFactory() + { + } + protected override string LiveShareContentType => StringConstants.VBLspLanguageName; } diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteBlockStructureService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteBlockStructureService.cs index 687b76871c8..5dd1c24476d 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteBlockStructureService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteBlockStructureService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(BlockStructureService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspBlockStructureServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspBlockStructureServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteBraceCompletionService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteBraceCompletionService.cs index 1e5a83507ed..abb3ef3d882 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteBraceCompletionService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteBraceCompletionService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IEditorBraceCompletionSessionFactory), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspBraceCompletionServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspBraceCompletionServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteCompilationFactoryService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteCompilationFactoryService.cs index 32a5585b0a6..32377096335 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteCompilationFactoryService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteCompilationFactoryService.cs @@ -9,6 +9,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ICompilationFactoryService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpRemoteCompilationFactoryService : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpRemoteCompilationFactoryService() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteDocumentDifferenceService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteDocumentDifferenceService.cs index 7e3f5f5dca9..7d6adfc2592 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteDocumentDifferenceService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteDocumentDifferenceService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IDocumentDifferenceService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspDocumentDifferenceServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspDocumentDifferenceServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteLineSeparatorService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteLineSeparatorService.cs index 3a3f0e81b4a..7779d8cea4a 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteLineSeparatorService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteLineSeparatorService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ILineSeparatorService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspLineSeparatorServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspLineSeparatorServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteRenameTrackingLanguageHeuristicsService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteRenameTrackingLanguageHeuristicsService.cs index 4128abaa9b2..157840e79cf 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteRenameTrackingLanguageHeuristicsService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteRenameTrackingLanguageHeuristicsService.cs @@ -9,6 +9,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageService(typeof(IRenameTrackingLanguageHeuristicsService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspRenameTrackingLanguageHeuristicsService : IRenameTrackingLanguageHeuristicsService { + [ImportingConstructor] + public CSharpLspRenameTrackingLanguageHeuristicsService() + { + } + public bool IsIdentifierValidForRenameTracking(string name) { return false; diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteSyntaxFactsService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteSyntaxFactsService.cs index 9ea41a9488a..373b992280c 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteSyntaxFactsService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteSyntaxFactsService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ISyntaxFactsService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspSyntaxFactsServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspSyntaxFactsServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteSyntaxTreeFactoryService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteSyntaxTreeFactoryService.cs index 61903b44525..a0c06083cd7 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteSyntaxTreeFactoryService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/CSharpRemoteSyntaxTreeFactoryService.cs @@ -9,6 +9,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ISyntaxTreeFactoryService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspSyntaxTreeFactoryServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspSyntaxTreeFactoryServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/CSharpRemoteCommentSelectionService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/CSharpRemoteCommentSelectionService.cs index 0c25cc57055..ef76c1b00f5 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/CSharpRemoteCommentSelectionService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/CSharpRemoteCommentSelectionService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ICommentSelectionService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspCommentSelectionServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspCommentSelectionServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/CSharpRemoteDocumentationCommentFormattingService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/CSharpRemoteDocumentationCommentFormattingService.cs index 0fd1de7397c..3d9dfb33c8e 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/CSharpRemoteDocumentationCommentFormattingService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/CSharpRemoteDocumentationCommentFormattingService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IDocumentationCommentFormattingService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspDocumentationCommentFormattingServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspDocumentationCommentFormattingServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/VBRemoteCommentSelectionService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/VBRemoteCommentSelectionService.cs index 14260db3ebf..69dcbcd6f18 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/VBRemoteCommentSelectionService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/VBRemoteCommentSelectionService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ICommentSelectionService), StringConstants.VBLspLanguageName), Shared] internal class VBLspCommentSelectionServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspCommentSelectionServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/VBRemoteDocumentationCommentFormattingService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/VBRemoteDocumentationCommentFormattingService.cs index 1ba8ff46904..a5d4c5e7661 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/VBRemoteDocumentationCommentFormattingService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Comments/VBRemoteDocumentationCommentFormattingService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IDocumentationCommentFormattingService), StringConstants.VBLspLanguageName), Shared] internal class VBLspDocumentationCommentFormattingServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspDocumentationCommentFormattingServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/CSharpRemoteBreakpointService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/CSharpRemoteBreakpointService.cs index ba364416dc9..c9562ecd726 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/CSharpRemoteBreakpointService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/CSharpRemoteBreakpointService.cs @@ -16,6 +16,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IBreakpointResolutionService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspBreakpointServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspBreakpointServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return new CSharpRemoteBreakpointService(languageServices); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/CSharpRemoteDebugInfoService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/CSharpRemoteDebugInfoService.cs index 5b527c77fee..e11bb2fc9f8 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/CSharpRemoteDebugInfoService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/CSharpRemoteDebugInfoService.cs @@ -16,6 +16,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ILanguageDebugInfoService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspDebugInfoServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspDebugInfoServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return new CSharpRemoteDebugInfoService(languageServices); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/VBRemoteBreakpointService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/VBRemoteBreakpointService.cs index 7582bf764bd..328ee2e601b 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/VBRemoteBreakpointService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/VBRemoteBreakpointService.cs @@ -18,6 +18,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IBreakpointResolutionService), StringConstants.VBLspLanguageName), Shared] internal class VBLspBreakpointServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspBreakpointServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return new VBRemoteBreakpointService(languageServices); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/VBRemoteDebugInfoService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/VBRemoteDebugInfoService.cs index 2936bfac314..f035121ba66 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/VBRemoteDebugInfoService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Debugging/VBRemoteDebugInfoService.cs @@ -16,6 +16,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ILanguageDebugInfoService), StringConstants.VBLspLanguageName), Shared] internal class VBLspDebugInfoServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspDebugInfoServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return new VBRemoteDebugInfoService(languageServices); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteEditorFormattingService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteEditorFormattingService.cs index 7a566e80930..44582a745b9 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteEditorFormattingService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteEditorFormattingService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IEditorFormattingService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspEditorFormattingServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspEditorFormattingServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteFormattingService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteFormattingService.cs index 370a11a5762..36a68ff45de 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteFormattingService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteFormattingService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IFormattingService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspFormattingServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspFormattingServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteIndentationService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteIndentationService.cs index 6ca8bfa622f..8d8e5add245 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteIndentationService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteIndentationService.cs @@ -10,6 +10,10 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IIndentationService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspIndentationServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspIndentationServiceFactory() + { + } public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteSyntaxFormattingService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteSyntaxFormattingService.cs index 85319297c69..0b4b2d974df 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteSyntaxFormattingService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/CSharpRemoteSyntaxFormattingService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ISyntaxFormattingService), StringConstants.CSharpLspLanguageName), Shared] internal class CSharpLspSyntaxFormattingServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpLspSyntaxFormattingServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteEditorFormattingService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteEditorFormattingService.cs index f0fa9015a55..fbf9a94f7d4 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteEditorFormattingService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteEditorFormattingService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IEditorFormattingService), StringConstants.VBLspLanguageName), Shared] internal class VBLspEditorFormattingServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspEditorFormattingServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteFormattingService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteFormattingService.cs index b2a5a18fe03..b88e12f2cf8 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteFormattingService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteFormattingService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IFormattingService), StringConstants.VBLspLanguageName), Shared] internal class VBLspFormattingServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspFormattingServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteIndentationService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteIndentationService.cs index 9c4d765c02e..1f97a41c04c 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteIndentationService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteIndentationService.cs @@ -12,6 +12,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [Obsolete] internal class VBLspIndentationServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspIndentationServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteSyntaxFormattingService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteSyntaxFormattingService.cs index 76d9bb4f680..c882e7d55ce 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteSyntaxFormattingService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/Formatting/VBRemoteSyntaxFormattingService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ISyntaxFormattingService), StringConstants.VBLspLanguageName), Shared] internal class VBLspSyntaxFormattingServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspSyntaxFormattingServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteBlockStructureService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteBlockStructureService.cs index ff74fcbc653..4e43d1f61e2 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteBlockStructureService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteBlockStructureService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(BlockStructureService), StringConstants.VBLspLanguageName), Shared] internal class VBLspBlockStructureServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspBlockStructureServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteBraceCompletionService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteBraceCompletionService.cs index 2959ce62cfa..0ad4d66ecf2 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteBraceCompletionService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteBraceCompletionService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IEditorBraceCompletionSessionFactory), StringConstants.VBLspLanguageName), Shared] internal class VBLspBraceCompletionServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspBraceCompletionServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteCompilationFactoryService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteCompilationFactoryService.cs index f429f022be2..2fbdea904bc 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteCompilationFactoryService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteCompilationFactoryService.cs @@ -9,6 +9,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ICompilationFactoryService), StringConstants.VBLspLanguageName), Shared] internal class VBRemoteCompilationFactoryService : ILanguageServiceFactory { + [ImportingConstructor] + public VBRemoteCompilationFactoryService() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteDocumentDifferenceService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteDocumentDifferenceService.cs index aa0bcfa7364..d76f4c2024c 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteDocumentDifferenceService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteDocumentDifferenceService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(IDocumentDifferenceService), StringConstants.VBLspLanguageName), Shared] internal class VBLspDocumentDifferenceServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspDocumentDifferenceServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteLineSeparatorService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteLineSeparatorService.cs index f20d10184db..d02b4222021 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteLineSeparatorService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteLineSeparatorService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ILineSeparatorService), StringConstants.VBLspLanguageName), Shared] internal class VBLspLineSeparatorServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspLineSeparatorServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteRenameTrackingLanguageHeuristicsService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteRenameTrackingLanguageHeuristicsService.cs index e608bab0932..0fabbd22d7e 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteRenameTrackingLanguageHeuristicsService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteRenameTrackingLanguageHeuristicsService.cs @@ -9,6 +9,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageService(typeof(IRenameTrackingLanguageHeuristicsService), StringConstants.VBLspLanguageName), Shared] internal class VBLspRenameTrackingLanguageHeuristicsService : IRenameTrackingLanguageHeuristicsService { + [ImportingConstructor] + public VBLspRenameTrackingLanguageHeuristicsService() + { + } + public bool IsIdentifierValidForRenameTracking(string name) { return false; diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteSyntaxFactsService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteSyntaxFactsService.cs index cb8e6b4b11f..6de4fa566bc 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteSyntaxFactsService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteSyntaxFactsService.cs @@ -10,6 +10,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ISyntaxFactsService), StringConstants.VBLspLanguageName), Shared] internal class VBLspSyntaxFactsServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspSyntaxFactsServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteSyntaxTreeFactoryService.cs b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteSyntaxTreeFactoryService.cs index 1b4fbee3dc0..96a67f22856 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteSyntaxTreeFactoryService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/LocalForwarders/VBRemoteSyntaxTreeFactoryService.cs @@ -9,6 +9,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client.LocalForwarde [ExportLanguageServiceFactory(typeof(ISyntaxTreeFactoryService), StringConstants.VBLspLanguageName), Shared] internal class VBLspSyntaxTreeFactoryServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public VBLspSyntaxTreeFactoryServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) { return languageServices.GetOriginalLanguageService(); diff --git a/src/VisualStudio/LiveShare/Impl/Client/RoslynLSPClientService.cs b/src/VisualStudio/LiveShare/Impl/Client/RoslynLSPClientService.cs index 4215203e319..53434a2c7f6 100644 --- a/src/VisualStudio/LiveShare/Impl/Client/RoslynLSPClientService.cs +++ b/src/VisualStudio/LiveShare/Impl/Client/RoslynLSPClientService.cs @@ -152,6 +152,11 @@ public void InitializeServerCapabilities(CancellationToken cancellationToken) CreationPriority = (int)ServiceRole.LocalService + 2000)] internal class CSharpLspClientServiceFactory : AbstractLspClientServiceFactory { + [ImportingConstructor] + public CSharpLspClientServiceFactory() + { + } + protected override string LanguageSpecificProviderName => StringConstants.CSharpProviderName; protected override RoslynLSPClientLifeTimeService LspClientLifeTimeService => new CSharpLSPClientLifeTimeService(); @@ -169,6 +174,11 @@ private class CSharpLSPClientLifeTimeService : RoslynLSPClientLifeTimeService CreationPriority = (int)ServiceRole.LocalService + 2000)] internal class VisualBasicLspClientServiceFactory : AbstractLspClientServiceFactory { + [ImportingConstructor] + public VisualBasicLspClientServiceFactory() + { + } + protected override string LanguageSpecificProviderName => StringConstants.VisualBasicProviderName; protected override RoslynLSPClientLifeTimeService LspClientLifeTimeService => new VisualBasicLSPClientLifeTimeService(); @@ -186,6 +196,11 @@ private class VisualBasicLSPClientLifeTimeService : RoslynLSPClientLifeTimeServi CreationPriority = (int)ServiceRole.LocalService + 2000)] internal class TypeScriptLspClientServiceFactory : AbstractLspClientServiceFactory { + [ImportingConstructor] + public TypeScriptLspClientServiceFactory() + { + } + protected override string LanguageSpecificProviderName => StringConstants.TypeScriptProviderName; protected override RoslynLSPClientLifeTimeService LspClientLifeTimeService => new TypeScriptLSPClientLifeTimeService(); diff --git a/src/VisualStudio/LiveShare/Impl/LSPSDKInitializeHandler.cs b/src/VisualStudio/LiveShare/Impl/LSPSDKInitializeHandler.cs index 3cd554f621b..9f4ae4d2b3a 100644 --- a/src/VisualStudio/LiveShare/Impl/LSPSDKInitializeHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/LSPSDKInitializeHandler.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.ComponentModel.Composition; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; @@ -15,6 +16,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare [ExportLspRequestHandler(LiveShareConstants.RoslynLSPSDKContractName, LSP.Methods.InitializeName)] internal class LSPSDKInitializeHandler : ILspRequestHandler { + [ImportingConstructor] + public LSPSDKInitializeHandler() + { + } + public Task HandleAsync(LSP.InitializeParams request, RequestContext requestContext, CancellationToken cancellationToken) { var result = new LSP.InitializeResult diff --git a/src/VisualStudio/LiveShare/Impl/LexicalClassificationsHandler.cs b/src/VisualStudio/LiveShare/Impl/LexicalClassificationsHandler.cs index 26f341e01d4..da78d5e4824 100644 --- a/src/VisualStudio/LiveShare/Impl/LexicalClassificationsHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/LexicalClassificationsHandler.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel.Composition; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -28,10 +29,18 @@ protected override async Task AddClassificationsAsync(IClassificationService cla [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, LexicalClassificationsMethodName)] internal class CSharpLexicalClassificationsHandler : LexicalClassificationsHandler { + [ImportingConstructor] + public CSharpLexicalClassificationsHandler() + { + } } [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, LexicalClassificationsMethodName)] internal class VisualBasicLexicalClassificationsHandler : LexicalClassificationsHandler { + [ImportingConstructor] + public VisualBasicLexicalClassificationsHandler() + { + } } } diff --git a/src/VisualStudio/LiveShare/Impl/LoadHandler.cs b/src/VisualStudio/LiveShare/Impl/LoadHandler.cs index 6f22a738285..2e28c0b2c22 100644 --- a/src/VisualStudio/LiveShare/Impl/LoadHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/LoadHandler.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.ComponentModel.Composition; using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.LiveShare.LanguageServices; @@ -20,20 +21,36 @@ public Task HandleAsync(object request, RequestContext requestContext, C [Obsolete("Used for backwards compatibility with old liveshare clients.")] internal class RoslynLoadHandler : LoadHandler { + [ImportingConstructor] + public RoslynLoadHandler() + { + } } [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, CustomMethods.LoadName)] internal class CSharpLoadHandler : LoadHandler { + [ImportingConstructor] + public CSharpLoadHandler() + { + } } [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, CustomMethods.LoadName)] internal class VisualBasicLoadHandler : LoadHandler { + [ImportingConstructor] + public VisualBasicLoadHandler() + { + } } [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, CustomMethods.LoadName)] internal class TypeScriptLoadHandler : LoadHandler { + [ImportingConstructor] + public TypeScriptLoadHandler() + { + } } } diff --git a/src/VisualStudio/LiveShare/Impl/ProjectsHandler.Exports.cs b/src/VisualStudio/LiveShare/Impl/ProjectsHandler.Exports.cs index f143ab7e86d..954eaec9f83 100644 --- a/src/VisualStudio/LiveShare/Impl/ProjectsHandler.Exports.cs +++ b/src/VisualStudio/LiveShare/Impl/ProjectsHandler.Exports.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.ComponentModel.Composition; using Microsoft.VisualStudio.LanguageServices.LiveShare.CustomProtocol; using Microsoft.VisualStudio.LiveShare.LanguageServices; @@ -10,20 +11,36 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare [Obsolete("Used for backwards compatibility with old liveshare clients.")] internal class RoslynProjectsHandler : ProjectsHandler { + [ImportingConstructor] + public RoslynProjectsHandler() + { + } } [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, RoslynMethods.ProjectsName)] internal class CSharpProjectsHandler : ProjectsHandler { + [ImportingConstructor] + public CSharpProjectsHandler() + { + } } [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, RoslynMethods.ProjectsName)] internal class VisualBasicProjectsHandler : ProjectsHandler { + [ImportingConstructor] + public VisualBasicProjectsHandler() + { + } } [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, RoslynMethods.ProjectsName)] internal class TypeScriptProjectsHandler : ProjectsHandler { + [ImportingConstructor] + public TypeScriptProjectsHandler() + { + } } } diff --git a/src/VisualStudio/LiveShare/Impl/SyntaxClassificationsHandler.cs b/src/VisualStudio/LiveShare/Impl/SyntaxClassificationsHandler.cs index 53774cef018..65792efe758 100644 --- a/src/VisualStudio/LiveShare/Impl/SyntaxClassificationsHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/SyntaxClassificationsHandler.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel.Composition; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -27,10 +28,18 @@ protected override async Task AddClassificationsAsync(IClassificationService cla [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, SyntaxClassificationsMethodName)] internal class CSharpSyntaxClassificationsHandler : SyntaxClassificationsHandler { + [ImportingConstructor] + public CSharpSyntaxClassificationsHandler() + { + } } [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, SyntaxClassificationsMethodName)] internal class VisualBasicSyntaxClassificationsHandler : SyntaxClassificationsHandler { + [ImportingConstructor] + public VisualBasicSyntaxClassificationsHandler() + { + } } } diff --git a/src/VisualStudio/LiveShare/Test/MockDocumentNavigationServiceFactory.cs b/src/VisualStudio/LiveShare/Test/MockDocumentNavigationServiceFactory.cs index e4aae612024..d6ff0ac5f5c 100644 --- a/src/VisualStudio/LiveShare/Test/MockDocumentNavigationServiceFactory.cs +++ b/src/VisualStudio/LiveShare/Test/MockDocumentNavigationServiceFactory.cs @@ -15,6 +15,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.UnitTests [PartNotDiscoverable] internal class MockDocumentNavigationServiceFactory : IWorkspaceServiceFactory { + [ImportingConstructor] + public MockDocumentNavigationServiceFactory() + { + } + public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices) { return new MockDocumentNavigationService(); diff --git a/src/VisualStudio/TestUtilities2/VisualStudioTestExportProvider.vb b/src/VisualStudio/TestUtilities2/VisualStudioTestExportProvider.vb index 9f179b40304..efc83520a76 100644 --- a/src/VisualStudio/TestUtilities2/VisualStudioTestExportProvider.vb +++ b/src/VisualStudio/TestUtilities2/VisualStudioTestExportProvider.vb @@ -1,5 +1,6 @@ ' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +Imports System.Composition Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.VisualStudio.Composition Imports Microsoft.VisualStudio.LanguageServices.CSharp.CodeModel @@ -26,6 +27,11 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests Friend Class MockWorkspaceEventListenerProvider Implements IWorkspaceServiceFactory + + + Public Sub New() + End Sub + Public Function CreateService(workspaceServices As HostWorkspaceServices) As IWorkspaceService Implements IWorkspaceServiceFactory.CreateService Return Nothing End Function diff --git a/src/VisualStudio/VisualBasic/Impl/ProjectSystemShim/VisualBasicProjectExistsUIContextProviderLanguageService.vb b/src/VisualStudio/VisualBasic/Impl/ProjectSystemShim/VisualBasicProjectExistsUIContextProviderLanguageService.vb index 8a9245bd0d4..1103ca758e2 100644 --- a/src/VisualStudio/VisualBasic/Impl/ProjectSystemShim/VisualBasicProjectExistsUIContextProviderLanguageService.vb +++ b/src/VisualStudio/VisualBasic/Impl/ProjectSystemShim/VisualBasicProjectExistsUIContextProviderLanguageService.vb @@ -11,6 +11,10 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.ProjectSystemShim Public Class VisualBasicProjectExistsUIContextProviderLanguageService Implements IProjectExistsUIContextProviderLanguageService + + Public Sub New() + End Sub + Public Function GetUIContext() As UIContext Implements IProjectExistsUIContextProviderLanguageService.GetUIContext Return UIContext.FromUIContextGuid(Guids.VisualBasicProjectExistsInWorkspaceUIContext) End Function diff --git a/src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxKindsServiceFactory.cs b/src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxKindsServiceFactory.cs index b29569af562..4f2e768a565 100644 --- a/src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxKindsServiceFactory.cs +++ b/src/Workspaces/CSharp/Portable/LanguageServices/CSharpSyntaxKindsServiceFactory.cs @@ -11,6 +11,11 @@ namespace Microsoft.CodeAnalysis.CSharp [ExportLanguageServiceFactory(typeof(ISyntaxKindsService), LanguageNames.CSharp), Shared] internal class CSharpSyntaxKindsServiceFactory : ILanguageServiceFactory { + [ImportingConstructor] + public CSharpSyntaxKindsServiceFactory() + { + } + public ILanguageService CreateLanguageService(HostLanguageServices languageServices) => CSharpSyntaxKindsService.Instance; } diff --git a/src/Workspaces/Core/Portable/ExternalAccess/Pythia/Api/PythiaOptions.cs b/src/Workspaces/Core/Portable/ExternalAccess/Pythia/Api/PythiaOptions.cs index c9a8a382743..722e4a9c779 100644 --- a/src/Workspaces/Core/Portable/ExternalAccess/Pythia/Api/PythiaOptions.cs +++ b/src/Workspaces/Core/Portable/ExternalAccess/Pythia/Api/PythiaOptions.cs @@ -23,6 +23,11 @@ internal static class PythiaOptions [ExportOptionProvider, Shared] internal class PythiaOptionsProvider : IOptionProvider { + [ImportingConstructor] + public PythiaOptionsProvider() + { + } + public ImmutableArray Options { get; } = ImmutableArray.Create( PythiaOptions.ShowDebugInfo, diff --git a/src/Workspaces/Remote/Core/Services/RemoteExperimentationService.cs b/src/Workspaces/Remote/Core/Services/RemoteExperimentationService.cs index bcf869c2dca..622c46a137c 100644 --- a/src/Workspaces/Remote/Core/Services/RemoteExperimentationService.cs +++ b/src/Workspaces/Remote/Core/Services/RemoteExperimentationService.cs @@ -10,6 +10,11 @@ namespace Microsoft.CodeAnalysis.Remote.Services [ExportWorkspaceService(typeof(IExperimentationService), ServiceLayer.Host), Shared] internal sealed class RemoteExperimentationService : IExperimentationService { + [ImportingConstructor] + public RemoteExperimentationService() + { + } + public bool IsExperimentEnabled(string experimentName) { var assetSource = AssetStorage.Default.AssetSource; diff --git a/src/Workspaces/Remote/Core/Storage/RemotePersistentStorageLocationService.cs b/src/Workspaces/Remote/Core/Storage/RemotePersistentStorageLocationService.cs index 955216857db..5cdb23653b8 100644 --- a/src/Workspaces/Remote/Core/Storage/RemotePersistentStorageLocationService.cs +++ b/src/Workspaces/Remote/Core/Storage/RemotePersistentStorageLocationService.cs @@ -10,12 +10,22 @@ namespace Microsoft.CodeAnalysis.Remote.Storage [ExportWorkspaceService(typeof(IPersistentStorageLocationService), layer: WorkspaceKind.RemoteWorkspace), Shared] internal class RemoteWorkspacePersistentStorageLocationService : DefaultPersistentStorageLocationService { + [ImportingConstructor] + public RemoteWorkspacePersistentStorageLocationService() + { + } + public override bool IsSupported(Workspace workspace) => true; } [ExportWorkspaceService(typeof(IPersistentStorageLocationService), layer: WorkspaceKind.RemoteTemporaryWorkspace), Shared] internal class RemoteTemporaryWorkspacePersistentStorageLocationService : DefaultPersistentStorageLocationService { + [ImportingConstructor] + public RemoteTemporaryWorkspacePersistentStorageLocationService() + { + } + public override bool IsSupported(Workspace workspace) => true; } } diff --git a/src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxKindsServiceFactory.vb b/src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxKindsServiceFactory.vb index dfafd5e7e83..9fb3d98649e 100644 --- a/src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxKindsServiceFactory.vb +++ b/src/Workspaces/VisualBasic/Portable/LanguageServices/VisualBasicSyntaxKindsServiceFactory.vb @@ -11,6 +11,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Friend Class VisualBasicSyntaxKindsServiceFactory Implements ILanguageServiceFactory + + Public Sub New() + End Sub + Public Function CreateLanguageService(languageServices As HostLanguageServices) As ILanguageService Implements ILanguageServiceFactory.CreateLanguageService Return VisualBasicSyntaxKindsService.Instance End Function -- GitLab