Examples of findDefinition()


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

                "    pass\n";

        Document doc = new Document(d);
        IModule module = AbstractModule.createModuleFromDoc("", null, doc, nature, true);
        //self.c is found as an assign
        Definition[] defs = (Definition[]) module
                .findDefinition(
                        CompletionStateFactory.getEmptyCompletionState("TestIt", nature, new CompletionCache()), -1,
                        -1, nature);

        assertEquals(1, defs.length);
View Full Code Here

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

                "        c.met1";

        Document doc = new Document(d);
        IModule module = AbstractModule.createModuleFromDoc("", null, doc, nature, true);

        Definition[] defs = (Definition[]) module.findDefinition(
                CompletionStateFactory.getEmptyCompletionState("c.met1", nature, new CompletionCache()), 8, 13, nature);

        assertEquals(1, defs.length);
        assertEquals("met1", defs[0].value);
        assertSame(module, defs[0].module);
View Full Code Here

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

                "from javax import swing\n" +
                "print swing.JFrame()";

        Document doc = new Document(d);
        IModule module = AbstractModule.createModuleFromDoc("", null, doc, nature, true);
        Definition[] defs = (Definition[]) module.findDefinition(
                CompletionStateFactory.getEmptyCompletionState("swing.JFrame", nature, new CompletionCache()), 2, 7,
                nature);

        assertEquals(1, defs.length);
        assertEquals("", defs[0].value);
View Full Code Here

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

                "ex = assist.ExistingClass()\n" +
                "ex.newMethod(c,d)";

        Document doc = new Document(d);
        IModule module = AbstractModule.createModuleFromDoc("", null, doc, nature, true);
        Definition[] defs = (Definition[]) module.findDefinition(
                CompletionStateFactory.getEmptyCompletionState("ex", nature, new CompletionCache()), 3, 3, nature);

        assertEquals(1, defs.length);
        assertEquals("ex", ((AssignDefinition) defs[0]).target);
        assertEquals("assist.ExistingClass", defs[0].value);
View Full Code Here

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

        assertEquals(1, defs.length);
        assertEquals("ex", ((AssignDefinition) defs[0]).target);
        assertEquals("assist.ExistingClass", defs[0].value);
        assertSame(module, defs[0].module);

        defs = (Definition[]) module.findDefinition(
                CompletionStateFactory.getEmptyCompletionState("assist.ExistingClass", nature, new CompletionCache()),
                2, 6, nature);
        assertEquals(1, defs.length);
        assertEquals("ExistingClass", defs[0].value);
        assertNotSame(module, defs[0].module);
View Full Code Here

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

                "mydict = {}\n" +
                "mydict['key'] = 'value'";

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

        assertEquals(1, defs.length);
        assertEquals("mydict", ((AssignDefinition) defs[0]).target);
        assertEquals("dict", defs[0].value);
View Full Code Here

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

        Document doc = new Document(d);
        IModule module = AbstractModule.createModuleFromDoc("", null, doc, nature, true);
        ICompletionState emptyCompletionState = CompletionStateFactory.getEmptyCompletionState("bar", nature,
                new CompletionCache());
        Definition[] defs = (Definition[]) module.findDefinition(emptyCompletionState, 6, 17, nature);

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

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

        IModule module = AbstractModule.createModuleFromDoc("", null, doc, nature, true);
        ICompletionState emptyCompletionState = CompletionStateFactory.getEmptyCompletionState("xxx", nature,
                new CompletionCache());

        //look for xxx
        Definition[] defs = (Definition[]) module.findDefinition(emptyCompletionState, 6, 16, nature);

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

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

        assertEquals(9, defs[0].col);
        assertSame(module, defs[0].module);

        //look for yyy
        emptyCompletionState = CompletionStateFactory.getEmptyCompletionState("yyy", nature, new CompletionCache());
        defs = (Definition[]) module.findDefinition(emptyCompletionState, 6, 22, nature);

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

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

        String d = "" +
                "import java.lang.Class";

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

        assertEquals(1, defs.length);
        assertEquals("", defs[0].value);
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.