Package org.python.pydev.core

Examples of org.python.pydev.core.IToken


        doc = new Document("import bla as fooo\n" +
                "raise fooo.ffff(msg)\n");
        List<IToken> tokenOccurrences = getTokenOccurrences(0, 16);
        assertEquals(2, tokenOccurrences.size());

        IToken t0 = tokenOccurrences.get(0);
        IToken t1 = tokenOccurrences.get(1);
        SimpleNode ast0 = ((SourceToken) t0).getAst();
        SimpleNode ast1 = ((SourceToken) t1).getAst();

        assertEquals("fooo", t0.getRepresentation());
        assertEquals("fooo", t1.getRepresentation());
        assertEquals(15, NodeUtils.getColDefinition(ast0));
        assertEquals(7, NodeUtils.getColDefinition(ast1));
    }
View Full Code Here


                System.out.println("col:" + (AbstractMessage.getStartCol(token, doc) - 1));
            }
        }
        assertEquals(2, tokenOccurrences.size());

        IToken tok0 = tokenOccurrences.get(0);
        assertEquals(lookFor, tok0.getRepresentation());
        if (checkPositions) {
            assertEquals(0, AbstractMessage.getStartLine(tok0, doc) - 1);
            assertEquals(col, AbstractMessage.getStartCol(tok0, doc) - 1);
        }

        IToken tok1 = tokenOccurrences.get(1);
        assertEquals(lookFor, tok1.getRepresentation());
        if (checkPositions) {
            assertEquals(1, AbstractMessage.getStartLine(tok1, doc) - 1);
            assertEquals(col, AbstractMessage.getStartCol(tok1, doc) - 1);
        }
    }
View Full Code Here

            int qlen = tokenAndQual.qualifier.length();
            List<ICompletionProposal> ret = new ArrayList<ICompletionProposal>(tokens.size());
            Iterator<IToken> it = tokens.iterator();
            for (int i = 0; i < tokens.size(); i++) {
                IToken t = it.next();
                int replacementOffset = offset - qlen;
                String representation = t.getRepresentation();
                if (representation.startsWith(tokenAndQual.qualifier)) {
                    ret.add(new PyLinkedModeCompletionProposal(representation, replacementOffset, qlen, representation
                            .length(), t, null, null, IPyCompletionProposal.PRIORITY_DEFAULT,
                            PyCompletionProposal.ON_APPLY_DEFAULT, ""));
                }
View Full Code Here

TOP

Related Classes of org.python.pydev.core.IToken

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.