Package com.aptana.shared_core.utils

Examples of com.aptana.shared_core.utils.DocCmd


                "";

        final Document doc = new Document(str);
        String s = "\n" +
                "            )\n";
        DocCmd docCmd = new DocCmd(doc.getLength() - s.length(), 0, "\t");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("              ", docCmd.text);

    }
View Full Code Here


        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "string1 = '01234546789[#]'" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n", docCmd.text);

    }
View Full Code Here

                "def M1(a):\n" +
                "    doFoo(a,b(),\n" +
                "          '',b)" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n    ", docCmd.text);

    }
View Full Code Here

                "def fun():\n" +
                "    if True:\n" +
                "        passif False: 'foo'" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength() - "if False: 'foo'".length(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n    ", docCmd.text);

    }
View Full Code Here

        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "" +
                "if False:print 'done'" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength() - "print 'done'".length(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n    ", docCmd.text);
    }
View Full Code Here

    public void testNewLine3() {
        strategy.setIndentPrefs(new TestIndentPrefs(true, 4));
        String str = "for a in b:    " +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength() - 4, 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n    ", docCmd.text);

        String expected = "for a in b:    ";
        assertEquals(expected, doc.get());
View Full Code Here

        String str = "" +
                "for v in w:\n" +
                "    pass\n" + //dedent on pass
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n", docCmd.text);
    }
View Full Code Here

        String str = "" +
                "def getSpilledComps( *dummy ):\n" +
                "    return [self.component4]" + //dedent here
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n", docCmd.text);
    }
View Full Code Here

                "    a = 30\n" +
                "print C.a\n" +
                "\n" +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n", docCmd.text);
    }
View Full Code Here

                "    pass\n" +
                "    a = 30\n" +
                "    " +
                "";
        final Document doc = new Document(str);
        DocCmd docCmd = new DocCmd(doc.getLength(), 0, "\n");
        strategy.customizeDocumentCommand(doc, docCmd);
        assertEquals("\n    ", docCmd.text);
    }
View Full Code Here

TOP

Related Classes of com.aptana.shared_core.utils.DocCmd

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.