Package org.python.pydev.editor.refactoring

Examples of org.python.pydev.editor.refactoring.RefactoringRequest


    public void testOnParam() throws Exception {
        String str = "" + "tok = 10\n" + "def m1(tok=tok):\n" + //parameter tok (left side)
                "    '@param tok: this is tok'\n" + "    #checking tok right?\n" + "";

        RefactoringRequest refactoringRequest = createRefactoringRequest(new Document(str), "foo", 1, 9);

        refactoringRequest.setAdditionalInfo(AstEntryRefactorerRequestConstants.FIND_DEFINITION_IN_ADDITIONAL_INFO,
                false);
        ItemPointer[] pointers = refactorer.findDefinition(refactoringRequest);

        assertEquals(1, pointers.length);
        assertEquals(1, pointers[0].start.line);
View Full Code Here


    public void testOnSameName2() throws Exception {
        String str = "" + "class Foo:\n" + "    def m1():\n" + //this line, col 9
                "        pass\n" + "    m1 = staticmethod(m1)\n" + //we will find this definition too
                "";

        RefactoringRequest refactoringRequest = createRefactoringRequest(new Document(str), "foo", 1, 9);

        refactoringRequest.setAdditionalInfo(AstEntryRefactorerRequestConstants.FIND_DEFINITION_IN_ADDITIONAL_INFO,
                false);
        ItemPointer[] pointers = refactorer.findDefinition(refactoringRequest);

        assertEquals(2, pointers.length);
        assertEquals(1, pointers[0].start.line);
View Full Code Here

        //        System.out.println("START ------------");
        //        System.out.println("START ------------");
        //        System.out.println("START ------------");
        //        System.out.println("START ------------");
        RefactoringRequest request = setUpFooModule(line, col);

        try {
            //            RefactorerFinds.DEBUG = true;
            //            AbstractAdditionalDependencyInfo.DEBUG = true;
View Full Code Here

    public void testFindHierarchy2() {
        final int line = 3;
        final int col = 9;

        RefactoringRequest request = setUpFooModule(line, col);

        HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
        assertEquals("Foo", node.name);
        assertTrue(node.moduleName.startsWith("foo"));
View Full Code Here

                "\n" +
                "";
        final int line = 3;
        final int col = 9;

        RefactoringRequest request = setUpFooModule(line, col, str);

        HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
        assertEquals("Foo", node.name);
        assertTrue(node.moduleName.startsWith("foo"));
View Full Code Here

                "\n" +
                "";
        final int line = 0;
        final int col = 8;

        RefactoringRequest request = setUpFooModule(line, col, str);

        HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
        assertEquals("Bar", node.name);
        assertTrue(node.moduleName.startsWith("foo"));
View Full Code Here

                "";

        final int line = 6;
        final int col = 8;

        RefactoringRequest request = setUpFooModule(line, col, str);

        HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
        assertEquals("Leaf", node.name);
        assertTrue(node.moduleName.startsWith("foo"));
View Full Code Here

                "";

        final int line = 9;
        final int col = 8;

        RefactoringRequest request = setUpFooModule(line, col, str);

        HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
        assertEquals("Bla", node.name);
        assertTrue(node.moduleName.startsWith("foo"));
View Full Code Here

        String str2 = "from fooIn1 import FooIn1\nclass FooIn2(FooIn1):pass\n";

        final int line = 0;
        final int col = 8;

        RefactoringRequest request;
        request = setUpModule(line, col, str2, "fooIn2", nature2);
        request = setUpModule(line, col, str, "fooIn1", nature);

        HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
        assertEquals("FooIn1", node.name);
View Full Code Here

        final int line = 1;
        final int col = 8;

        setUpModule(0, 0, fooIn1Original, "fooIn1Original", nature);
        setUpModule(0, 0, fooIn1Dep, "fooIn1Dep", nature);
        RefactoringRequest request;
        request = setUpModule(line, col, fooIn2, "fooIn2", nature);

        HierarchyNodeModel node = refactorer.findClassHierarchy(request, false);
        assertEquals("FooIn2", node.name);
        assertTrue(node.moduleName.startsWith("fooIn2"));
View Full Code Here

TOP

Related Classes of org.python.pydev.editor.refactoring.RefactoringRequest

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.