Package org.python.pydev.parser.visitors.scope

Examples of org.python.pydev.parser.visitors.scope.ASTEntryWithChildren


        //module level: Foo and 1 comment
        assertEquals(2, item.getAstChildrenEntries().length);
        assertNull(item.getAstChildrenEntries()[1].children); //comment has no children

        //class level: m1 and 1 comment
        ASTEntryWithChildren classEntry = item.getAstChildrenEntries()[0];
        assertEquals(2, classEntry.children.size());
        assertNull(classEntry.children.get(1).children); //comment has no children

        // method level: 1 comment
        ASTEntryWithChildren functionEntry = classEntry.children.get(0);
        assertEquals(1, functionEntry.children.size());

    }
View Full Code Here


        //module level: Test
        assertEquals(1, item.getAstChildrenEntries().length);

        //class level: __init__
        ASTEntryWithChildren classEntry = item.getAstChildrenEntries()[0];
        assertEquals(1, classEntry.children.size());

        // method level: 2 attributes
        ASTEntryWithChildren functionEntry = classEntry.children.get(0);
        assertEquals(2, functionEntry.children.size());

    }
View Full Code Here

    @Override
    public boolean select(Viewer viewer, Object parentElement, Object element) {
        if (element instanceof PythonNode) {
            PythonNode node = (PythonNode) element;
            ASTEntryWithChildren astThis = node.entry.getAstThis();
            if (astThis == null) {
                return true;
            }
            SimpleNode n = astThis.node;
            if (NodeUtils.isComment(n)) {
View Full Code Here

            openFiles(filesSelected);

        } else if (nodesSelected.size() > 0) {
            PythonNode node = nodesSelected.iterator().next();
            ParsedItem actualObject = node.getActualObject();
            ASTEntryWithChildren astThis = actualObject.getAstThis();
            if (astThis != null) {
                new PyOpenAction().run(new ItemPointer(node.getPythonFile().getActualObject(), NodeUtils
                        .getNameTokFromNode(astThis.node)));
            }
View Full Code Here

    @Override
    public boolean select(Viewer viewer, Object parentElement, Object element) {
        if (element instanceof PythonNode) {
            PythonNode node = (PythonNode) element;
            ASTEntryWithChildren astThis = node.entry.getAstThis();
            if (astThis == null) {
                return true;
            }
            SimpleNode n = astThis.node;
            if (NodeUtils.isImport(n)) {
View Full Code Here

            @Override
            public boolean select(Viewer viewer, Object parentElement, Object element) {
                if (element instanceof ParsedItem) {
                    ParsedItem item = (ParsedItem) element;
                    ASTEntryWithChildren astThis = item.getAstThis();
                    if (astThis != null) {
                        SimpleNode n = astThis.node;
                        if (n instanceof ImportFrom || n instanceof Import) {
                            return false;
                        }
View Full Code Here

            @Override
            public boolean select(Viewer viewer, Object parentElement, Object element) {
                if (element instanceof ParsedItem) {
                    ParsedItem item = (ParsedItem) element;

                    ASTEntryWithChildren astThis = item.getAstThis();
                    if (astThis == null) {
                        return true;
                    }
                    SimpleNode token = astThis.node;
View Full Code Here

            @Override
            public boolean select(Viewer viewer, Object parentElement, Object element) {
                if (element instanceof ParsedItem) {
                    ParsedItem item = (ParsedItem) element;

                    ASTEntryWithChildren astThis = item.getAstThis();
                    if (astThis == null) {
                        return true;
                    }
                    SimpleNode token = astThis.node;
View Full Code Here

        ParsedItem prev = null;

        ParsedItem[] children = r.getChildren();
        if (children != null) {
            for (ParsedItem i : children) {
                ASTEntryWithChildren astThis = i.getAstThis();
                if (astThis != null && astThis.node != null) {
                    if (astThis.node.beginLine == startLine) {
                        prev = i;
                        break;
                    }
View Full Code Here

            String oldTitle = oldItem.toString();
            String newTitle = newItem.toString();
            if (!oldTitle.equals(newTitle)) {
                itemsToUpdate.add(oldItem);
            } else {
                ASTEntryWithChildren astThisOld = oldItem.getAstThis();
                ASTEntryWithChildren astThisNew = newItem.getAstThis();

                if (astThisOld != null && astThisNew != null && astThisOld.node != null && astThisNew.node != null
                        && astThisOld.node.getClass() != astThisNew.node.getClass()) {

                    itemsToUpdate.add(oldItem);
View Full Code Here

TOP

Related Classes of org.python.pydev.parser.visitors.scope.ASTEntryWithChildren

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.