Package org.python.pydev.core

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


                "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

        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

                "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

        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

        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

        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

        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

                "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

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.