Examples of searchForAnyOpeningPeer()


Examples of org.python.pydev.core.docutils.PythonPairMatcher.searchForAnyOpeningPeer()

    }

    public void testMatch1() throws Exception {
        PythonPairMatcher matcher = getMatcher();
        String s = "\ntest ('[#') ";
        assertEquals(-1, matcher.searchForAnyOpeningPeer(s.length(), new Document(s)));

    }

    public void testMatch2() throws Exception {
        PythonPairMatcher matcher = getMatcher();
View Full Code Here

Examples of org.python.pydev.core.docutils.PythonPairMatcher.searchForAnyOpeningPeer()

    }

    public void testMatch2() throws Exception {
        PythonPairMatcher matcher = getMatcher();
        String s = "\ntest ('''\n[#''') ";
        assertEquals(-1, matcher.searchForAnyOpeningPeer(s.length(), new Document(s)));

        s = "\ntest (    ";
        assertEquals(6, matcher.searchForAnyOpeningPeer(s.length(), new Document(s)));

    }
View Full Code Here

Examples of org.python.pydev.core.docutils.PythonPairMatcher.searchForAnyOpeningPeer()

        PythonPairMatcher matcher = getMatcher();
        String s = "\ntest ('''\n[#''') ";
        assertEquals(-1, matcher.searchForAnyOpeningPeer(s.length(), new Document(s)));

        s = "\ntest (    ";
        assertEquals(6, matcher.searchForAnyOpeningPeer(s.length(), new Document(s)));

    }

    private PythonPairMatcher getMatcher() {
        return new PythonPairMatcher(new char[] { '(', ')', '[', ']' });
View Full Code Here

Examples of org.python.pydev.core.docutils.PythonPairMatcher.searchForAnyOpeningPeer()

     */
    public static Tuple<Integer, Boolean> determineSmartIndent(int offset, IDocument document, IIndentPrefs prefs)
            throws BadLocationException {

        PythonPairMatcher matcher = new PythonPairMatcher(StringUtils.BRACKETS);
        int openingPeerOffset = matcher.searchForAnyOpeningPeer(offset, document);
        if (openingPeerOffset == -1) {
            return new Tuple<Integer, Boolean>(-1, false);
        }

        final IRegion lineInformationOfOffset = document.getLineInformationOfOffset(openingPeerOffset);
View Full Code Here

Examples of org.python.pydev.core.docutils.PythonPairMatcher.searchForAnyOpeningPeer()

                        //search its match. If it's found, it means we can delete both, otherwise, this
                        //delete will make things correct.

                        //Create a matcher only matching this char
                        PythonPairMatcher pythonPairMatcher = new PythonPairMatcher(new char[] { c, peer });
                        int openingPeerOffset = pythonPairMatcher.searchForAnyOpeningPeer(replaceOffset, doc);
                        if (openingPeerOffset == -1) {
                            replaceLength += 1;
                        } else {
                            int closingPeerOffset = pythonPairMatcher.searchForClosingPeer(openingPeerOffset, c, peer,
                                    doc);
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.