Skip to content

Commit

Permalink
Merge pull request #5387 from dotnet/merges/release/6.0.1xx-rc1-to-re…
Browse files Browse the repository at this point in the history
…lease/6.0.1xx

Merge release/6.0.1xx-rc1 to release/6.0.1xx
  • Loading branch information
dotnet-bot authored Aug 18, 2021
2 parents f7d92f5 + 9290e5a commit d797f2a
Show file tree
Hide file tree
Showing 30 changed files with 3,448 additions and 1,037 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.

using System.Collections.Generic;
using System.Composition;
Expand All @@ -25,7 +25,7 @@ public sealed class CSharpDynamicInterfaceCastableImplementationFixer : DynamicI
private const SyntaxKind InitKeyword = (SyntaxKind)8443;
private const SyntaxKind InitAccessorDeclaration = (SyntaxKind)9060;

protected override async Task<Document> ImplementInterfacesOnDynamicCastableImplementation(
protected override async Task<Document> ImplementInterfacesOnDynamicCastableImplementationAsync(
SyntaxNode declaration,
Document document,
CancellationToken cancellationToken)
Expand Down Expand Up @@ -175,7 +175,7 @@ private static SyntaxNode GenerateEventImplementation(
})));
}

protected override async Task<Document> MakeMemberDeclaredOnImplementationTypeStatic(SyntaxNode declaration, Document document, CancellationToken cancellationToken)
protected override async Task<Document> MakeMemberDeclaredOnImplementationTypeStaticAsync(SyntaxNode declaration, Document document, CancellationToken cancellationToken)
{
var root = (await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false))!;
var editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.

using System.Collections.Immutable;
using System.Threading;
Expand Down Expand Up @@ -42,7 +42,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(
CodeAction.Create(
MicrosoftNetCoreAnalyzersResources.ImplementInterfacesOnDynamicCastableImplementation,
async ct => await ImplementInterfacesOnDynamicCastableImplementation(declaration, context.Document, context.CancellationToken).ConfigureAwait(false),
async ct => await ImplementInterfacesOnDynamicCastableImplementationAsync(declaration, context.Document, context.CancellationToken).ConfigureAwait(false),
equivalenceKey: nameof(MicrosoftNetCoreAnalyzersResources.ImplementInterfacesOnDynamicCastableImplementation)),
diagnostic);
}
Expand All @@ -52,7 +52,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context)
context.RegisterCodeFix(
CodeAction.Create(
MicrosoftNetCoreAnalyzersResources.MakeMethodDeclaredOnImplementationTypeStatic,
async ct => await MakeMemberDeclaredOnImplementationTypeStatic(declaration, context.Document, context.CancellationToken).ConfigureAwait(false),
async ct => await MakeMemberDeclaredOnImplementationTypeStaticAsync(declaration, context.Document, context.CancellationToken).ConfigureAwait(false),
equivalenceKey: nameof(MicrosoftNetCoreAnalyzersResources.MakeMethodDeclaredOnImplementationTypeStatic)),
diagnostic);
}
Expand All @@ -66,12 +66,12 @@ protected static SyntaxAnnotation CreatePossibleInvalidCodeWarning()

protected abstract bool CodeFixSupportsDeclaration(SyntaxNode declaration);

protected abstract Task<Document> ImplementInterfacesOnDynamicCastableImplementation(
protected abstract Task<Document> ImplementInterfacesOnDynamicCastableImplementationAsync(
SyntaxNode declaration,
Document document,
CancellationToken cancellationToken);

protected abstract Task<Document> MakeMemberDeclaredOnImplementationTypeStatic(
protected abstract Task<Document> MakeMemberDeclaredOnImplementationTypeStaticAsync(
SyntaxNode declaration,
Document document,
CancellationToken cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.

using System.Collections.Immutable;
using Analyzer.Utilities;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1725,15 +1725,36 @@
<data name="DetectPreviewFeaturesTitle" xml:space="preserve">
<value>This API requires opting into preview features</value>
</data>
<data name="ImplementsEmptyPreviewInterfaceMessage" xml:space="preserve">
<value>'{0}' implements a preview interface. See https://aka.ms/dotnet-warnings/preview-features for more information.</value>
</data>
<data name="StaticAndAbstractRequiresPreviewFeatures" xml:space="preserve">
<value>Using both 'static' and 'abstract' modifiers requires opting into preview features. See https://aka.ms/dotnet-warnings/preview-features for more information.</value>
</data>
<data name="MakeMethodDeclaredOnImplementationTypeStaticMayProduceInvalidCode" xml:space="preserve">
<value>Converting an instance method to a static method may produce invalid code</value>
</data>
<data name="DerivesFromPreviewClassMessage" xml:space="preserve">
<value>'{0}' derives from preview class '{1}' and therefore needs to opt into preview features. See https://aka.ms/dotnet-warnings/preview-features for more information.</value>
</data>
<data name="ImplementsPreviewInterfaceMessage" xml:space="preserve">
<value>'{0}' implements the preview interface '{1}' and therefore needs to opt into preview features. See https://aka.ms/dotnet-warnings/preview-features for more information.</value>
</data>
<data name="ImplementsPreviewMethodMessage" xml:space="preserve">
<value>'{0}' implements the preview method '{1}' and therefore needs to opt into preview features. See https://aka.ms/dotnet-warnings/preview-features for more information.</value>
</data>
<data name="MethodReturnsPreviewTypeMessage" xml:space="preserve">
<value>'{0}' returns the preview type '{1}' and therefore needs to opt into preview features. See https://aka.ms/dotnet-warnings/preview-features for more information.</value>
</data>
<data name="MethodUsesPreviewTypeAsParamaterMessage" xml:space="preserve">
<value>'{0}' takes in a preview parameter of type '{1}' and needs to opt into preview features. See https://aka.ms/dotnet-warnings/preview-features for more information.</value>
</data>
<data name="OverridesPreviewMethodMessage" xml:space="preserve">
<value>'{0}' overrides the preview method '{1}' and therefore needs to opt into preview features. See https://aka.ms/dotnet-warnings/preview-features for more information.</value>
</data>
<data name="UsesPreviewTypeParameterMessage" xml:space="preserve">
<value>'{0}' uses the preview type '{1}' and needs to opt into preview features. See https://aka.ms/dotnet-warnings/preview-features for more information.</value>
</data>
<data name="FieldIsPreviewTypeMessage" xml:space="preserve">
<value>'{0}''s type contains the preview type '{1}' and requires opting into preview features. See https://aka.ms/dotnet-warnings/preview-features for more information.</value>
</data>
<data name="ModuleInitializerAttributeShouldNotBeUsedInLibrariesDescription" xml:space="preserve">
<value>Module initializers are intended to be used by application code to ensure an application's components are initialized before the application code begins executing. If library code declares a 'ModuleInitializer' method, it can interfere with application initialization and also lead to limitations in that application's trimming abilities. Library code should therefore not utilize the 'ModuleInitializer' attribute, but instead expose methods that can be used to initialize any components within the library and allow the application to invoke the method during application initialization.</value>
</data>
Expand Down
Loading

0 comments on commit d797f2a

Please sign in to comment.