Examples of findDefinition()


Examples of org.python.pydev.core.IModule.findDefinition()

                "import java.lang.Class\n" +
                "java.lang.Class.asSubclass";

        Document doc = new Document(d);
        IModule module = AbstractModule.createModuleFromDoc("", null, doc, nature, true);
        Definition[] defs = (Definition[]) module.findDefinition(CompletionStateFactory.getEmptyCompletionState(
                "java.lang.Class.asSubclass", nature, new CompletionCache()), 2, 20, nature);

        assertEquals(1, defs.length);
        assertEquals("asSubclass", defs[0].value);
        assertTrue(defs[0].module instanceof JavaZipModule);
View Full Code Here

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

                        }
                        tok.append(s);
                    }

                    try {
                        IDefinition[] definitions = mod.findDefinition(CompletionStateFactory.getEmptyCompletionState(
                                tok.toString(), nature, new CompletionCache()), -1, -1, nature);
                        List<ItemPointer> pointers = new ArrayList<ItemPointer>();
                        PyRefactoringFindDefinition.getAsPointers(pointers, (Definition[]) definitions);
                        if (pointers.size() > 0) {
                            new PyOpenAction().run(pointers.get(0));
View Full Code Here

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

    public void testFindDefinition() throws Exception {
        isInTestFindDefinition = true;
        try {
            CompiledModule mod = new CompiledModule("os", nature.getAstManager().getModulesManager());
            Definition[] findDefinition = mod.findDefinition(
                    CompletionStateFactory.getEmptyCompletionState("walk", nature, new CompletionCache()), -1, -1,
                    nature);
            assertEquals(1, findDefinition.length);
            assertEquals("os", findDefinition[0].module.getName());
        } finally {
View Full Code Here

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

    public void testFindDefinition() throws Exception {
        isInTestFindDefinition = true;
        try {
            CompiledModule mod = new CompiledModule("os", nature.getAstManager().getModulesManager());
            Definition[] findDefinition = mod.findDefinition(
                    CompletionStateFactory.getEmptyCompletionState("walk", nature, new CompletionCache()), -1, -1,
                    nature);
            assertEquals(1, findDefinition.length);
            assertEquals("os", findDefinition[0].module.getName());
        } finally {
View Full Code Here

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

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

        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

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

        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

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

            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

Examples of org.python.pydev.editor.refactoring.IPyRefactoring.findDefinition()

                        RefactoringRequest request = new RefactoringRequest(f, callPs, null, nature, edit);
                        //Don't look in additional info.
                        request.setAdditionalInfo(
                                AstEntryRefactorerRequestConstants.FIND_DEFINITION_IN_ADDITIONAL_INFO, false);
                        pointers = pyRefactoring.findDefinition(request);

                        if (((pointers != null && pointers.length > 0) || StringUtils.count(possibleMatch.full, '.') <= 1)) {
                            break;
                        }
                    }
View Full Code Here

Examples of org.python.pydev.editor.refactoring.IPyRefactoring.findDefinition()

     * @throws MisconfigurationException
     * @throws TooManyMatchesException
     */
    public ItemPointer[] findDefinition(PyEdit pyEdit) throws TooManyMatchesException, MisconfigurationException {
        IPyRefactoring pyRefactoring = AbstractPyRefactoring.getPyRefactoring();
        return pyRefactoring.findDefinition(getRefactoringRequest());
    }

    /**
     * As we're not using the default refactoring cycle, this method is not even called
     */
 
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.