Skip to content

Commit

Permalink
Merge pull request #314 from ChristianHovenbitzer/LC003_FalsePositive…
Browse files Browse the repository at this point in the history
…WithNamespaces

LC003 bugfix for false positive on objects with namespaces
  • Loading branch information
Arthurvdv authored Oct 28, 2023
2 parents 9a11aeb + 72ba7cf commit ea9e3f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Design/Rule0003DoNotUseObjectIDsInVariablesOrProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ private void CheckForObjectIDsInVariablesOrProperties(SyntaxNodeAnalysisContext
else
correctName = variable.Type.Name;

if (ctx.Node.ToString().Trim('"').ToUpper() != correctName.ToUpper())
if (ctx.Node.GetLastToken().ToString().Trim('"').ToUpper() != correctName.ToUpper())
ctx.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0003DoNotUseObjectIDsInVariablesOrProperties, ctx.Node.GetLocation(), new object[] { ctx.Node.ToString().Trim('"'), correctName }));

if (ctx.Node.ToString().Trim('"') != correctName)
if (ctx.Node.GetLastToken().ToString().Trim('"') != correctName)
ctx.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.Rule0005VariableCasingShouldNotDIfferFromDeclaration, ctx.Node.GetLocation(), new object[] { correctName, "" }));
}
if (ctx.ContainingSymbol.Kind == SymbolKind.Property)
Expand Down

0 comments on commit ea9e3f5

Please sign in to comment.