Examples of searchForOpeningPeer()


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

    }

    public void testMatch() throws Exception {
        PythonPairMatcher matcher = getMatcher();
        String s = "test (";
        assertEquals(5, matcher.searchForOpeningPeer(s.length(), '(', ')', new Document(s)));
        s = "test ";
        assertEquals(-1, matcher.searchForOpeningPeer(s.length(), '(', ')', new Document(s)));
        s = "test () ";
        assertEquals(-1, matcher.searchForOpeningPeer(s.length(), '(', ')', new Document(s)));
    }
View Full Code Here

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

    public void testMatch() throws Exception {
        PythonPairMatcher matcher = getMatcher();
        String s = "test (";
        assertEquals(5, matcher.searchForOpeningPeer(s.length(), '(', ')', new Document(s)));
        s = "test ";
        assertEquals(-1, matcher.searchForOpeningPeer(s.length(), '(', ')', new Document(s)));
        s = "test () ";
        assertEquals(-1, matcher.searchForOpeningPeer(s.length(), '(', ')', new Document(s)));
    }

    public void testSearchesOnlyInCurrentStatement() throws Exception {
View Full Code Here

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

        String s = "test (";
        assertEquals(5, matcher.searchForOpeningPeer(s.length(), '(', ')', new Document(s)));
        s = "test ";
        assertEquals(-1, matcher.searchForOpeningPeer(s.length(), '(', ')', new Document(s)));
        s = "test () ";
        assertEquals(-1, matcher.searchForOpeningPeer(s.length(), '(', ')', new Document(s)));
    }

    public void testSearchesOnlyInCurrentStatement() throws Exception {
        PythonPairMatcher matcher = getMatcher();
        String s = "" +
View Full Code Here

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

        PythonPairMatcher matcher = getMatcher();
        String s = "" +
                "a = (\n" +
                "def m1():\n" +
                "    b = ()";
        assertEquals(-1, matcher.searchForOpeningPeer(s.length(), '(', ')', new Document(s)));
    }

    public void testMatch1() throws Exception {
        PythonPairMatcher matcher = getMatcher();
        String s = "\ntest ('[#') ";
View Full Code Here

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

                    } catch (BadLocationException e) {
                        //Ignore (end of document is selected).
                    }
                    if (StringUtils.isClosingPeer(c)) {
                        PythonPairMatcher pairMatcher = new PythonPairMatcher();
                        int openingOffset = pairMatcher.searchForOpeningPeer(ps.getAbsoluteCursorOffset(),
                                StringUtils.getPeer(c), c, doc);
                        if (openingOffset >= 0) {
                            return new TextSelection(openingOffset, ps.getAbsoluteCursorOffset() - openingOffset + 1);
                        }
                    }
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.