public override void PostWalkCodeUsingDeclaration(CodeUsingDeclarationSyntax codeUsingDeclarationSyntax) { MethodsCalled["PostWalkCodeUsingDeclaration"]=true; }
void ProcessCodeUsingDeclaration(CodeUsingDeclarationSyntax codeUsingDeclarationSyntax) { if (codeUsingDeclarationSyntax?.Namespace == null) { return; } var nsSyntax = codeUsingDeclarationSyntax.Namespace; var ns = nsSyntax.ToString(); if (_codeUsings.Contains(ns)) { _diagnostics.Add(new Diagnostic( codeUsingDeclarationSyntax.GetLocation(), DiagnosticDescriptors.DeadCode.Nav1002UsingDirective0AppearedPreviously, ns)); } else { _codeUsings.Add(ns); } }
// CodeUsingDeclarationSyntax public override bool WalkCodeUsingDeclaration(CodeUsingDeclarationSyntax codeUsingDeclarationSyntax) { MethodsCalled["WalkCodeUsingDeclaration"]=true; return true; }