Package org.python.pydev.editor.codecompletion.revisited.modules

Examples of org.python.pydev.editor.codecompletion.revisited.modules.SourceModule.findDefinition()


        Definition[] defs = new Definition[0];
        if (module instanceof SourceModule) {
            SourceModule s = (SourceModule) module;

            try {
                defs = s.findDefinition(state, state.getLine() + 1, state.getCol() + 1, state.getNature());
                for (int i = 0; i < defs.length; i++) {
                    //go through all definitions found and make a merge of it...
                    Definition definition = defs[i];

                    if (state.getLine() == definition.line && state.getCol() == definition.col) {
View Full Code Here


        SourceModule module = (SourceModule) AbstractModule.createModuleFromDoc("", null, doc, nature, true);
        Module ast = (Module) module.getAst();
        assertEquals(1, ast.body.length);
        ICompletionState emptyCompletionState = CompletionStateFactory.getEmptyCompletionState("args", nature,
                new CompletionCache());
        Definition[] defs = (Definition[]) module.findDefinition(emptyCompletionState, 2, 7, nature);

        assertEquals(1, defs.length);
        assertEquals(1, defs[0].line);
        assertEquals(11, defs[0].col);
        assertSame(module, defs[0].module);
View Full Code Here

        SourceModule module = (SourceModule) AbstractModule.createModuleFromDoc("", null, doc, nature, true);
        Module ast = (Module) module.getAst();
        assertEquals(1, ast.body.length);
        ICompletionState emptyCompletionState = CompletionStateFactory.getEmptyCompletionState("args", nature,
                new CompletionCache());
        Definition[] defs = (Definition[]) module.findDefinition(emptyCompletionState, 2, 7, nature);

        assertEquals(1, defs.length);
        assertEquals(1, defs[0].line);
        assertEquals(12, defs[0].col);
        assertSame(module, defs[0].module);
View Full Code Here

            SourceModule module = (SourceModule) AbstractModule.createModuleFromDoc("", null, doc, nature, true);
            Module ast = (Module) module.getAst();
            assertEquals(1, ast.body.length);
            ICompletionState emptyCompletionState = CompletionStateFactory.getEmptyCompletionState("arg2", nature,
                    new CompletionCache());
            Definition[] defs = (Definition[]) module.findDefinition(emptyCompletionState, 2, 7, nature);

            assertEquals(1, defs.length);
            assertEquals(1, defs[0].line);
            assertEquals(18, defs[0].col);
            assertSame(module, defs[0].module);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.