/// <summary> /// Gets the top-most classes (not nested within other objects) in the namespace. /// </summary> /// <param name="node">The node.</param> /// <returns></returns> internal static IEnumerable <ClassDeclarationSyntax> GetClassesTopLevel(this NamespaceDeclarationSyntax node) => node .DescendantNodesImmediate() .OfType <ClassDeclarationSyntax>();