未验证 提交 f5af4fb3 编写于 作者: S Sam Harwell 提交者: GitHub

Merge pull request #35842 from sharwell/add-attribute

Add ImportingConstructor attribute to fix RS0034 (Exported parts should have ImportingConstructor)
// 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 Microsoft.CodeAnalysis.CSharp;
namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
......@@ -7,6 +8,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
[ExportBraceMatcher(LanguageNames.CSharp)]
internal class LessThanGreaterThanBraceMatcher : AbstractCSharpBraceMatcher
{
[ImportingConstructor]
public LessThanGreaterThanBraceMatcher()
: base(SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken)
{
......
// 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 Microsoft.CodeAnalysis.CSharp;
namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
......@@ -7,6 +8,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
[ExportBraceMatcher(LanguageNames.CSharp)]
internal class OpenCloseBraceBraceMatcher : AbstractCSharpBraceMatcher
{
[ImportingConstructor]
public OpenCloseBraceBraceMatcher()
: base(SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken)
{
......
// 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 Microsoft.CodeAnalysis.CSharp;
namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
......@@ -7,6 +8,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
[ExportBraceMatcher(LanguageNames.CSharp)]
internal class OpenCloseBracketBraceMatcher : AbstractCSharpBraceMatcher
{
[ImportingConstructor]
public OpenCloseBracketBraceMatcher()
: base(SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken)
{
......
// 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 Microsoft.CodeAnalysis.CSharp;
namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
......@@ -7,6 +8,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
[ExportBraceMatcher(LanguageNames.CSharp)]
internal class OpenCloseParenBraceMatcher : AbstractCSharpBraceMatcher
{
[ImportingConstructor]
public OpenCloseParenBraceMatcher()
: base(SyntaxKind.OpenParenToken, SyntaxKind.CloseParenToken)
{
......
......@@ -14,6 +14,7 @@ internal class CSharpEmbeddedLanguageEditorFeaturesProvider : AbstractEmbeddedLa
{
public static IEmbeddedLanguageFeaturesProvider Instance = new CSharpEmbeddedLanguageEditorFeaturesProvider();
[ImportingConstructor]
public CSharpEmbeddedLanguageEditorFeaturesProvider() : base(CSharpEmbeddedLanguagesProvider.Info)
{
}
......
......@@ -32,6 +32,7 @@ internal partial class CSharpEditorFormattingService : IEditorFormattingService
// All the characters that might potentially trigger formatting when typed
private readonly char[] _supportedChars = ";{}#nte:)".ToCharArray();
[ImportingConstructor]
public CSharpEditorFormattingService()
{
}
......
......@@ -18,6 +18,7 @@ internal class CSharpWrappingCodeRefactoringProvider : AbstractWrappingCodeRefac
new CSharpParameterWrapper(),
new CSharpBinaryExpressionWrapper());
[ImportingConstructor]
public CSharpWrappingCodeRefactoringProvider()
: base(s_wrappers)
{
......
......@@ -16,6 +16,7 @@ internal sealed class ClassificationTypeFormatDefinitions
[UserVisible(true)]
private class BraceMatchingFormatDefinition : ClassificationFormatDefinition
{
[ImportingConstructor]
private BraceMatchingFormatDefinition()
{
this.DisplayName = EditorFeaturesResources.Brace_Matching;
......
......@@ -14,6 +14,7 @@ namespace Microsoft.CodeAnalysis.Editor.Shared.Tagging.Tags
[ExcludeFromCodeCoverage]
internal class ConflictTagDefinition : MarkerFormatDefinition
{
[ImportingConstructor]
public ConflictTagDefinition()
{
this.Border = new Pen(Brushes.Red, thickness: 1.5);
......
......@@ -19,6 +19,7 @@ namespace Microsoft.CodeAnalysis.Editor.Diagnostics
[UserVisible(false)]
internal sealed class UnnecessaryCodeFormatDefinition : ClassificationFormatDefinition
{
[ImportingConstructor]
private UnnecessaryCodeFormatDefinition()
{
this.DisplayName = EditorFeaturesResources.Unnecessary_Code;
......
......@@ -14,6 +14,7 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.EditAndContinue
[ExcludeFromCodeCoverage]
internal sealed class ActiveStatementTagFormatDefinition : MarkerFormatDefinition
{
[ImportingConstructor]
public ActiveStatementTagFormatDefinition()
{
// TODO (tomat): bug 777271
......
......@@ -12,6 +12,7 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.EditAndContinue
[UserVisible(true)]
internal sealed class EditAndContinueErrorTypeFormatDefinition : EditorFormatDefinition
{
[ImportingConstructor]
public EditAndContinueErrorTypeFormatDefinition()
{
this.ForegroundBrush = Brushes.Purple;
......
......@@ -17,6 +17,7 @@ internal class RenameConflictTagDefinition : MarkerFormatDefinition
public static double StrokeThickness => 1.5;
public static double[] StrokeDashArray => new[] { 8.0, 4.0 };
[ImportingConstructor]
public RenameConflictTagDefinition()
{
this.Border = new Pen(Brushes.Red, thickness: StrokeThickness) { DashStyle = new DashStyle(StrokeDashArray, 0) };
......
......@@ -14,6 +14,7 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.HighlightTag
[ExcludeFromCodeCoverage]
internal class RenameFieldBackgroundAndBorderTagDefinition : MarkerFormatDefinition
{
[ImportingConstructor]
public RenameFieldBackgroundAndBorderTagDefinition()
{
// The Border color should match the BackgroundColor from the
......
......@@ -17,6 +17,7 @@ internal class RenameFixupTagDefinition : MarkerFormatDefinition
public static double StrokeThickness => 1.0;
public static double[] StrokeDashArray => new[] { 4.0, 4.0 };
[ImportingConstructor]
public RenameFixupTagDefinition()
{
this.Border = new Pen(Brushes.Green, thickness: StrokeThickness) { DashStyle = new DashStyle(StrokeDashArray, 0) };
......
......@@ -25,6 +25,7 @@ internal sealed class ClassificationTypeDefinitions
[UserVisible(true)]
private class InlineRenameFieldFormatDefinition : ClassificationFormatDefinition
{
[ImportingConstructor]
private InlineRenameFieldFormatDefinition()
{
this.DisplayName = EditorFeaturesResources.Inline_Rename_Field_Text;
......
......@@ -14,6 +14,7 @@ namespace Microsoft.CodeAnalysis.Editor.Shared.Tagging.Tags
[ExcludeFromCodeCoverage]
internal class PreviewWarningTagDefinition : MarkerFormatDefinition
{
[ImportingConstructor]
public PreviewWarningTagDefinition()
{
this.Border = new Pen(new SolidColorBrush(Color.FromRgb(230, 117, 64)), thickness: 1.5);
......
......@@ -12,6 +12,7 @@ namespace Microsoft.CodeAnalysis.Editor.ReferenceHighlighting
[UserVisible(true)]
internal class DefinitionHighlightTagDefinition : MarkerFormatDefinition
{
[ImportingConstructor]
public DefinitionHighlightTagDefinition()
{
// NOTE: This is the same color used by the editor for reference highlighting
......
......@@ -12,6 +12,7 @@ namespace Microsoft.CodeAnalysis.Editor.ReferenceHighlighting
[UserVisible(true)]
internal class WrittenReferenceHighlightTagDefinition : MarkerFormatDefinition
{
[ImportingConstructor]
public WrittenReferenceHighlightTagDefinition()
{
// NOTE: This is the same color used by the editor for reference highlighting
......
......@@ -14,6 +14,7 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.RenameTracking
[ExcludeFromCodeCoverage]
internal class RenameTrackingTagDefinition : MarkerFormatDefinition
{
[ImportingConstructor]
public RenameTrackingTagDefinition()
{
this.Border = new Pen(Brushes.Black, thickness: 1.0) { DashStyle = new DashStyle(new[] { 0.5, 4.0 }, 1) };
......
......@@ -30,6 +30,7 @@ internal sealed class ActiveStatementTrackingService : IActiveStatementTrackingS
{
private TrackingSession _sessionOpt;
[ImportingConstructor]
internal ActiveStatementTrackingService()
{
}
......
......@@ -46,6 +46,7 @@ internal class MetadataAsSourceFileService : IMetadataAsSourceFileService
private string _rootTemporaryPathWithGuid;
private readonly string _rootTemporaryPath;
[ImportingConstructor]
public MetadataAsSourceFileService()
{
_rootTemporaryPath = Path.Combine(Path.GetTempPath(), "MetadataAsSource");
......
......@@ -18,6 +18,7 @@ public sealed class TestWaitIndicator : IWaitIndicator, VisualStudioIndicator.IW
private readonly IWaitContext _waitContext;
private readonly Microsoft.VisualStudio.Language.Intellisense.Utilities.IWaitContext _platformWaitContext = new UncancellableWaitContext();
[ImportingConstructor]
public TestWaitIndicator()
: this(new UncancellableWaitContext())
{
......
......@@ -12,6 +12,7 @@ namespace Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
[Export(typeof(Workspace))]
internal class MefTestWorkspace : Workspace
{
[ImportingConstructor]
public MefTestWorkspace()
: base(Microsoft.CodeAnalysis.Host.Mef.MefHostServices.DefaultHost, "MefTest")
{
......
......@@ -13,6 +13,7 @@ namespace Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
[ExportWorkspaceServiceFactory(typeof(IHostDependentFormattingRuleFactoryService), WorkspaceKind.Test), Shared]
internal sealed class TestFormattingRuleFactoryServiceFactory : IWorkspaceServiceFactory
{
[ImportingConstructor]
public TestFormattingRuleFactoryServiceFactory()
{
}
......
......@@ -12,6 +12,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Features.EmbeddedLanguages
Public Shared Shadows Instance As New VisualBasicEmbeddedLanguageEditorFeaturesProvider()
<ImportingConstructor>
Public Sub New()
MyBase.New(VisualBasicEmbeddedLanguagesProvider.Info)
End Sub
......
......@@ -21,6 +21,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.Formatting.Indentation
Private ReadOnly _specializedIndentationRule As AbstractFormattingRule
<ImportingConstructor>
Public Sub New()
Me.New(New SpecialFormattingRule())
End Sub
......
......@@ -18,6 +18,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.Wrapping
New VisualBasicParameterWrapper(),
New VisualBasicBinaryExpressionWrapper())
<ImportingConstructor>
Public Sub New()
MyBase.New(s_wrappers)
End Sub
......
......@@ -151,6 +151,7 @@ internal class CSharpAddImportCodeFixProvider : AbstractAddImportCodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds => AddImportDiagnosticIds.FixableDiagnosticIds;
[ImportingConstructor]
public CSharpAddImportCodeFixProvider()
{
}
......
......@@ -19,6 +19,7 @@ internal class CSharpAddMissingReferenceCodeFixProvider : AbstractAddMissingRefe
public sealed override ImmutableArray<string> FixableDiagnosticIds { get; }
= ImmutableArray.Create(CS0012);
[ImportingConstructor]
public CSharpAddMissingReferenceCodeFixProvider()
{
}
......
......@@ -20,6 +20,7 @@ internal class CSharpAddObsoleteAttributeCodeFixProvider
"CS1064" // The best overloaded Add method 'MyCollection.Add(int)' for the collection initializer element is obsolete"
);
[ImportingConstructor]
public CSharpAddObsoleteAttributeCodeFixProvider()
: base(CSharpSyntaxFactsService.Instance, CSharpFeaturesResources.Add_Obsolete)
{
......
......@@ -29,6 +29,7 @@ internal class CSharpFixReturnTypeCodeFixProvider : SyntaxEditorBasedCodeFixProv
// error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
public override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create("CS0127", "CS1997", "CS0201");
[ImportingConstructor]
public CSharpFixReturnTypeCodeFixProvider()
: base(supportsFixAll: false)
{
......
......@@ -11,6 +11,7 @@ internal class CSharpResolveConflictMarkerCodeFixProvider : AbstractResolveConfl
{
private const string CS8300 = nameof(CS8300); // Merge conflict marker encountered
[ImportingConstructor]
public CSharpResolveConflictMarkerCodeFixProvider()
: base(CS8300)
{
......
......@@ -13,6 +13,7 @@ internal class CSharpEmbeddedLanguageFeaturesProvider : AbstractEmbeddedLanguage
{
public static IEmbeddedLanguageFeaturesProvider Instance = new CSharpEmbeddedLanguageFeaturesProvider();
[ImportingConstructor]
public CSharpEmbeddedLanguageFeaturesProvider() : base(CSharpEmbeddedLanguagesProvider.Info)
{
}
......
......@@ -14,6 +14,7 @@ internal class CSharpImplementAbstractClassCodeFixProvider :
{
private const string CS0534 = nameof(CS0534); // 'Program' does not implement inherited abstract member 'Goo.bar()'
[ImportingConstructor]
public CSharpImplementAbstractClassCodeFixProvider()
: base(CS0534)
{
......
......@@ -15,6 +15,7 @@ internal class CSharpOrderModifiersCodeFixProvider : AbstractOrderModifiersCodeF
{
private const string CS0267 = nameof(CS0267); // The 'partial' modifier can only appear immediately before 'class', 'struct', 'interface', or 'void'
[ImportingConstructor]
public CSharpOrderModifiersCodeFixProvider()
: base(CSharpSyntaxFactsService.Instance, CSharpCodeStyleOptions.PreferredModifierOrder, CSharpOrderModifiersHelper.Instance)
{
......
......@@ -16,6 +16,7 @@ namespace Microsoft.CodeAnalysis.CSharp.SimplifyTypeNames
[ExtensionOrder(After = PredefinedCodeFixProviderNames.RemoveUnnecessaryCast)]
internal partial class SimplifyTypeNamesCodeFixProvider : AbstractSimplifyTypeNamesCodeFixProvider<SyntaxKind>
{
[ImportingConstructor]
public SimplifyTypeNamesCodeFixProvider()
: base(new CSharpSimplifyTypeNamesDiagnosticAnalyzer())
{
......
......@@ -11,6 +11,7 @@ namespace Microsoft.CodeAnalysis.CSharp.UseCompoundAssignment
internal class CSharpUseCompoundAssignmentCodeFixProvider
: AbstractUseCompoundAssignmentCodeFixProvider<SyntaxKind, AssignmentExpressionSyntax, ExpressionSyntax>
{
[ImportingConstructor]
public CSharpUseCompoundAssignmentCodeFixProvider()
: base(Utilities.Kinds)
{
......
......@@ -25,6 +25,7 @@ internal partial class UseExpressionBodyCodeFixProvider : SyntaxEditorBasedCodeF
private static readonly ImmutableArray<UseExpressionBodyHelper> _helpers = UseExpressionBodyHelper.Helpers;
[ImportingConstructor]
public UseExpressionBodyCodeFixProvider()
{
FixableDiagnosticIds = _helpers.SelectAsArray(h => h.DiagnosticId);
......
......@@ -21,6 +21,7 @@ internal class UseExpressionBodyCodeRefactoringProvider : CodeRefactoringProvide
{
private static readonly ImmutableArray<UseExpressionBodyHelper> _helpers = UseExpressionBodyHelper.Helpers;
[ImportingConstructor]
public UseExpressionBodyCodeRefactoringProvider()
{
}
......
......@@ -19,6 +19,7 @@ namespace Microsoft.CodeAnalysis.CSharp.UseExpressionBodyForLambda
Name = PredefinedCodeRefactoringProviderNames.UseExpressionBody), Shared]
internal sealed class UseExpressionBodyForLambdaCodeRefactoringProvider : CodeRefactoringProvider
{
[ImportingConstructor]
public UseExpressionBodyForLambdaCodeRefactoringProvider()
{
}
......
......@@ -66,6 +66,7 @@ protected override AttributeArgumentSyntax WithName(AttributeArgumentSyntax argu
=> argument.WithNameColon(SyntaxFactory.NameColon(name.ToIdentifierName()));
}
[ImportingConstructor]
public CSharpUseNamedArgumentsCodeRefactoringProvider()
: base(new ArgumentAnalyzer(), new AttributeArgumentAnalyzer())
{
......
......@@ -20,6 +20,7 @@ namespace Microsoft.CodeAnalysis.CSharp.UsePatternMatching
[ExportCodeFixProvider(LanguageNames.CSharp), Shared]
internal partial class CSharpIsAndCastCheckWithoutNameCodeFixProvider : SyntaxEditorBasedCodeFixProvider
{
[ImportingConstructor]
public CSharpIsAndCastCheckWithoutNameCodeFixProvider()
: base(supportsFixAll: false)
{
......
......@@ -39,6 +39,7 @@ internal partial class GenerateConstructorFromMembersCodeRefactoringProvider : A
private readonly IPickMembersService _pickMembersService_forTesting;
[ImportingConstructor]
public GenerateConstructorFromMembersCodeRefactoringProvider() : this(null)
{
}
......
......@@ -33,6 +33,7 @@ internal partial class GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringPro
private readonly IPickMembersService _pickMembersService_forTestingPurposes;
[ImportingConstructor]
public GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider()
: this(pickMembersService: null)
{
......
......@@ -17,6 +17,7 @@ internal partial class GenerateOverridesCodeRefactoringProvider : CodeRefactorin
{
private readonly IPickMembersService _pickMembersService_forTestingPurposes;
[ImportingConstructor]
public GenerateOverridesCodeRefactoringProvider() : this(null)
{
}
......
......@@ -97,6 +97,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.AddImport
Friend Class VisualBasicAddImportCodeFixProvider
Inherits AbstractAddImportCodeFixProvider
<ImportingConstructor>
Public Sub New()
End Sub
......
......@@ -16,6 +16,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.AddObsoleteAttribute
"BC40008" ' 'C' is obsolete.
)
<ImportingConstructor>
Public Sub New()
MyBase.New(VisualBasicSyntaxFactsService.Instance, VBFeaturesResources.Add_Obsolete)
End Sub
......
......@@ -17,6 +17,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.AddMissingReference
Friend Const BC30005 As String = "BC30005" ' ERR_UnreferencedAssemblyEvent3
Friend Const BC30652 As String = "BC30652" ' ERR_UnreferencedAssembly3
<ImportingConstructor>
Public Sub New()
End Sub
......
......@@ -11,6 +11,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ConflictMarkerResolution
Private Const BC37284 As String = NameOf(BC37284)
<ImportingConstructor>
Public Sub New()
MyBase.New(BC37284)
End Sub
......
......@@ -12,6 +12,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Features.EmbeddedLanguages
Public Shared Shadows Instance As New VisualBasicEmbeddedLanguageFeaturesProvider()
<ImportingConstructor>
Public Sub New()
MyBase.New(VisualBasicEmbeddedLanguagesProvider.Info)
End Sub
......
......@@ -14,6 +14,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ImplementAbstractClass
Friend Const BC30610 As String = "BC30610" ' Class 'goo' must either be declared 'MustInherit' or override the following inherited 'MustOverride' member(s):
<ImportingConstructor>
Public Sub New()
MyBase.New(BC30610)
End Sub
......
......@@ -11,6 +11,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.OrderModifiers
Friend Class VisualBasicOrderModifiersCodeFixProvider
Inherits AbstractOrderModifiersCodeFixProvider
<ImportingConstructor>
Public Sub New()
MyBase.New(VisualBasicSyntaxFactsService.Instance,
VisualBasicCodeStyleOptions.PreferredModifierOrder,
......
......@@ -14,6 +14,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.SimplifyTypeNames
Partial Friend Class SimplifyTypeNamesCodeFixProvider
Inherits AbstractSimplifyTypeNamesCodeFixProvider(Of SyntaxKind)
<ImportingConstructor>
Public Sub New()
MyBase.New(New VisualBasicSimplifyTypeNamesDiagnosticAnalyzer())
End Sub
......
......@@ -11,6 +11,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UseCompoundAssignment
Friend Class VisualBasicUseCompoundAssignmentCodeFixProvider
Inherits AbstractUseCompoundAssignmentCodeFixProvider(Of SyntaxKind, AssignmentStatementSyntax, ExpressionSyntax)
<ImportingConstructor>
Public Sub New()
MyBase.New(Kinds)
End Sub
......
......@@ -53,6 +53,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UseNamedArguments
End Function
End Class
<ImportingConstructor>
Public Sub New()
MyBase.New(New ArgumentAnalyzer(), attributeArgumentAnalyzer:=Nothing)
End Sub
......
......@@ -22,6 +22,7 @@ internal class CSharpLibraryService : AbstractLibraryService
parameterOptions: SymbolDisplayParameterOptions.IncludeType,
miscellaneousOptions: SymbolDisplayMiscellaneousOptions.UseSpecialTypes);
[ImportingConstructor]
public CSharpLibraryService()
: base(Guids.CSharpLibraryId, __SymbolToolLanguage.SymbolToolLanguage_CSharp, s_typeDisplayFormat, s_memberDisplayFormat)
{
......
......@@ -56,6 +56,7 @@ DkmCustomMessage IDkmCustomMessageForwardReceiver.SendLower(DkmCustomMessage cus
private readonly DebuggeeModuleInfoCache _baselineMetadata;
[ImportingConstructor]
public DebuggeeModuleMetadataProvider()
{
_baselineMetadata = new DebuggeeModuleInfoCache();
......
......@@ -21,6 +21,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation
[ExportWorkspaceServiceFactory(typeof(IHostDependentFormattingRuleFactoryService), ServiceLayer.Host), Shared]
internal sealed class VisualStudioFormattingRuleFactoryServiceFactory : IWorkspaceServiceFactory
{
[ImportingConstructor]
public VisualStudioFormattingRuleFactoryServiceFactory()
{
}
......
......@@ -18,6 +18,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation
[ExportWorkspaceServiceFactory(typeof(IWorkspaceStatusService), ServiceLayer.Host), Shared]
internal class VisualStudioWorkspaceStatusServiceFactory : IWorkspaceServiceFactory
{
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public VisualStudioWorkspaceStatusServiceFactory()
{
......
......@@ -23,6 +23,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.ObjectBrowser
parameterOptions:=SymbolDisplayParameterOptions.IncludeType,
miscellaneousOptions:=SymbolDisplayMiscellaneousOptions.UseSpecialTypes)
<ImportingConstructor>
Public Sub New()
MyBase.New(Guids.VisualBasicLibraryId, __SymbolToolLanguage.SymbolToolLanguage_VB, s_typeDisplayFormat, s_memberDisplayFormat)
End Sub
......
......@@ -11,6 +11,7 @@ namespace Roslyn.Hosting.Diagnostics.VenusMargin
[Name(ProjectionSpanTag.TagId)]
internal class ProjectionSpanTagDefinition : MarkerFormatDefinition
{
[ImportingConstructor]
public ProjectionSpanTagDefinition()
{
this.Border = new Pen(Brushes.DarkBlue, thickness: 1.5);
......
......@@ -19,6 +19,7 @@ internal class CSharpEmbeddedLanguagesProvider : AbstractEmbeddedLanguagesProvid
CSharpVirtualCharService.Instance);
public static IEmbeddedLanguagesProvider Instance = new CSharpEmbeddedLanguagesProvider();
[ImportingConstructor]
public CSharpEmbeddedLanguagesProvider() : base(Info)
{
}
......
......@@ -32,6 +32,7 @@ internal partial class CSharpSimplificationService : AbstractSimplificationServi
new CSharpInferredMemberNameReducer(),
new CSharpDefaultExpressionReducer());
[ImportingConstructor]
public CSharpSimplificationService() : base(s_reducers)
{
}
......
......@@ -11,6 +11,7 @@ namespace Microsoft.CodeAnalysis.Formatting.Rules
[ExportWorkspaceServiceFactory(typeof(IHostDependentFormattingRuleFactoryService), ServiceLayer.Default), Shared]
internal sealed class DefaultFormattingRuleFactoryServiceFactory : IWorkspaceServiceFactory
{
[ImportingConstructor]
public DefaultFormattingRuleFactoryServiceFactory()
{
}
......
......@@ -79,6 +79,7 @@ public static void Enable(bool enable, bool? diagnostics)
s_enableDiagnosticTokens = diagnostics;
}
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public AsynchronousOperationListenerProvider()
{
......
......@@ -37,6 +37,7 @@ internal class PerformanceTrackerService : IPerformanceTrackerService
public event EventHandler SnapshotAdded;
[ImportingConstructor]
public PerformanceTrackerService() :
this(DefaultMinLOFValue, DefaultAverageThreshold, DefaultStddevThreshold)
{
......
......@@ -14,6 +14,7 @@ internal class RemoteGlobalOperationNotificationService : IGlobalOperationNotifi
public event EventHandler Started;
public event EventHandler<GlobalOperationEventArgs> Stopped;
[ImportingConstructor]
public RemoteGlobalOperationNotificationService()
{
}
......
......@@ -19,6 +19,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.EmbeddedLanguages.LanguageServices
Public Shared Instance As New VisualBasicEmbeddedLanguagesProvider()
<ImportingConstructor>
Public Sub New()
MyBase.New(Info)
End Sub
......
......@@ -28,6 +28,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Simplification
New VisualBasicVariableDeclaratorReducer(),
New VisualBasicInferredMemberNameReducer())
<ImportingConstructor>
Public Sub New()
MyBase.New(s_reducers)
End Sub
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册