Merge pull request #1180 from MattFromRVA/Add_Compilation_End_Custom_Tag

Add CompilationEnd Tag to CompilationStartedAnalyzerWithCompilationWideAnalysis Sample
This commit is contained in:
Sam Harwell 2024-08-23 14:35:56 -05:00 коммит произвёл GitHub
Родитель dda9795a1d 1db03a9982
Коммит 0af0fc38a2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -42,7 +42,8 @@ namespace Sample.Analyzers
DiagnosticCategories.Stateful,
DiagnosticSeverity.Warning,
isEnabledByDefault: true,
description: Description);
description: Description,
customTags: WellKnownDiagnosticTags.CompilationEnd);
public const string UnsecureMethodAttributeName = "MyNamespace.UnsecureMethodAttribute";
public const string SecureTypeInterfaceName = "MyNamespace.ISecureType";

Просмотреть файл

@ -33,7 +33,7 @@ Namespace BasicAnalyzers
Friend Shared ReadOnly MessageFormat As LocalizableString = "Type '{0}' is a secure type as it implements interface '{1}', but it also implements interface '{2}' which has unsecure method(s)."
Friend Shared ReadOnly Description As LocalizableString = "Secure types must not implement interfaces with unsecure methods."
Friend Shared Rule As New DiagnosticDescriptor(DiagnosticIds.CompilationStartedAnalyzerWithCompilationWideAnalysisRuleId, Title, MessageFormat, DiagnosticCategories.Stateful, DiagnosticSeverity.Warning, isEnabledByDefault:=True, description:=Description)
Friend Shared Rule As New DiagnosticDescriptor(DiagnosticIds.CompilationStartedAnalyzerWithCompilationWideAnalysisRuleId, Title, MessageFormat, DiagnosticCategories.Stateful, DiagnosticSeverity.Warning, isEnabledByDefault:=True, description:=Description, Nothing, WellKnownDiagnosticTags.CompilationEnd)
#End Region
Public Const UnsecureMethodAttributeName As String = "MyNamespace.UnsecureMethodAttribute"