Skip to content

Commit d5af95c

Browse files
m3naxWhitWaldophilliphoffshivamkm07hhunter-ms
authored andcommitted
Incremental source generator for actors (dapr#1334)
* Samples - Add k8s deployment yaml to DemoActor sample (dapr#1308) * up Signed-off-by: Manuel Menegazzo <[email protected]> * Fixed build Signed-off-by: Manuel Menegazzo <[email protected]> * Added scripts for image build Signed-off-by: Manuel Menegazzo <[email protected]> * Added readme Build and push Docker image Signed-off-by: Manuel Menegazzo <[email protected]> * Added demo-actor.yaml Signed-off-by: Manuel Menegazzo <[email protected]> * Fixed typo Signed-off-by: Manuel Menegazzo <[email protected]> * Updated guide, fixed invocation throw curl Signed-off-by: Manuel Menegazzo <[email protected]> * Removed dockerfile, updated readme, removed ps1 and sh scripts Signed-off-by: Manuel Menegazzo <[email protected]> * Updated base image Signed-off-by: Manuel Menegazzo <[email protected]> Signed-off-by: Manuel Menegazzo <[email protected]> * Update demo-actor.yaml Signed-off-by: Manuel Menegazzo <[email protected]> Signed-off-by: Manuel Menegazzo <[email protected]> * Added overload for DaprClient DI registration (dapr#1289) * Added overload for DaprClient DI registration allowing the consumer to easily use values from injected services (e.g. IConfiguration). Signed-off-by: Whit Waldo <[email protected]> * Added supporting unit test Signed-off-by: Whit Waldo <[email protected]> --------- Signed-off-by: Whit Waldo <[email protected]> Co-authored-by: Phillip Hoff <[email protected]> Signed-off-by: Manuel Menegazzo <[email protected]> * Merge `release-1.13` back into `master` (dapr#1285) * Update protos and related use for Dapr 1.13. (dapr#1236) * Update protos and related use. Signed-off-by: Phillip Hoff <[email protected]> * Update Dapr runtime version. Signed-off-by: Phillip Hoff <[email protected]> * Init properties. Signed-off-by: Phillip Hoff <[email protected]> --------- Signed-off-by: Phillip Hoff <[email protected]> * Update artifact action versions. (dapr#1240) Signed-off-by: Phillip Hoff <[email protected]> * Make recursive true as default (dapr#1243) Signed-off-by: Shivam Kumar <[email protected]> * Fix for secret key transformation in multi-value scenarios (dapr#1274) * Add repro test. Signed-off-by: Phillip Hoff <[email protected]> * Fix for secret key transformation in multi-value scenarios. Signed-off-by: Phillip Hoff <[email protected]> --------- Signed-off-by: Phillip Hoff <[email protected]> * Update Dapr version numbers used during testing. Signed-off-by: Phillip Hoff <[email protected]> --------- Signed-off-by: Phillip Hoff <[email protected]> Signed-off-by: Shivam Kumar <[email protected]> Co-authored-by: Shivam Kumar <[email protected]> Signed-off-by: Manuel Menegazzo <[email protected]> --------- Signed-off-by: Manuel Menegazzo <[email protected]> Signed-off-by: Manuel Menegazzo <[email protected]> Signed-off-by: Whit Waldo <[email protected]> Signed-off-by: Phillip Hoff <[email protected]> Signed-off-by: Shivam Kumar <[email protected]> Co-authored-by: Whit Waldo <[email protected]> Co-authored-by: Phillip Hoff <[email protected]> Co-authored-by: Shivam Kumar <[email protected]> Signed-off-by: Manuel Menegazzo <[email protected]> * Aligned nuget version Signed-off-by: Manuel Menegazzo <[email protected]> * UP Signed-off-by: Manuel Menegazzo <[email protected]> * UP Signed-off-by: Manuel Menegazzo <[email protected]> * Debug profile added Signed-off-by: Manuel Menegazzo <[email protected]> * Updated implementation Signed-off-by: Manuel Menegazzo <[email protected]> * Emitted DAPR001 Diagnostic warning Signed-off-by: Manuel Menegazzo <[email protected]> * Added DAPR002 diagnostic Signed-off-by: Manuel Menegazzo <[email protected]> * Cleaun Signed-off-by: Manuel Menegazzo <[email protected]> * UP Signed-off-by: Manuel Menegazzo <[email protected]> * Added summaries Signed-off-by: Manuel Menegazzo <[email protected]> * Added base interface to ActorClient Signed-off-by: Manuel Menegazzo <[email protected]> * Updated Signed-off-by: Manuel Menegazzo <[email protected]> * Added ctor Signed-off-by: Manuel Menegazzo <[email protected]> * Added nullable directive Signed-off-by: Manuel Menegazzo <[email protected]> * Added null check for actorproxy ctor parameter Signed-off-by: Manuel Menegazzo <[email protected]> * Moved DiagnoticException in a dedicate cs file Signed-off-by: Manuel Menegazzo <[email protected]> * Moved generator costants to dedicated class Signed-off-by: Manuel Menegazzo <[email protected]> * Added ActorReference creation from the ActorBase class informations (dapr#1277) * Handled creation of ActorReference from Actor base class Signed-off-by: Manuel Menegazzo <[email protected]> * Updated null check Signed-off-by: Manuel Menegazzo <[email protected]> * Added unit test for GetActorReference from null actore and actor proxy Signed-off-by: Manuel Menegazzo <[email protected]> * Added test for ActorReference created inside Actor implementation Signed-off-by: Manuel Menegazzo <[email protected]> * Updated description Signed-off-by: Manuel Menegazzo <[email protected]> * Fixed test method naming Signed-off-by: Manuel Menegazzo <[email protected]> * Added unit test for exception generated in case the type is not convertible to an ActorReference Signed-off-by: Manuel Menegazzo <[email protected]> --------- Signed-off-by: Manuel Menegazzo <[email protected]> * Added overload to support SDK supplying query string on invoked URL (dapr#1310) * Refactored extensions and their tests into separate directories Signed-off-by: Whit Waldo <[email protected]> * Added overload to method invocation to allow query string parameters to be passed in via the SDK instead of being uncermoniously added to the end of the produced HttpRequestMessage URI Signed-off-by: Whit Waldo <[email protected]> * Added unit tests to support implementation Signed-off-by: Whit Waldo <[email protected]> * Marking HttpExtensions as internal to prevent external usage and updating to work against Uri instead of HttpRequestMessage. Signed-off-by: Whit Waldo <[email protected]> * Updated unit tests to match new extension purpose Signed-off-by: Whit Waldo <[email protected]> * Resolved an ambiguous method invocation wherein it was taking the query string and passing it as the payload for a request. Removed the offending method and reworked the remaining configurations so there's no API impact. Signed-off-by: Whit Waldo <[email protected]> --------- Signed-off-by: Whit Waldo <[email protected]> Signed-off-by: Manuel Menegazzo <[email protected]> * Fixed actorProxy argument null check Signed-off-by: Manuel Menegazzo <[email protected]> * Moved ActorClientDesciptor into separta cs file Signed-off-by: Manuel Menegazzo <[email protected]> * Moved textual templates to dedicated class Signed-off-by: Manuel Menegazzo <[email protected]> * Updated comments, property names Signed-off-by: Manuel Menegazzo <[email protected]> * Added argument null check to SyntaxFactoryHelpers Signed-off-by: Manuel Menegazzo <[email protected]> * Added comments Signed-off-by: Manuel Menegazzo <[email protected]> * Removed obsolete testing packages https://github.com/dotnet/roslyn-sdk/blob/main/src/Microsoft.CodeAnalysis.Testing/README.md#obsolete-packages Signed-off-by: Manuel Menegazzo <[email protected]> * Adapted existing unit test to new source generated code Signed-off-by: Manuel Menegazzo <[email protected]> * Up Signed-off-by: Manuel Menegazzo <[email protected]> * Added tests for SyntaxFactoryHelpers Signed-off-by: Manuel Menegazzo <[email protected]> * Updated generation of ArgumentNullException Signed-off-by: Manuel Menegazzo <[email protected]> * Updated nullability Signed-off-by: Manuel Menegazzo <[email protected]> * Fixed internal methods tests Signed-off-by: Manuel Menegazzo <[email protected]> * Added test to IEnumerableExtensions Signed-off-by: Manuel Menegazzo <[email protected]> * Unittested GetSyntaxKinds from Accessibility Signed-off-by: Manuel Menegazzo <[email protected]> * UP Signed-off-by: Manuel Menegazzo <[email protected]> * Updated assignment implementation of ctor body Signed-off-by: Manuel Menegazzo <[email protected]> * Improved unit test Signed-off-by: Manuel Menegazzo <[email protected]> * Added implementation of method generation Signed-off-by: Manuel Menegazzo <[email protected]> * Fixed ArgumentNullException invocation Signed-off-by: Manuel Menegazzo <[email protected]> * Added test for NameOfExpression Signed-off-by: Manuel Menegazzo <[email protected]> * Fixed ActorProxy method invocation Signed-off-by: Manuel Menegazzo <[email protected]> * Simplified proxy argument definition Signed-off-by: Manuel Menegazzo <[email protected]> * Explicit generic arguments of the proxy call during generation Signed-off-by: Manuel Menegazzo <[email protected]> * Handled cancellation token with default value Signed-off-by: Manuel Menegazzo <[email protected]> * Fixed typo Signed-off-by: Manuel Menegazzo <[email protected]> * Configured eol used in NormalizeWhitespace function Signed-off-by: Manuel Menegazzo <[email protected]> * Normalized expected source Signed-off-by: Manuel Menegazzo <[email protected]> * Moved to constat the ActorProxyTypeName Signed-off-by: Manuel Menegazzo <[email protected]> * Fix typo Signed-off-by: Manuel Menegazzo <[email protected]> * Created ActorProxyInvokeMethodAsync SyntaxFactoryHelper Signed-off-by: Manuel Menegazzo <[email protected]> * Removed custom concat implementation Signed-off-by: Manuel Menegazzo <[email protected]> * fix (dapr#1329) Signed-off-by: Hannah Hunter <[email protected]> Signed-off-by: Manuel Menegazzo <[email protected]> * link to non-dapr endpoint howto (dapr#1335) Signed-off-by: Hannah Hunter <[email protected]> Signed-off-by: Manuel Menegazzo <[email protected]> * Merge 1.14 release branch back into `master`. (dapr#1337) Signed-off-by: Manuel Menegazzo <[email protected]> * Fixed merge errors Signed-off-by: Manuel Menegazzo <[email protected]> Signed-off-by: Manuel Menegazzo <[email protected]> * Updated some summaries Signed-off-by: Manuel Menegazzo <[email protected]> * Added some missing summaries Signed-off-by: Manuel Menegazzo <[email protected]> * Fixed typo Signed-off-by: Manuel Menegazzo <[email protected]> * Improved some summary text Signed-off-by: Manuel Menegazzo <[email protected]> * Improved summaries Signed-off-by: Manuel Menegazzo <[email protected]> * Handled review requests Signed-off-by: Manuel Menegazzo <[email protected]> * Changed SyntaxFactoryHelpers accessor to internal Signed-off-by: Manuel Menegazzo <[email protected]> --------- Signed-off-by: Manuel Menegazzo <[email protected]> Signed-off-by: Manuel Menegazzo <[email protected]> Signed-off-by: Whit Waldo <[email protected]> Signed-off-by: Phillip Hoff <[email protected]> Signed-off-by: Shivam Kumar <[email protected]> Signed-off-by: Hannah Hunter <[email protected]> Co-authored-by: Whit Waldo <[email protected]> Co-authored-by: Phillip Hoff <[email protected]> Co-authored-by: Shivam Kumar <[email protected]> Co-authored-by: Hannah Hunter <[email protected]> Signed-off-by: Siri Varma Vegiraju <[email protected]>
1 parent ed86404 commit d5af95c

21 files changed

+1090
-436
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
2222
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.8.0" />
2323
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
24-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" Version="1.1.2" />
24+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" Version="1.1.2" />
2525
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
2626
<PackageVersion Include="Microsoft.DurableTask.Client.Grpc" Version="1.3.0" />
2727
<PackageVersion Include="Microsoft.DurableTask.Worker.Grpc" Version="1.3.0" />
Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6</TargetFramework>
6-
<LangVersion>10.0</LangVersion>
7-
<ImplicitUsings>enable</ImplicitUsings>
8-
<Nullable>enable</Nullable>
9-
</PropertyGroup>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6</TargetFramework>
6+
<LangVersion>10.0</LangVersion>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
109

11-
<ItemGroup>
12-
<ProjectReference Include="..\ActorCommon\ActorCommon.csproj" />
13-
<ProjectReference Include="..\..\..\src\Dapr.Actors\Dapr.Actors.csproj" />
14-
</ItemGroup>
10+
<!-- Persist the source generator (and other) files to disk -->
11+
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
12+
<!-- 👇 The "base" path for the source generators -->
13+
<!--<GeneratedFolder>Generated</GeneratedFolder>-->
14+
<!-- 👇 Write the output for each target framework to a different sub-folder -->
15+
<!--<CompilerGeneratedFilesOutputPath>$(GeneratedFolder)\$(TargetFramework)</CompilerGeneratedFilesOutputPath>-->
16+
</PropertyGroup>
1517

16-
<ItemGroup>
17-
<ProjectReference Include="..\..\..\src\Dapr.Actors.Generators\Dapr.Actors.Generators.csproj"
18-
OutputItemType="Analyzer"
19-
ReferenceOutputAssembly="false" />
20-
</ItemGroup>
18+
<ItemGroup>
19+
<ProjectReference Include="..\ActorCommon\ActorCommon.csproj" />
20+
<ProjectReference Include="..\..\..\src\Dapr.Actors\Dapr.Actors.csproj" />
21+
</ItemGroup>
22+
23+
<ItemGroup>
24+
<ProjectReference Include="..\..\..\src\Dapr.Actors.Generators\Dapr.Actors.Generators.csproj"
25+
OutputItemType="Analyzer"
26+
ReferenceOutputAssembly="false" />
27+
</ItemGroup>
2128

2229
</Project>

examples/GeneratedActor/ActorClient/IClientActor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ------------------------------------------------------------------------
1+
// ------------------------------------------------------------------------
22
// Copyright 2023 The Dapr Authors
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

src/Dapr.Actors.Generators/ActorClientGenerator.cs

Lines changed: 221 additions & 233 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Release 1.14
2+
3+
### New Rules
4+
5+
Rule ID | Category | Severity | Notes
6+
--------|----------|----------|--------------------
7+
DAPR0001| Usage | Error | Cancellation tokens must be the last argument
8+
DAPR0002| Usage | Error | Only methods with a single argument or a single argument followed by a cancellation token are supported
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
; Unshipped analyzer release
2+
; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md
3+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
namespace Dapr.Actors.Generators
2+
{
3+
/// <summary>
4+
/// Constants used by the code generator.
5+
/// </summary>
6+
internal static class Constants
7+
{
8+
/// <summary>
9+
/// The namespace used by the generated code.
10+
/// </summary>
11+
public const string GeneratorsNamespace = "Dapr.Actors.Generators";
12+
13+
/// <summary>
14+
/// The name of the attribute used to mark actor interfaces.
15+
/// </summary>
16+
public const string ActorMethodAttributeTypeName = "ActorMethodAttribute";
17+
18+
/// <summary>
19+
/// The full type name of the attribute used to mark actor interfaces.
20+
/// </summary>
21+
public const string ActorMethodAttributeFullTypeName = GeneratorsNamespace + "." + ActorMethodAttributeTypeName;
22+
23+
/// <summary>
24+
/// The name of the attribute used to mark actor interfaces.
25+
/// </summary>
26+
public const string GenerateActorClientAttributeTypeName = "GenerateActorClientAttribute";
27+
28+
/// <summary>
29+
/// The full type name of the attribute used to mark actor interfaces.
30+
/// </summary>
31+
public const string GenerateActorClientAttributeFullTypeName = GeneratorsNamespace + "." + GenerateActorClientAttributeTypeName;
32+
33+
/// <summary>
34+
/// Actor proxy type name.
35+
/// </summary>
36+
public const string ActorProxyTypeName = "Dapr.Actors.Client.ActorProxy";
37+
}
38+
}
Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,55 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<ImplicitUsings>enable</ImplicitUsings>
5-
<Nullable>enable</Nullable>
6-
</PropertyGroup>
3+
<PropertyGroup>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<Nullable>enable</Nullable>
6+
<IsRoslynComponent>true</IsRoslynComponent>
7+
</PropertyGroup>
78

8-
<PropertyGroup>
9-
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
10-
</PropertyGroup>
9+
<PropertyGroup>
10+
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
11+
</PropertyGroup>
1112

1213
<ItemGroup>
1314
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
1415
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
1516
</ItemGroup>
1617

17-
<!--
18+
<!--
1819
Source generators are built and packaged as analyzers and not "normal" NuGet libraries.
1920
-->
2021

21-
<PropertyGroup>
22-
<!-- Generators must target netstandard2.0. -->
23-
<TargetFramework>netstandard2.0</TargetFramework>
24-
<TargetFrameworks></TargetFrameworks>
22+
<PropertyGroup>
23+
<!-- Generators must target netstandard2.0. -->
24+
<TargetFramework>netstandard2.0</TargetFramework>
25+
<TargetFrameworks></TargetFrameworks>
2526

26-
<!-- Do not include the generator as a lib dependency -->
27-
<IncludeBuildOutput>false</IncludeBuildOutput>
27+
<!-- Do not include the generator as a lib dependency -->
28+
<IncludeBuildOutput>false</IncludeBuildOutput>
2829

29-
<!-- Suppress false-positive error NU5128 when packing analyzers with no lib/ref files. -->
30-
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
30+
<!-- Suppress false-positive error NU5128 when packing analyzers with no lib/ref files. -->
31+
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
3132

32-
<!-- Suppress generation of symbol package (.snupkg). -->
33-
<IncludeSymbols>false</IncludeSymbols>
33+
<!-- Suppress generation of symbol package (.snupkg). -->
34+
<IncludeSymbols>false</IncludeSymbols>
3435

35-
<!-- Additional NuGet package properties. -->
36-
<Description>This package contains source generators for interacting with Actor services using Dapr.</Description>
37-
<PackageTags>$(PackageTags);Actors</PackageTags>
38-
</PropertyGroup>
36+
<!-- Additional NuGet package properties. -->
37+
<Description>This package contains source generators for interacting with Actor services using Dapr.</Description>
38+
<PackageTags>$(PackageTags);Actors</PackageTags>
39+
</PropertyGroup>
3940

40-
<ItemGroup>
41-
<!-- Package the generator in the analyzer directory of the NuGet package -->
42-
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
43-
</ItemGroup>
41+
<ItemGroup>
42+
<!-- Package the generator in the analyzer directory of the NuGet package -->
43+
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
44+
</ItemGroup>
45+
46+
<ItemGroup>
47+
<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
48+
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
49+
</ItemGroup>
50+
51+
<ItemGroup>
52+
<InternalsVisibleTo Include="$(AssemblyName).Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b1f597635c44597fcecb493e2b1327033b29b1a98ac956a1a538664b68f87d45fbaada0438a15a6265e62864947cc067d8da3a7d93c5eb2fcbb850e396c8684dba74ea477d82a1bbb18932c0efb30b64ff1677f85ae833818707ac8b49ad8062ca01d2c89d8ab1843ae73e8ba9649cd28666b539444dcdee3639f95e2a099bb2"/>
53+
</ItemGroup>
4454

4555
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Microsoft.CodeAnalysis;
2+
3+
namespace Dapr.Actors.Generators.Diagnostics
4+
{
5+
internal static class CancellationTokensMustBeTheLastArgument
6+
{
7+
public const string DiagnosticId = "DAPR0001";
8+
public const string Title = "Invalid method signature";
9+
public const string MessageFormat = "Cancellation tokens must be the last argument";
10+
public const string Category = "Usage";
11+
12+
private static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(
13+
DiagnosticId,
14+
Title,
15+
MessageFormat,
16+
Category,
17+
DiagnosticSeverity.Error,
18+
isEnabledByDefault: true);
19+
20+
internal static Diagnostic CreateDiagnostic(ISymbol symbol) => Diagnostic.Create(
21+
Rule,
22+
symbol.Locations.First(),
23+
symbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat));
24+
}
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Microsoft.CodeAnalysis;
2+
3+
namespace Dapr.Actors.Generators.Diagnostics
4+
{
5+
internal static class MethodMustOnlyHaveASingleArgumentOptionallyFollowedByACancellationToken
6+
{
7+
public const string DiagnosticId = "DAPR0002";
8+
public const string Title = "Invalid method signature";
9+
public const string MessageFormat = "Only methods with a single argument or a single argument followed by a cancellation token are supported";
10+
public const string Category = "Usage";
11+
12+
private static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(
13+
DiagnosticId,
14+
Title,
15+
MessageFormat,
16+
Category,
17+
DiagnosticSeverity.Error,
18+
isEnabledByDefault: true);
19+
20+
internal static Diagnostic CreateDiagnostic(ISymbol symbol) => Diagnostic.Create(
21+
Rule,
22+
symbol.Locations.First(),
23+
symbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat));
24+
}
25+
}

0 commit comments

Comments
 (0)