From 47033820fa8af2558662657a98bcd9f0055cef2b Mon Sep 17 00:00:00 2001 From: Arthur van de Vondervoort Date: Mon, 13 Nov 2023 14:01:53 +0100 Subject: [PATCH] Resolve false positive on use of namespaces --- Design/Rule0003DoNotUseObjectIDsInVariablesOrProperties.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Design/Rule0003DoNotUseObjectIDsInVariablesOrProperties.cs b/Design/Rule0003DoNotUseObjectIDsInVariablesOrProperties.cs index 01a6366b..b50e62b6 100644 --- a/Design/Rule0003DoNotUseObjectIDsInVariablesOrProperties.cs +++ b/Design/Rule0003DoNotUseObjectIDsInVariablesOrProperties.cs @@ -68,10 +68,10 @@ private void CheckForObjectIDsInVariablesOrProperties(SyntaxNodeAnalysisContext if (property.PropertyKind != PropertyKind.Permissions && property.PropertyKind != PropertyKind.AccessByPermission) { - if (ctx.Node.ToString().Trim('"').ToUpper() != property.ValueText.ToUpper()) + if (ctx.Node.GetLastToken().ToString().Trim('"').ToUpper() != property.ValueText.ToUpper()) ctx.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0003DoNotUseObjectIDsInVariablesOrProperties, ctx.Node.GetLocation(), new object[] { ctx.Node.ToString().Trim('"'), property.ValueText })); - if (ctx.Node.ToString().Trim('"') != property.ValueText) + if (ctx.Node.GetLastToken().ToString().Trim('"') != property.ValueText) ctx.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0005VariableCasingShouldNotDIfferFromDeclaration, ctx.Node.GetLocation(), new object[] { property.ValueText, "" })); } }