private static ITreeNode GetBestTreeNode()

in src/dotnet/PowerToys.CyclomaticComplexity/ComplexityAnalysisElementProblemAnalyzer.cs [250:259]


    private static ITreeNode GetBestTreeNode(ITreeNode element, out IDeclaration declaration)
    {
      declaration = element as IDeclaration;
      if (declaration?.DeclaredElement != null)
        return element;

      // Don't have a declared element to highlight. Going to have to guess. Try the
      // first meaningful child
      return element.GetNextMeaningfulChild(null);
    }