Browse Source

Ancsestor -> Ancestor

pull/1751/head
Jane Doe 6 years ago
parent
commit
5373cb26ad
  1. 6
      ILSpy.AddIn/SyntaxNodeExtensions.cs

6
ILSpy.AddIn/SyntaxNodeExtensions.cs

@ -404,15 +404,15 @@ namespace ICSharpCode.ILSpy.AddIn
public static NamespaceDeclarationSyntax GetInnermostNamespaceDeclarationWithUsings(this SyntaxNode contextNode) public static NamespaceDeclarationSyntax GetInnermostNamespaceDeclarationWithUsings(this SyntaxNode contextNode)
{ {
var usingDirectiveAncsestor = contextNode.GetAncestor<UsingDirectiveSyntax>(); var usingDirectiveAncestor = contextNode.GetAncestor<UsingDirectiveSyntax>();
if (usingDirectiveAncsestor == null) if (usingDirectiveAncestor == null)
{ {
return contextNode.GetAncestorsOrThis<NamespaceDeclarationSyntax>().FirstOrDefault(n => n.Usings.Count > 0); return contextNode.GetAncestorsOrThis<NamespaceDeclarationSyntax>().FirstOrDefault(n => n.Usings.Count > 0);
} }
else else
{ {
// We are inside a using directive. In this case, we should find and return the first 'parent' namespace with usings. // We are inside a using directive. In this case, we should find and return the first 'parent' namespace with usings.
var containingNamespace = usingDirectiveAncsestor.GetAncestor<NamespaceDeclarationSyntax>(); var containingNamespace = usingDirectiveAncestor.GetAncestor<NamespaceDeclarationSyntax>();
if (containingNamespace == null) if (containingNamespace == null)
{ {
// We are inside a top level using directive (i.e. one that's directly in the compilation unit). // We are inside a top level using directive (i.e. one that's directly in the compilation unit).

Loading…
Cancel
Save