提交 31eeea58 编写于 作者: D dotnet-bot 提交者: Manish Vasani

FixAll in solution for IDE0036 (Order modifiers) for C# projects

上级 79a7d02d
...@@ -22,7 +22,7 @@ internal sealed class CSharpUseInferredMemberNameDiagnosticAnalyzer : AbstractUs ...@@ -22,7 +22,7 @@ internal sealed class CSharpUseInferredMemberNameDiagnosticAnalyzer : AbstractUs
protected override void InitializeWorker(AnalysisContext context) protected override void InitializeWorker(AnalysisContext context)
=> context.RegisterSyntaxNodeAction(AnalyzeSyntax, SyntaxKind.NameColon, SyntaxKind.NameEquals); => context.RegisterSyntaxNodeAction(AnalyzeSyntax, SyntaxKind.NameColon, SyntaxKind.NameEquals);
override protected void LanguageSpecificAnalyzeSyntax(SyntaxNodeAnalysisContext context, SyntaxTree syntaxTree, AnalyzerOptions options, CancellationToken cancellationToken) protected override void LanguageSpecificAnalyzeSyntax(SyntaxNodeAnalysisContext context, SyntaxTree syntaxTree, AnalyzerOptions options, CancellationToken cancellationToken)
{ {
var parseOptions = (CSharpParseOptions)syntaxTree.Options; var parseOptions = (CSharpParseOptions)syntaxTree.Options;
switch (context.Node.Kind()) switch (context.Node.Kind())
......
...@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.UseInferredMemberName ...@@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.UseInferredMemberName
{ {
internal abstract class AbstractUseInferredMemberNameDiagnosticAnalyzer : AbstractBuiltInCodeStyleDiagnosticAnalyzer internal abstract class AbstractUseInferredMemberNameDiagnosticAnalyzer : AbstractBuiltInCodeStyleDiagnosticAnalyzer
{ {
abstract protected void LanguageSpecificAnalyzeSyntax(SyntaxNodeAnalysisContext context, SyntaxTree syntaxTree, AnalyzerOptions options, CancellationToken cancellationToken); protected abstract void LanguageSpecificAnalyzeSyntax(SyntaxNodeAnalysisContext context, SyntaxTree syntaxTree, AnalyzerOptions options, CancellationToken cancellationToken);
public AbstractUseInferredMemberNameDiagnosticAnalyzer() public AbstractUseInferredMemberNameDiagnosticAnalyzer()
: base(IDEDiagnosticIds.UseInferredMemberNameDiagnosticId, : base(IDEDiagnosticIds.UseInferredMemberNameDiagnosticId,
......
...@@ -17,7 +17,7 @@ namespace Microsoft.CodeAnalysis.UseInferredMemberName ...@@ -17,7 +17,7 @@ namespace Microsoft.CodeAnalysis.UseInferredMemberName
{ {
internal abstract class AbstractUseInferredMemberNameCodeFixProvider : SyntaxEditorBasedCodeFixProvider internal abstract class AbstractUseInferredMemberNameCodeFixProvider : SyntaxEditorBasedCodeFixProvider
{ {
abstract protected void LanguageSpecificRemoveSuggestedNode(SyntaxEditor editor, SyntaxNode node); protected abstract void LanguageSpecificRemoveSuggestedNode(SyntaxEditor editor, SyntaxNode node);
public override ImmutableArray<string> FixableDiagnosticIds { get; } public override ImmutableArray<string> FixableDiagnosticIds { get; }
= ImmutableArray.Create(IDEDiagnosticIds.UseInferredMemberNameDiagnosticId); = ImmutableArray.Create(IDEDiagnosticIds.UseInferredMemberNameDiagnosticId);
......
...@@ -89,7 +89,7 @@ private static bool IsPartialTypeDeclaration(SyntaxNode syntax) ...@@ -89,7 +89,7 @@ private static bool IsPartialTypeDeclaration(SyntaxNode syntax)
return ImmutableDictionary<string, string>.Empty.Add(InsertionTextOnLessThan, symbol.Name.EscapeIdentifier()); return ImmutableDictionary<string, string>.Empty.Add(InsertionTextOnLessThan, symbol.Name.EscapeIdentifier());
} }
public async override Task<TextChange?> GetTextChangeAsync( public override async Task<TextChange?> GetTextChangeAsync(
Document document, CompletionItem selectedItem, char? ch, CancellationToken cancellationToken) Document document, CompletionItem selectedItem, char? ch, CancellationToken cancellationToken)
{ {
if (ch == '<') if (ch == '<')
......
...@@ -39,7 +39,7 @@ protected override Task<ImmutableArray<ISymbol>> GetSymbolsAsync(SyntaxContext c ...@@ -39,7 +39,7 @@ protected override Task<ImmutableArray<ISymbol>> GetSymbolsAsync(SyntaxContext c
context.SemanticModel, position, context.Workspace, options, cancellationToken); context.SemanticModel, position, context.Workspace, options, cancellationToken);
} }
protected async override Task<bool> ShouldProvidePreselectedItemsAsync(CompletionContext completionContext, SyntaxContext syntaxContext, Document document, int position, Lazy<ImmutableArray<ITypeSymbol>> inferredTypes, OptionSet options) protected override async Task<bool> ShouldProvidePreselectedItemsAsync(CompletionContext completionContext, SyntaxContext syntaxContext, Document document, int position, Lazy<ImmutableArray<ITypeSymbol>> inferredTypes, OptionSet options)
{ {
var sourceText = await document.GetTextAsync(CancellationToken.None).ConfigureAwait(false); var sourceText = await document.GetTextAsync(CancellationToken.None).ConfigureAwait(false);
if (ShouldTriggerInArgumentLists(sourceText, options)) if (ShouldTriggerInArgumentLists(sourceText, options))
...@@ -68,7 +68,7 @@ internal override bool IsInsertionTrigger(SourceText text, int characterPosition ...@@ -68,7 +68,7 @@ internal override bool IsInsertionTrigger(SourceText text, int characterPosition
: CompletionUtilities.IsTriggerCharacter(text, characterPosition, options); : CompletionUtilities.IsTriggerCharacter(text, characterPosition, options);
} }
internal async override Task<bool> IsSyntacticTriggerCharacterAsync(Document document, int caretPosition, CompletionTrigger trigger, OptionSet options, CancellationToken cancellationToken) internal override async Task<bool> IsSyntacticTriggerCharacterAsync(Document document, int caretPosition, CompletionTrigger trigger, OptionSet options, CancellationToken cancellationToken)
{ {
if (trigger.Kind == CompletionTriggerKind.Insertion && caretPosition > 0) if (trigger.Kind == CompletionTriggerKind.Insertion && caretPosition > 0)
{ {
......
...@@ -31,7 +31,7 @@ public CSharpEncapsulateFieldService() ...@@ -31,7 +31,7 @@ public CSharpEncapsulateFieldService()
{ {
} }
protected async override Task<SyntaxNode> RewriteFieldNameAndAccessibilityAsync(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken) protected override async Task<SyntaxNode> RewriteFieldNameAndAccessibilityAsync(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken)
{ {
var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
......
...@@ -32,7 +32,7 @@ internal sealed class PythiaSignatureHelpProvider : InvocationExpressionSignatur ...@@ -32,7 +32,7 @@ internal sealed class PythiaSignatureHelpProvider : InvocationExpressionSignatur
public PythiaSignatureHelpProvider(Lazy<IPythiaSignatureHelpProviderImplementation> implementation) public PythiaSignatureHelpProvider(Lazy<IPythiaSignatureHelpProviderImplementation> implementation)
=> _lazyImplementation = implementation; => _lazyImplementation = implementation;
internal async override Task<(ImmutableArray<SignatureHelpItem> items, int? selectedItemIndex)> GetMethodGroupItemsAndSelectionAsync( internal override async Task<(ImmutableArray<SignatureHelpItem> items, int? selectedItemIndex)> GetMethodGroupItemsAndSelectionAsync(
ImmutableArray<IMethodSymbol> accessibleMethods, ImmutableArray<IMethodSymbol> accessibleMethods,
Document document, Document document,
InvocationExpressionSyntax invocationExpression, InvocationExpressionSyntax invocationExpression,
......
...@@ -31,7 +31,7 @@ public int Compare(SyntaxToken x, SyntaxToken y) ...@@ -31,7 +31,7 @@ public int Compare(SyntaxToken x, SyntaxToken y)
return ComparerWithState.CompareTo(x, y, s_comparers); return ComparerWithState.CompareTo(x, y, s_comparers);
} }
private readonly static ImmutableArray<Func<SyntaxToken, IComparable>> s_comparers = private static readonly ImmutableArray<Func<SyntaxToken, IComparable>> s_comparers =
ImmutableArray.Create<Func<SyntaxToken, IComparable>>(t => t.Kind() == SyntaxKind.PartialKeyword, t => GetOrdering(t)); ImmutableArray.Create<Func<SyntaxToken, IComparable>>(t => t.Kind() == SyntaxKind.PartialKeyword, t => GetOrdering(t));
private static Ordering GetOrdering(SyntaxToken token) private static Ordering GetOrdering(SyntaxToken token)
......
...@@ -54,7 +54,7 @@ public int CompareTo(Document document, Reference other) ...@@ -54,7 +54,7 @@ public int CompareTo(Document document, Reference other)
placeSystemNamespaceFirst: true); placeSystemNamespaceFirst: true);
} }
private readonly static ImmutableArray<Func<Reference, Document, IComparable>> s_comparers private static readonly ImmutableArray<Func<Reference, Document, IComparable>> s_comparers
= ImmutableArray.Create<Func<Reference, Document, IComparable>>( = ImmutableArray.Create<Func<Reference, Document, IComparable>>(
// If references have different weights, order by the ones with lower weight (i.e. // If references have different weights, order by the ones with lower weight (i.e.
// they are better matches). // they are better matches).
......
...@@ -33,7 +33,7 @@ internal abstract partial class AbstractAddPackageCodeFixProvider : CodeFixProvi ...@@ -33,7 +33,7 @@ internal abstract partial class AbstractAddPackageCodeFixProvider : CodeFixProvi
protected abstract bool IncludePrerelease { get; } protected abstract bool IncludePrerelease { get; }
public override abstract FixAllProvider GetFixAllProvider(); public abstract override FixAllProvider GetFixAllProvider();
protected async Task<ImmutableArray<CodeAction>> GetAddPackagesCodeActionsAsync( protected async Task<ImmutableArray<CodeAction>> GetAddPackagesCodeActionsAsync(
CodeFixContext context, ISet<string> assemblyNames) CodeFixContext context, ISet<string> assemblyNames)
......
...@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.CodeFixes.Async ...@@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.CodeFixes.Async
{ {
internal abstract partial class AbstractAsyncCodeFix : CodeFixProvider internal abstract partial class AbstractAsyncCodeFix : CodeFixProvider
{ {
public override abstract FixAllProvider GetFixAllProvider(); public abstract override FixAllProvider GetFixAllProvider();
protected abstract Task<CodeAction> GetCodeActionAsync( protected abstract Task<CodeAction> GetCodeActionAsync(
SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken); SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken);
......
...@@ -44,7 +44,7 @@ protected override async Task<IEnumerable<CodeActionOperation>> ComputeOperation ...@@ -44,7 +44,7 @@ protected override async Task<IEnumerable<CodeActionOperation>> ComputeOperation
_showPreviewChangesDialog); _showPreviewChangesDialog);
} }
internal async override Task<Solution> GetChangedSolutionAsync( internal override async Task<Solution> GetChangedSolutionAsync(
IProgressTracker progressTracker, CancellationToken cancellationToken) IProgressTracker progressTracker, CancellationToken cancellationToken)
{ {
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
......
...@@ -18,7 +18,7 @@ private SuppressionFixAllProvider() ...@@ -18,7 +18,7 @@ private SuppressionFixAllProvider()
{ {
} }
public async override Task<CodeAction> GetFixAsync(FixAllContext fixAllContext) public override async Task<CodeAction> GetFixAsync(FixAllContext fixAllContext)
{ {
// currently there's no FixAll support for local suppression, just bail out // currently there's no FixAll support for local suppression, just bail out
if (NestedSuppressionCodeAction.IsEquivalenceKeyForLocalSuppression(fixAllContext.CodeActionEquivalenceKey)) if (NestedSuppressionCodeAction.IsEquivalenceKeyForLocalSuppression(fixAllContext.CodeActionEquivalenceKey))
......
...@@ -35,7 +35,7 @@ internal sealed class LocalSuppressMessageCodeAction : AbstractSuppressionCodeAc ...@@ -35,7 +35,7 @@ internal sealed class LocalSuppressMessageCodeAction : AbstractSuppressionCodeAc
_diagnostic = diagnostic; _diagnostic = diagnostic;
} }
protected async override Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
{ {
var newTargetNode = _fixer.AddLocalSuppressMessageAttribute( var newTargetNode = _fixer.AddLocalSuppressMessageAttribute(
_targetNode, _targetSymbol, _suppressMessageAttribute, _diagnostic); _targetNode, _targetSymbol, _suppressMessageAttribute, _diagnostic);
......
...@@ -19,7 +19,7 @@ internal partial class AbstractSuppressionCodeFixProvider ...@@ -19,7 +19,7 @@ internal partial class AbstractSuppressionCodeFixProvider
/// </summary> /// </summary>
private static class PragmaHelpers private static class PragmaHelpers
{ {
internal async static Task<Document> GetChangeDocumentWithPragmaAdjustedAsync( internal static async Task<Document> GetChangeDocumentWithPragmaAdjustedAsync(
Document document, Document document,
TextSpan diagnosticSpan, TextSpan diagnosticSpan,
SuppressionTargetInfo suppressionTargetInfo, SuppressionTargetInfo suppressionTargetInfo,
......
...@@ -49,7 +49,7 @@ public PragmaWarningCodeAction CloneForFixMultipleContext() ...@@ -49,7 +49,7 @@ public PragmaWarningCodeAction CloneForFixMultipleContext()
protected override string DiagnosticIdForEquivalenceKey => protected override string DiagnosticIdForEquivalenceKey =>
_forFixMultipleContext ? string.Empty : _diagnostic.Id; _forFixMultipleContext ? string.Empty : _diagnostic.Id;
protected async override Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
=> await GetChangedDocumentAsync(includeStartTokenChange: true, includeEndTokenChange: true, cancellationToken: cancellationToken).ConfigureAwait(false); => await GetChangedDocumentAsync(includeStartTokenChange: true, includeEndTokenChange: true, cancellationToken: cancellationToken).ConfigureAwait(false);
public async Task<Document> GetChangedDocumentAsync(bool includeStartTokenChange, bool includeEndTokenChange, CancellationToken cancellationToken) public async Task<Document> GetChangedDocumentAsync(bool includeStartTokenChange, bool includeEndTokenChange, CancellationToken cancellationToken)
......
...@@ -81,7 +81,7 @@ public BatchFixer(AbstractSuppressionCodeFixProvider suppressionFixProvider) ...@@ -81,7 +81,7 @@ public BatchFixer(AbstractSuppressionCodeFixProvider suppressionFixProvider)
} }
} }
protected async override Task AddProjectFixesAsync( protected override async Task AddProjectFixesAsync(
Project project, ImmutableArray<Diagnostic> diagnostics, Project project, ImmutableArray<Diagnostic> diagnostics,
ConcurrentBag<(Diagnostic diagnostic, CodeAction action)> bag, ConcurrentBag<(Diagnostic diagnostic, CodeAction action)> bag,
FixAllState fixAllState, CancellationToken cancellationToken) FixAllState fixAllState, CancellationToken cancellationToken)
......
...@@ -54,7 +54,7 @@ public async Task<SyntaxNode> GetAttributeToRemoveAsync(CancellationToken cancel ...@@ -54,7 +54,7 @@ public async Task<SyntaxNode> GetAttributeToRemoveAsync(CancellationToken cancel
attributeNode; attributeNode;
} }
protected async override Task<Solution> GetChangedSolutionAsync(CancellationToken cancellationToken) protected override async Task<Solution> GetChangedSolutionAsync(CancellationToken cancellationToken)
{ {
var attributeNode = await GetAttributeToRemoveAsync(cancellationToken).ConfigureAwait(false); var attributeNode = await GetAttributeToRemoveAsync(cancellationToken).ConfigureAwait(false);
var documentWithAttribute = _project.GetDocument(attributeNode.SyntaxTree); var documentWithAttribute = _project.GetDocument(attributeNode.SyntaxTree);
......
...@@ -55,7 +55,7 @@ public override RemoveSuppressionCodeAction CloneForFixMultipleContext() ...@@ -55,7 +55,7 @@ public override RemoveSuppressionCodeAction CloneForFixMultipleContext()
public override SyntaxTree SyntaxTreeToModify => _suppressionTargetInfo.StartToken.SyntaxTree; public override SyntaxTree SyntaxTreeToModify => _suppressionTargetInfo.StartToken.SyntaxTree;
protected async override Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
=> await GetChangedDocumentAsync(includeStartTokenChange: true, includeEndTokenChange: true, cancellationToken: cancellationToken).ConfigureAwait(false); => await GetChangedDocumentAsync(includeStartTokenChange: true, includeEndTokenChange: true, cancellationToken: cancellationToken).ConfigureAwait(false);
public async Task<Document> GetChangedDocumentAsync(bool includeStartTokenChange, bool includeEndTokenChange, CancellationToken cancellationToken) public async Task<Document> GetChangedDocumentAsync(bool includeStartTokenChange, bool includeEndTokenChange, CancellationToken cancellationToken)
......
...@@ -23,7 +23,7 @@ public WrapperCodeFixProvider(IConfigurationFixProvider suppressionFixProvider, ...@@ -23,7 +23,7 @@ public WrapperCodeFixProvider(IConfigurationFixProvider suppressionFixProvider,
public IConfigurationFixProvider SuppressionFixProvider => _suppressionFixProvider; public IConfigurationFixProvider SuppressionFixProvider => _suppressionFixProvider;
public override ImmutableArray<string> FixableDiagnosticIds => _originalDiagnosticIds; public override ImmutableArray<string> FixableDiagnosticIds => _originalDiagnosticIds;
public async override Task RegisterCodeFixesAsync(CodeFixContext context) public override async Task RegisterCodeFixesAsync(CodeFixContext context)
{ {
var diagnostics = context.Diagnostics.Where(_suppressionFixProvider.IsFixableDiagnostic); var diagnostics = context.Diagnostics.Where(_suppressionFixProvider.IsFixableDiagnostic);
......
...@@ -169,7 +169,7 @@ protected ImmutableArray<CompletionProvider> GetProviders(ImmutableHashSet<strin ...@@ -169,7 +169,7 @@ protected ImmutableArray<CompletionProvider> GetProviders(ImmutableHashSet<strin
return ImmutableArray<CompletionProvider>.Empty; return ImmutableArray<CompletionProvider>.Empty;
} }
internal protected CompletionProvider GetProvider(CompletionItem item) protected internal CompletionProvider GetProvider(CompletionItem item)
{ {
CompletionProvider provider = null; CompletionProvider provider = null;
......
...@@ -22,7 +22,7 @@ protected AbstractPartialTypeCompletionProvider() ...@@ -22,7 +22,7 @@ protected AbstractPartialTypeCompletionProvider()
{ {
} }
public async sealed override Task ProvideCompletionsAsync(CompletionContext completionContext) public sealed override async Task ProvideCompletionsAsync(CompletionContext completionContext)
{ {
try try
{ {
......
...@@ -27,7 +27,7 @@ protected override bool ShouldProvideCompletion(Document document, SyntaxContext ...@@ -27,7 +27,7 @@ protected override bool ShouldProvideCompletion(Document document, SyntaxContext
protected override void LogCommit() protected override void LogCommit()
=> CompletionProvidersLogger.LogCommitOfExtensionMethodImportCompletionItem(); => CompletionProvidersLogger.LogCommitOfExtensionMethodImportCompletionItem();
protected async override Task AddCompletionItemsAsync( protected override async Task AddCompletionItemsAsync(
CompletionContext completionContext, CompletionContext completionContext,
SyntaxContext syntaxContext, SyntaxContext syntaxContext,
HashSet<string> namespaceInScope, HashSet<string> namespaceInScope,
......
...@@ -9,11 +9,11 @@ namespace Microsoft.CodeAnalysis.Completion.Providers ...@@ -9,11 +9,11 @@ namespace Microsoft.CodeAnalysis.Completion.Providers
{ {
internal static class SymbolMatchPriority internal static class SymbolMatchPriority
{ {
internal readonly static int Keyword = 100; internal static readonly int Keyword = 100;
internal readonly static int PreferType = 200; internal static readonly int PreferType = 200;
internal readonly static int PreferNamedArgument = 300; internal static readonly int PreferNamedArgument = 300;
internal readonly static int PreferEventOrMethod = 400; internal static readonly int PreferEventOrMethod = 400;
internal readonly static int PreferFieldOrProperty = 500; internal static readonly int PreferFieldOrProperty = 500;
internal readonly static int PreferLocalOrParameterOrRangeVariable = 600; internal static readonly int PreferLocalOrParameterOrRangeVariable = 600;
} }
} }
...@@ -15,7 +15,7 @@ internal partial class DiagnosticIncrementalAnalyzer ...@@ -15,7 +15,7 @@ internal partial class DiagnosticIncrementalAnalyzer
private static class InMemoryStorage private static class InMemoryStorage
{ {
// the reason using nested map rather than having tuple as key is so that I dont have a gigantic map // the reason using nested map rather than having tuple as key is so that I dont have a gigantic map
private readonly static ConcurrentDictionary<DiagnosticAnalyzer, ConcurrentDictionary<(object key, string stateKey), CacheEntry>> s_map = private static readonly ConcurrentDictionary<DiagnosticAnalyzer, ConcurrentDictionary<(object key, string stateKey), CacheEntry>> s_map =
new ConcurrentDictionary<DiagnosticAnalyzer, ConcurrentDictionary<(object key, string stateKey), CacheEntry>>(concurrencyLevel: 2, capacity: 10); new ConcurrentDictionary<DiagnosticAnalyzer, ConcurrentDictionary<(object key, string stateKey), CacheEntry>>(concurrencyLevel: 2, capacity: 10);
public static bool TryGetValue(DiagnosticAnalyzer analyzer, (object key, string stateKey) key, out CacheEntry entry) public static bool TryGetValue(DiagnosticAnalyzer analyzer, (object key, string stateKey) key, out CacheEntry entry)
......
...@@ -24,7 +24,7 @@ internal abstract class AbstractAddDocCommentNodesCodeFixProvider ...@@ -24,7 +24,7 @@ internal abstract class AbstractAddDocCommentNodesCodeFixProvider
{ {
public override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer; public override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer;
public async sealed override Task RegisterCodeFixesAsync(CodeFixContext context) public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
{ {
var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
var parentMethod = root.FindNode(context.Span).FirstAncestorOrSelf<TMemberDeclarationSyntax>(); var parentMethod = root.FindNode(context.Span).FirstAncestorOrSelf<TMemberDeclarationSyntax>();
......
...@@ -30,7 +30,7 @@ internal abstract class AbstractRemoveDocCommentNodeCodeFixProvider<TXmlElementS ...@@ -30,7 +30,7 @@ internal abstract class AbstractRemoveDocCommentNodeCodeFixProvider<TXmlElementS
protected abstract bool IsXmlNewLineToken(SyntaxToken token); protected abstract bool IsXmlNewLineToken(SyntaxToken token);
protected abstract bool IsXmlWhitespaceToken(SyntaxToken token); protected abstract bool IsXmlWhitespaceToken(SyntaxToken token);
public async sealed override Task RegisterCodeFixesAsync(CodeFixContext context) public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
{ {
var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
......
...@@ -181,7 +181,7 @@ public override bool TryGetDocumentChecksum(string documentPath, out ImmutableAr ...@@ -181,7 +181,7 @@ public override bool TryGetDocumentChecksum(string documentPath, out ImmutableAr
/// <remarks> /// <remarks>
/// Automatically detects the underlying PDB format and returns the appropriate reader. /// Automatically detects the underlying PDB format and returns the appropriate reader.
/// </remarks> /// </remarks>
public unsafe static EditAndContinueMethodDebugInfoReader Create(ISymUnmanagedReader5 symReader, int version = 1) public static unsafe EditAndContinueMethodDebugInfoReader Create(ISymUnmanagedReader5 symReader, int version = 1)
{ {
if (symReader == null) if (symReader == null)
{ {
...@@ -214,7 +214,7 @@ public unsafe static EditAndContinueMethodDebugInfoReader Create(ISymUnmanagedRe ...@@ -214,7 +214,7 @@ public unsafe static EditAndContinueMethodDebugInfoReader Create(ISymUnmanagedRe
/// <returns> /// <returns>
/// The resulting reader does not take ownership of the <paramref name="pdbReader"/> or the memory it reads. /// The resulting reader does not take ownership of the <paramref name="pdbReader"/> or the memory it reads.
/// </returns> /// </returns>
public unsafe static EditAndContinueMethodDebugInfoReader Create(MetadataReader pdbReader) public static unsafe EditAndContinueMethodDebugInfoReader Create(MetadataReader pdbReader)
=> new Portable(pdbReader ?? throw new ArgumentNullException(nameof(pdbReader))); => new Portable(pdbReader ?? throw new ArgumentNullException(nameof(pdbReader)));
internal static bool TryGetDocumentChecksum(ISymUnmanagedReader5 symReader, string documentPath, out ImmutableArray<byte> checksum, out Guid algorithmId) internal static bool TryGetDocumentChecksum(ISymUnmanagedReader5 symReader, string documentPath, out ImmutableArray<byte> checksum, out Guid algorithmId)
......
...@@ -41,7 +41,7 @@ public override string Title ...@@ -41,7 +41,7 @@ public override string Title
} }
} }
protected async override Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken) protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
{ {
var newRoot = await GetNewRootAsync(cancellationToken).ConfigureAwait(false); var newRoot = await GetNewRootAsync(cancellationToken).ConfigureAwait(false);
var newDocument = _document.WithSyntaxRoot(newRoot); var newDocument = _document.WithSyntaxRoot(newRoot);
......
...@@ -41,7 +41,7 @@ public State(TService service, SemanticDocument document) ...@@ -41,7 +41,7 @@ public State(TService service, SemanticDocument document)
Document = document; Document = document;
} }
public async static Task<State> GenerateAsync( public static async Task<State> GenerateAsync(
TService service, TService service,
SemanticDocument document, SemanticDocument document,
TextSpan textSpan, TextSpan textSpan,
......
...@@ -17,7 +17,7 @@ protected abstract class CompatAbstractMetadataFormattingRule : AbstractMetadata ...@@ -17,7 +17,7 @@ protected abstract class CompatAbstractMetadataFormattingRule : AbstractMetadata
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member #pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextSuppressOperationAction nextOperation) public sealed override void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextSuppressOperationAction nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
AddSuppressOperationsSlow(list, node, options, ref nextOperationCopy); AddSuppressOperationsSlow(list, node, options, ref nextOperationCopy);
...@@ -25,7 +25,7 @@ public override sealed void AddSuppressOperations(List<SuppressOperation> list, ...@@ -25,7 +25,7 @@ public override sealed void AddSuppressOperations(List<SuppressOperation> list,
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextAnchorIndentationOperationAction nextOperation) public sealed override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextAnchorIndentationOperationAction nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
AddAnchorIndentationOperationsSlow(list, node, options, ref nextOperationCopy); AddAnchorIndentationOperationsSlow(list, node, options, ref nextOperationCopy);
...@@ -33,7 +33,7 @@ public override sealed void AddAnchorIndentationOperations(List<AnchorIndentatio ...@@ -33,7 +33,7 @@ public override sealed void AddAnchorIndentationOperations(List<AnchorIndentatio
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextIndentBlockOperationAction nextOperation) public sealed override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextIndentBlockOperationAction nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
AddIndentBlockOperationsSlow(list, node, options, ref nextOperationCopy); AddIndentBlockOperationsSlow(list, node, options, ref nextOperationCopy);
...@@ -41,7 +41,7 @@ public override sealed void AddIndentBlockOperations(List<IndentBlockOperation> ...@@ -41,7 +41,7 @@ public override sealed void AddIndentBlockOperations(List<IndentBlockOperation>
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextAlignTokensOperationAction nextOperation) public sealed override void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextAlignTokensOperationAction nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
AddAlignTokensOperationsSlow(list, node, options, ref nextOperationCopy); AddAlignTokensOperationsSlow(list, node, options, ref nextOperationCopy);
...@@ -49,7 +49,7 @@ public override sealed void AddAlignTokensOperations(List<AlignTokensOperation> ...@@ -49,7 +49,7 @@ public override sealed void AddAlignTokensOperations(List<AlignTokensOperation>
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed AdjustNewLinesOperation GetAdjustNewLinesOperation(SyntaxToken previousToken, SyntaxToken currentToken, AnalyzerConfigOptions options, in NextGetAdjustNewLinesOperation nextOperation) public sealed override AdjustNewLinesOperation GetAdjustNewLinesOperation(SyntaxToken previousToken, SyntaxToken currentToken, AnalyzerConfigOptions options, in NextGetAdjustNewLinesOperation nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
return GetAdjustNewLinesOperationSlow(previousToken, currentToken, options, ref nextOperationCopy); return GetAdjustNewLinesOperationSlow(previousToken, currentToken, options, ref nextOperationCopy);
...@@ -57,7 +57,7 @@ public override sealed AdjustNewLinesOperation GetAdjustNewLinesOperation(Syntax ...@@ -57,7 +57,7 @@ public override sealed AdjustNewLinesOperation GetAdjustNewLinesOperation(Syntax
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed AdjustSpacesOperation GetAdjustSpacesOperation(SyntaxToken previousToken, SyntaxToken currentToken, AnalyzerConfigOptions options, in NextGetAdjustSpacesOperation nextOperation) public sealed override AdjustSpacesOperation GetAdjustSpacesOperation(SyntaxToken previousToken, SyntaxToken currentToken, AnalyzerConfigOptions options, in NextGetAdjustSpacesOperation nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
return GetAdjustSpacesOperationSlow(previousToken, currentToken, options, ref nextOperationCopy); return GetAdjustSpacesOperationSlow(previousToken, currentToken, options, ref nextOperationCopy);
......
...@@ -43,7 +43,7 @@ public override object GetOptions(CancellationToken cancellationToken) ...@@ -43,7 +43,7 @@ public override object GetOptions(CancellationToken cancellationToken)
return pullMemberUpOptionService.GetPullMemberUpOptions(_document, _selectedMember); return pullMemberUpOptionService.GetPullMemberUpOptions(_document, _selectedMember);
} }
protected async override Task<IEnumerable<CodeActionOperation>> ComputeOperationsAsync(object options, CancellationToken cancellationToken) protected override async Task<IEnumerable<CodeActionOperation>> ComputeOperationsAsync(object options, CancellationToken cancellationToken)
{ {
if (options is PullMembersUpOptions pullMemberUpOptions) if (options is PullMembersUpOptions pullMemberUpOptions)
{ {
......
...@@ -146,7 +146,7 @@ private SyntaxTrivia GetTrivia(SyntaxToken token, int triviaIndex) ...@@ -146,7 +146,7 @@ private SyntaxTrivia GetTrivia(SyntaxToken token, int triviaIndex)
public override SyntaxNode GetSyntax(CancellationToken cancellationToken) public override SyntaxNode GetSyntax(CancellationToken cancellationToken)
=> this.GetNode(_tree.GetRoot(cancellationToken)); => this.GetNode(_tree.GetRoot(cancellationToken));
public async override Task<SyntaxNode> GetSyntaxAsync(CancellationToken cancellationToken = default) public override async Task<SyntaxNode> GetSyntaxAsync(CancellationToken cancellationToken = default)
{ {
var root = await _tree.GetRootAsync(cancellationToken).ConfigureAwait(false); var root = await _tree.GetRootAsync(cancellationToken).ConfigureAwait(false);
return this.GetNode(root); return this.GetNode(root);
......
...@@ -57,7 +57,7 @@ public override SyntaxNode GetSyntax(CancellationToken cancellationToken) ...@@ -57,7 +57,7 @@ public override SyntaxNode GetSyntax(CancellationToken cancellationToken)
return this.GetNode(_tree.GetRoot(cancellationToken)); return this.GetNode(_tree.GetRoot(cancellationToken));
} }
public async override Task<SyntaxNode> GetSyntaxAsync(CancellationToken cancellationToken = default) public override async Task<SyntaxNode> GetSyntaxAsync(CancellationToken cancellationToken = default)
{ {
var root = await _tree.GetRootAsync(cancellationToken).ConfigureAwait(false); var root = await _tree.GetRootAsync(cancellationToken).ConfigureAwait(false);
return this.GetNode(root); return this.GetNode(root);
......
...@@ -142,7 +142,7 @@ protected virtual Task<IEnumerable<CodeActionOperation>> ComputePreviewOperation ...@@ -142,7 +142,7 @@ protected virtual Task<IEnumerable<CodeActionOperation>> ComputePreviewOperation
/// Computes all changes for an entire solution. /// Computes all changes for an entire solution.
/// Override this method if you want to implement a <see cref="CodeAction"/> subclass that changes more than one document. /// Override this method if you want to implement a <see cref="CodeAction"/> subclass that changes more than one document.
/// </summary> /// </summary>
protected async virtual Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken) protected virtual async Task<Solution?> GetChangedSolutionAsync(CancellationToken cancellationToken)
{ {
var changedDocument = await GetChangedDocumentAsync(cancellationToken).ConfigureAwait(false); var changedDocument = await GetChangedDocumentAsync(cancellationToken).ConfigureAwait(false);
if (changedDocument == null) if (changedDocument == null)
......
...@@ -104,7 +104,7 @@ public override async Task<CodeAction> GetFixAsync(FixAllContext fixAllContext) ...@@ -104,7 +104,7 @@ public override async Task<CodeAction> GetFixAsync(FixAllContext fixAllContext)
return fixesBag.ToImmutableArray(); return fixesBag.ToImmutableArray();
} }
protected async virtual Task AddDocumentFixesAsync( protected virtual async Task AddDocumentFixesAsync(
Document document, ImmutableArray<Diagnostic> diagnostics, Document document, ImmutableArray<Diagnostic> diagnostics,
ConcurrentBag<(Diagnostic diagnostic, CodeAction action)> fixes, ConcurrentBag<(Diagnostic diagnostic, CodeAction action)> fixes,
FixAllState fixAllState, CancellationToken cancellationToken) FixAllState fixAllState, CancellationToken cancellationToken)
......
...@@ -26,7 +26,7 @@ internal partial class AssetStorages ...@@ -26,7 +26,7 @@ internal partial class AssetStorages
public sealed class Storage public sealed class Storage
{ {
// cache to remove lambda allocation // cache to remove lambda allocation
private readonly static Func<ConcurrentDictionary<Checksum, CustomAsset>> s_additionalAssetsCreator = () => new ConcurrentDictionary<Checksum, CustomAsset>(concurrencyLevel: 2, capacity: 10); private static readonly Func<ConcurrentDictionary<Checksum, CustomAsset>> s_additionalAssetsCreator = () => new ConcurrentDictionary<Checksum, CustomAsset>(concurrencyLevel: 2, capacity: 10);
private readonly ISerializerService _serializer; private readonly ISerializerService _serializer;
......
...@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api ...@@ -10,7 +10,7 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.Api
{ {
internal static class UnitTestingWorkspaceExtensions internal static class UnitTestingWorkspaceExtensions
{ {
public async static Task<UnitTestingRemoteHostClientWrapper> TryGetUnitTestingRemoteHostClientWrapperAsync(this Workspace workspace, CancellationToken cancellationToken) public static async Task<UnitTestingRemoteHostClientWrapper> TryGetUnitTestingRemoteHostClientWrapperAsync(this Workspace workspace, CancellationToken cancellationToken)
{ {
var client = await RemoteHostClient.TryGetClientAsync(workspace, cancellationToken).ConfigureAwait(false); var client = await RemoteHostClient.TryGetClientAsync(workspace, cancellationToken).ConfigureAwait(false);
return new UnitTestingRemoteHostClientWrapper(client); return new UnitTestingRemoteHostClientWrapper(client);
......
...@@ -18,7 +18,7 @@ internal abstract class AbstractDeclaredSymbolInfoFactoryService : IDeclaredSymb ...@@ -18,7 +18,7 @@ internal abstract class AbstractDeclaredSymbolInfoFactoryService : IDeclaredSymb
private const string GenericTypeNameManglingString = "`"; private const string GenericTypeNameManglingString = "`";
private static readonly string[] s_aritySuffixesOneToNine = { "`1", "`2", "`3", "`4", "`5", "`6", "`7", "`8", "`9" }; private static readonly string[] s_aritySuffixesOneToNine = { "`1", "`2", "`3", "`4", "`5", "`6", "`7", "`8", "`9" };
private readonly static ObjectPool<List<Dictionary<string, string>>> s_aliasMapListPool private static readonly ObjectPool<List<Dictionary<string, string>>> s_aliasMapListPool
= SharedPools.Default<List<Dictionary<string, string>>>(); = SharedPools.Default<List<Dictionary<string, string>>>();
// Note: these names are stored case insensitively. That way the alias mapping works // Note: these names are stored case insensitively. That way the alias mapping works
...@@ -26,7 +26,7 @@ internal abstract class AbstractDeclaredSymbolInfoFactoryService : IDeclaredSymb ...@@ -26,7 +26,7 @@ internal abstract class AbstractDeclaredSymbolInfoFactoryService : IDeclaredSymb
// for C#. However, that's ok. It will be rare in practice, and all it means is that // for C#. However, that's ok. It will be rare in practice, and all it means is that
// we'll end up examining slightly more types (likely 0) when doing operations like // we'll end up examining slightly more types (likely 0) when doing operations like
// Find all references. // Find all references.
private readonly static ObjectPool<Dictionary<string, string>> s_aliasMapPool private static readonly ObjectPool<Dictionary<string, string>> s_aliasMapPool
= SharedPools.StringIgnoreCaseDictionary<string>(); = SharedPools.StringIgnoreCaseDictionary<string>();
protected static List<Dictionary<string, string>> AllocateAliasMapList() protected static List<Dictionary<string, string>> AllocateAliasMapList()
......
...@@ -61,7 +61,7 @@ public int CompareTo(PatternMatch other) ...@@ -61,7 +61,7 @@ public int CompareTo(PatternMatch other)
public int CompareTo(PatternMatch other, bool ignoreCase) public int CompareTo(PatternMatch other, bool ignoreCase)
=> ComparerWithState.CompareTo(this, other, ignoreCase, s_comparers); => ComparerWithState.CompareTo(this, other, ignoreCase, s_comparers);
private readonly static ImmutableArray<Func<PatternMatch, bool, IComparable>> s_comparers = private static readonly ImmutableArray<Func<PatternMatch, bool, IComparable>> s_comparers =
ImmutableArray.Create<Func<PatternMatch, bool, IComparable>>( ImmutableArray.Create<Func<PatternMatch, bool, IComparable>>(
// Compare types // Compare types
(p, b) => p.Kind, (p, b) => p.Kind,
......
...@@ -116,7 +116,7 @@ public int CompareTo(PackageWithAssemblyResult? other) ...@@ -116,7 +116,7 @@ public int CompareTo(PackageWithAssemblyResult? other)
return ComparerWithState.CompareTo(this, other, s_comparers); return ComparerWithState.CompareTo(this, other, s_comparers);
} }
private readonly static ImmutableArray<Func<PackageWithAssemblyResult, IComparable>> s_comparers = private static readonly ImmutableArray<Func<PackageWithAssemblyResult, IComparable>> s_comparers =
ImmutableArray.Create<Func<PackageWithAssemblyResult, IComparable>>(p => p.Rank, p => p.PackageName); ImmutableArray.Create<Func<PackageWithAssemblyResult, IComparable>>(p => p.Rank, p => p.PackageName);
} }
......
...@@ -178,7 +178,7 @@ public void Dispose() ...@@ -178,7 +178,7 @@ public void Dispose()
_memoryMappedFile.Dispose(); _memoryMappedFile.Dispose();
} }
private unsafe sealed class SharedReadableStream : Stream, ISupportDirectMemoryAccess private sealed unsafe class SharedReadableStream : Stream, ISupportDirectMemoryAccess
{ {
private readonly ReferenceCountedDisposable<MemoryMappedViewAccessor> _accessor; private readonly ReferenceCountedDisposable<MemoryMappedViewAccessor> _accessor;
......
...@@ -15,7 +15,7 @@ namespace Microsoft.CodeAnalysis.Host ...@@ -15,7 +15,7 @@ namespace Microsoft.CodeAnalysis.Host
[ExportWorkspaceService(typeof(IWorkspaceStatusService), ServiceLayer.Default), Shared] [ExportWorkspaceService(typeof(IWorkspaceStatusService), ServiceLayer.Default), Shared]
internal sealed class WorkspaceStatusService : IWorkspaceStatusService internal sealed class WorkspaceStatusService : IWorkspaceStatusService
{ {
public readonly static WorkspaceStatusService Default = new WorkspaceStatusService(); public static readonly WorkspaceStatusService Default = new WorkspaceStatusService();
[ImportingConstructor] [ImportingConstructor]
[SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification = "Incorrectly used in production code: https://github.com/dotnet/roslyn/issues/42839")] [SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification = "Incorrectly used in production code: https://github.com/dotnet/roslyn/issues/42839")]
......
...@@ -6,7 +6,7 @@ namespace Microsoft.CodeAnalysis ...@@ -6,7 +6,7 @@ namespace Microsoft.CodeAnalysis
{ {
internal sealed class WorkspaceDiagnosticDescriptors internal sealed class WorkspaceDiagnosticDescriptors
{ {
internal readonly static DiagnosticDescriptor ErrorReadingFileContent; internal static readonly DiagnosticDescriptor ErrorReadingFileContent;
internal const string ErrorReadingFileContentId = "IDE1100"; internal const string ErrorReadingFileContentId = "IDE1100";
......
...@@ -42,8 +42,8 @@ private static string LoadText(string name) ...@@ -42,8 +42,8 @@ private static string LoadText(string name)
} }
} }
private readonly static Func<string, byte[]> s_bytesLoader = LoadBytes; private static readonly Func<string, byte[]> s_bytesLoader = LoadBytes;
private readonly static Func<string, string> s_textLoader = LoadText; private static readonly Func<string, string> s_textLoader = LoadText;
private static Dictionary<string, byte[]> s_bytesCache; private static Dictionary<string, byte[]> s_bytesCache;
private static Dictionary<string, string> s_textCache; private static Dictionary<string, string> s_textCache;
......
...@@ -30,8 +30,8 @@ internal sealed class SolutionService ...@@ -30,8 +30,8 @@ internal sealed class SolutionService
private static readonly SemaphoreSlim s_gate = new SemaphoreSlim(initialCount: 1); private static readonly SemaphoreSlim s_gate = new SemaphoreSlim(initialCount: 1);
// this simple cache hold onto the last and primary solution created // this simple cache hold onto the last and primary solution created
private volatile static Tuple<Checksum, Solution>? s_primarySolution; private static volatile Tuple<Checksum, Solution>? s_primarySolution;
private volatile static Tuple<Checksum, Solution>? s_lastSolution; private static volatile Tuple<Checksum, Solution>? s_lastSolution;
public AssetProvider AssetProvider { get; } public AssetProvider AssetProvider { get; }
......
...@@ -37,7 +37,7 @@ namespace Microsoft.CodeAnalysis.Remote ...@@ -37,7 +37,7 @@ namespace Microsoft.CodeAnalysis.Remote
/// </summary> /// </summary>
internal partial class RemoteHostService : ServiceBase, IRemoteHostService internal partial class RemoteHostService : ServiceBase, IRemoteHostService
{ {
private readonly static TimeSpan s_reportInterval = TimeSpan.FromMinutes(2); private static readonly TimeSpan s_reportInterval = TimeSpan.FromMinutes(2);
private readonly CancellationTokenSource _shutdownCancellationSource; private readonly CancellationTokenSource _shutdownCancellationSource;
// it is saved here more on debugging purpose. // it is saved here more on debugging purpose.
......
...@@ -16,7 +16,7 @@ internal abstract class CompatAbstractFormattingRule : AbstractFormattingRule ...@@ -16,7 +16,7 @@ internal abstract class CompatAbstractFormattingRule : AbstractFormattingRule
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member #pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextSuppressOperationAction nextOperation) public sealed override void AddSuppressOperations(List<SuppressOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextSuppressOperationAction nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
AddSuppressOperationsSlow(list, node, options, ref nextOperationCopy); AddSuppressOperationsSlow(list, node, options, ref nextOperationCopy);
...@@ -24,7 +24,7 @@ public override sealed void AddSuppressOperations(List<SuppressOperation> list, ...@@ -24,7 +24,7 @@ public override sealed void AddSuppressOperations(List<SuppressOperation> list,
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextAnchorIndentationOperationAction nextOperation) public sealed override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextAnchorIndentationOperationAction nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
AddAnchorIndentationOperationsSlow(list, node, options, ref nextOperationCopy); AddAnchorIndentationOperationsSlow(list, node, options, ref nextOperationCopy);
...@@ -32,7 +32,7 @@ public override sealed void AddAnchorIndentationOperations(List<AnchorIndentatio ...@@ -32,7 +32,7 @@ public override sealed void AddAnchorIndentationOperations(List<AnchorIndentatio
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextIndentBlockOperationAction nextOperation) public sealed override void AddIndentBlockOperations(List<IndentBlockOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextIndentBlockOperationAction nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
AddIndentBlockOperationsSlow(list, node, options, ref nextOperationCopy); AddIndentBlockOperationsSlow(list, node, options, ref nextOperationCopy);
...@@ -40,7 +40,7 @@ public override sealed void AddIndentBlockOperations(List<IndentBlockOperation> ...@@ -40,7 +40,7 @@ public override sealed void AddIndentBlockOperations(List<IndentBlockOperation>
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextAlignTokensOperationAction nextOperation) public sealed override void AddAlignTokensOperations(List<AlignTokensOperation> list, SyntaxNode node, AnalyzerConfigOptions options, in NextAlignTokensOperationAction nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
AddAlignTokensOperationsSlow(list, node, options, ref nextOperationCopy); AddAlignTokensOperationsSlow(list, node, options, ref nextOperationCopy);
...@@ -48,7 +48,7 @@ public override sealed void AddAlignTokensOperations(List<AlignTokensOperation> ...@@ -48,7 +48,7 @@ public override sealed void AddAlignTokensOperations(List<AlignTokensOperation>
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed AdjustNewLinesOperation? GetAdjustNewLinesOperation(SyntaxToken previousToken, SyntaxToken currentToken, AnalyzerConfigOptions options, in NextGetAdjustNewLinesOperation nextOperation) public sealed override AdjustNewLinesOperation? GetAdjustNewLinesOperation(SyntaxToken previousToken, SyntaxToken currentToken, AnalyzerConfigOptions options, in NextGetAdjustNewLinesOperation nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
return GetAdjustNewLinesOperationSlow(previousToken, currentToken, options, ref nextOperationCopy); return GetAdjustNewLinesOperationSlow(previousToken, currentToken, options, ref nextOperationCopy);
...@@ -56,7 +56,7 @@ public override sealed void AddAlignTokensOperations(List<AlignTokensOperation> ...@@ -56,7 +56,7 @@ public override sealed void AddAlignTokensOperations(List<AlignTokensOperation>
[Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)] [Obsolete("Do not call this method directly (it will Stack Overflow).", error: true)]
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public override sealed AdjustSpacesOperation? GetAdjustSpacesOperation(SyntaxToken previousToken, SyntaxToken currentToken, AnalyzerConfigOptions options, in NextGetAdjustSpacesOperation nextOperation) public sealed override AdjustSpacesOperation? GetAdjustSpacesOperation(SyntaxToken previousToken, SyntaxToken currentToken, AnalyzerConfigOptions options, in NextGetAdjustSpacesOperation nextOperation)
{ {
var nextOperationCopy = nextOperation; var nextOperationCopy = nextOperation;
return GetAdjustSpacesOperationSlow(previousToken, currentToken, options, ref nextOperationCopy); return GetAdjustSpacesOperationSlow(previousToken, currentToken, options, ref nextOperationCopy);
......
...@@ -24,7 +24,7 @@ namespace Microsoft.CodeAnalysis.LanguageServices ...@@ -24,7 +24,7 @@ namespace Microsoft.CodeAnalysis.LanguageServices
{ {
internal abstract class AbstractSyntaxFacts internal abstract class AbstractSyntaxFacts
{ {
private readonly static ObjectPool<Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)>> s_stackPool private static readonly ObjectPool<Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)>> s_stackPool
= SharedPools.Default<Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)>>(); = SharedPools.Default<Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)>>();
public abstract ISyntaxKinds SyntaxKinds { get; } public abstract ISyntaxKinds SyntaxKinds { get; }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
namespace Roslyn.Utilities namespace Roslyn.Utilities
{ {
static internal class ComparerWithState internal static class ComparerWithState
{ {
public static int CompareTo<T, S>(T first, T second, S state, ImmutableArray<Func<T, S, IComparable>> comparableMethods) public static int CompareTo<T, S>(T first, T second, S state, ImmutableArray<Func<T, S, IComparable>> comparableMethods)
{ {
......
...@@ -30,7 +30,7 @@ internal static PooledStream CreateReadableStream(byte[] bytes, int length) ...@@ -30,7 +30,7 @@ internal static PooledStream CreateReadableStream(byte[] bytes, int length)
return stream; return stream;
} }
internal async static Task<PooledStream> CreateReadableStreamAsync(Stream stream, CancellationToken cancellationToken) internal static async Task<PooledStream> CreateReadableStreamAsync(Stream stream, CancellationToken cancellationToken)
{ {
var length = stream.Length; var length = stream.Length;
......
...@@ -24,7 +24,7 @@ public ILanguageService CreateLanguageService(HostLanguageServices languageServi ...@@ -24,7 +24,7 @@ public ILanguageService CreateLanguageService(HostLanguageServices languageServi
private sealed class CSharpVirtualCharLanguageService : CSharpVirtualCharService, IVirtualCharLanguageService private sealed class CSharpVirtualCharLanguageService : CSharpVirtualCharService, IVirtualCharLanguageService
{ {
internal static readonly new CSharpVirtualCharLanguageService Instance = new CSharpVirtualCharLanguageService(); internal static new readonly CSharpVirtualCharLanguageService Instance = new CSharpVirtualCharLanguageService();
private CSharpVirtualCharLanguageService() private CSharpVirtualCharLanguageService()
{ {
......
...@@ -273,7 +273,7 @@ public static CSharpSyntaxContext CreateContext_Test(SemanticModel semanticModel ...@@ -273,7 +273,7 @@ public static CSharpSyntaxContext CreateContext_Test(SemanticModel semanticModel
return CreateContextWorker(workspace: null, semanticModel: semanticModel, position: position, cancellationToken: cancellationToken); return CreateContextWorker(workspace: null, semanticModel: semanticModel, position: position, cancellationToken: cancellationToken);
} }
private new static bool IsWithinAsyncMethod() private static new bool IsWithinAsyncMethod()
{ {
// TODO: Implement this if any C# completion code needs to know if it is in an async // TODO: Implement this if any C# completion code needs to know if it is in an async
// method or not. // method or not.
......
...@@ -21,7 +21,7 @@ internal sealed partial class CSharpSyntaxFactsServiceFactory ...@@ -21,7 +21,7 @@ internal sealed partial class CSharpSyntaxFactsServiceFactory
{ {
private sealed class CSharpSyntaxFactsService : CSharpSyntaxFacts, ISyntaxFactsService private sealed class CSharpSyntaxFactsService : CSharpSyntaxFacts, ISyntaxFactsService
{ {
internal static readonly new CSharpSyntaxFactsService Instance = new CSharpSyntaxFactsService(); internal static new readonly CSharpSyntaxFactsService Instance = new CSharpSyntaxFactsService();
public bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken) public bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
{ {
......
...@@ -24,7 +24,7 @@ public ILanguageService CreateLanguageService(HostLanguageServices languageServi ...@@ -24,7 +24,7 @@ public ILanguageService CreateLanguageService(HostLanguageServices languageServi
private sealed class CSharpSyntaxKindsService : CSharpSyntaxKinds, ISyntaxKindsService private sealed class CSharpSyntaxKindsService : CSharpSyntaxKinds, ISyntaxKindsService
{ {
public static readonly new CSharpSyntaxKindsService Instance = new CSharpSyntaxKindsService(); public static new readonly CSharpSyntaxKindsService Instance = new CSharpSyntaxKindsService();
} }
} }
} }
...@@ -178,7 +178,7 @@ public static bool IsGeneratedCode(this Document document, CancellationToken can ...@@ -178,7 +178,7 @@ public static bool IsGeneratedCode(this Document document, CancellationToken can
} }
#endif #endif
public async static Task<bool> IsGeneratedCodeAsync(this Document document, CancellationToken cancellationToken) public static async Task<bool> IsGeneratedCodeAsync(this Document document, CancellationToken cancellationToken)
{ {
var generatedCodeRecognitionService = document.GetLanguageService<IGeneratedCodeRecognitionService>(); var generatedCodeRecognitionService = document.GetLanguageService<IGeneratedCodeRecognitionService>();
return generatedCodeRecognitionService != null && return generatedCodeRecognitionService != null &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册