Package org.python.pydev.core.docutils.PySelection

Examples of org.python.pydev.core.docutils.PySelection.ActivationTokenAndQual


            IPyCodeCompletion codeCompletion) {
        //we need those set before requesting a py selection
        this.doc = doc;
        this.documentOffset = documentOffset;

        ActivationTokenAndQual act = getPySelection().getActivationTokenAndQual(false, true);
        this.activationToken = act.activationToken;
        this.qualifier = act.qualifier;
        this.isInCalltip = act.changedForCalltip;
        this.isInMethodKeywordParam = act.isInMethodKeywordParam;
        this.offsetForKeywordParam = act.offsetForKeywordParam;
View Full Code Here


        //Ok, now, the tests for getting the activation token and qualifier for the calltips.
        //We should 'know' that we're just after a parenthesis and get the contents before it
        //This means: get the char before the offset (excluding spaces and tabs) and see
        //if it is a ',' or '(' and if it is, go to that offset and do the rest of the process
        //as if we were on that position
        ActivationTokenAndQual act = PySelection.getActivationTokenAndQual(new Document("m1()"), 3, false, true);
        assertEquals("", act.activationToken);
        assertEquals("m1", act.qualifier);
        assertTrue(act.changedForCalltip);
        assertFalse(act.alreadyHasParams);
        assertTrue(!act.isInMethodKeywordParam);
View Full Code Here

        strs = PySelection.getActivationTokenAndQual(new Document(".a"), 2, false);
        assertEquals("", strs[0]);
        assertEquals("a", strs[1]);

        ActivationTokenAndQual act = PySelection.getActivationTokenAndQual(new Document("."), 1, false, true);
        assertEquals("", act.activationToken);
        assertEquals("", act.qualifier);
        assertTrue(!act.changedForCalltip);
        assertTrue(!act.alreadyHasParams);
        assertTrue(!act.isInMethodKeywordParam);
View Full Code Here

    public ICompletionProposal[] getCompletions(IScriptConsoleViewer viewer, String commandLine, int position,
            int offset, int whatToShow) throws Exception {

        final String text = commandLine.substring(0, position);
        ActivationTokenAndQual tokenAndQual = PySelection.getActivationTokenAndQual(new Document(text), text.length(),
                true, false);

        String actTok = tokenAndQual.activationToken;
        if (tokenAndQual.qualifier != null && tokenAndQual.qualifier.length() > 0) {
            if (actTok.length() > 0 && actTok.charAt(actTok.length() - 1) != '.') {
View Full Code Here

    /*
     * (non-Javadoc)
     * @see com.aptana.interactive_console.console.IScriptConsoleShell#getDescription(org.eclipse.jface.text.IDocument, int)
     */
    public String getDescription(IDocument doc, int position) throws Exception {
        ActivationTokenAndQual tokenAndQual = PySelection.getActivationTokenAndQual(doc, position, true, false);
        String actTok = tokenAndQual.activationToken;
        if (tokenAndQual.qualifier != null && tokenAndQual.qualifier.length() > 0) {
            if (actTok.length() > 0 && actTok.charAt(actTok.length() - 1) != '.') {
                actTok += '.';
            }
View Full Code Here

    @SuppressWarnings("unchecked")
    public ICompletionProposal[] getCompletions(IScriptConsoleViewer viewer, String commandLine, int position,
            int offset, int whatToShow) throws Exception {

        final String text = commandLine.substring(0, position);
        ActivationTokenAndQual tokenAndQual = PySelection.getActivationTokenAndQual(new Document(text), text.length(),
                true, false);

        //Code-completion for imports
        ImportInfo importsTipper = ImportsSelection.getImportsTipperStr(text, false);
        if (importsTipper.importsTipperStr.length() != 0) {
View Full Code Here

    /*
     * (non-Javadoc)
     * @see com.aptana.interactive_console.console.IScriptConsoleShell#getDescription(org.eclipse.jface.text.IDocument, int)
     */
    public String getDescription(IDocument doc, int position) throws Exception {
        ActivationTokenAndQual tokenAndQual = PySelection.getActivationTokenAndQual(doc, position, true, false);
        String actTok = tokenAndQual.activationToken;
        if (tokenAndQual.qualifier != null && tokenAndQual.qualifier.length() > 0) {
            if (actTok.length() > 0 && actTok.charAt(actTok.length() - 1) != '.') {
                actTok += '.';
            }
View Full Code Here

TOP

Related Classes of org.python.pydev.core.docutils.PySelection.ActivationTokenAndQual

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.