Search in sources :

Example 1 with PyCodeCompletion

use of org.python.pydev.ast.codecompletion.PyCodeCompletion in project Pydev by fabioz.

the class TddCodeGenerationQuickFixParticipantTest method setUp.

/*
     * @see TestCase#setUp()
     */
@Override
public void setUp() throws Exception {
    super.setUp();
    AbstractPyRefactoring.setPyRefactoring(new Refactorer());
    CompiledModule.COMPILED_MODULES_ENABLED = false;
    this.restorePythonPath(TestDependent.getCompletePythonLib(true, isPython3Test()) + "|" + TestDependent.PYTHON2_PIL_PACKAGES + "|" + TestDependent.TEST_PYSRC_TESTING_LOC + "configobj-4.6.0-py2.6.egg", false);
    this.restorePythonPath(false);
    codeCompletion = new PyCodeCompletion();
    TddCodeGenerationQuickFixParticipant.onGetTddPropsError = new ICallback<Boolean, Exception>() {

        @Override
        public Boolean call(Exception e) {
            throw new RuntimeException("Error:" + org.python.pydev.shared_core.log.Log.getExceptionStr(e));
        }
    };
    PyCodeCompletion.onCompletionRecursionException = new ICallback<Object, CompletionRecursionException>() {

        @Override
        public Object call(CompletionRecursionException e) {
            throw new RuntimeException("Recursion error:" + org.python.pydev.shared_core.log.Log.getExceptionStr(e));
        }
    };
}
Also used : CompletionRecursionException(org.python.pydev.core.structure.CompletionRecursionException) PyCodeCompletion(org.python.pydev.ast.codecompletion.PyCodeCompletion) CompletionRecursionException(org.python.pydev.core.structure.CompletionRecursionException) Refactorer(com.python.pydev.analysis.refactoring.refactorer.Refactorer)

Example 2 with PyCodeCompletion

use of org.python.pydev.ast.codecompletion.PyCodeCompletion in project Pydev by fabioz.

the class HierarchyTestCase method setUp.

/*
     * @see TestCase#setUp()
     */
@Override
public void setUp() throws Exception {
    super.setUp();
    CompiledModule.COMPILED_MODULES_ENABLED = true;
    this.restorePythonPath(TestDependent.getCompletePythonLib(true, isPython3Test()) + "|" + file.getParent(), false);
    codeCompletion = new PyCodeCompletion();
    // we don't want to start it more than once
    if (shell == null) {
        shell = PythonShellTest.startShell();
    }
    AbstractShell.putServerShell(nature, AbstractShell.getShellId(), shell);
}
Also used : PyCodeCompletion(org.python.pydev.ast.codecompletion.PyCodeCompletion)

Example 3 with PyCodeCompletion

use of org.python.pydev.ast.codecompletion.PyCodeCompletion in project Pydev by fabioz.

the class ParameterCompletionTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    CompiledModule.COMPILED_MODULES_ENABLED = false;
    useOriginalRequestCompl = true;
    participant = new CtxParticipant();
    ExtensionHelper.testingParticipants = new HashMap<String, List<Object>>();
    ArrayList<Object> participants = new ArrayList<Object>();
    /*IPyDevCompletionParticipant*/
    participants.add(participant);
    ExtensionHelper.testingParticipants.put(ExtensionHelper.PYDEV_COMPLETION, participants);
    codeCompletion = new PyCodeCompletion();
    this.restorePythonPath(false);
    final IEclipsePreferences prefs = new InMemoryEclipsePreferences();
    PyCodeCompletionPreferences.getPreferencesForTests = () -> prefs;
    prefs.putBoolean(PyCodeCompletionPreferences.MATCH_BY_SUBSTRING_IN_CODE_COMPLETION, false);
}
Also used : IEclipsePreferences(org.eclipse.core.runtime.preferences.IEclipsePreferences) PyCodeCompletion(org.python.pydev.ast.codecompletion.PyCodeCompletion) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) CtxParticipant(com.python.pydev.codecompletion.ctxinsensitive.CtxParticipant) InMemoryEclipsePreferences(org.python.pydev.shared_core.preferences.InMemoryEclipsePreferences)

Example 4 with PyCodeCompletion

use of org.python.pydev.ast.codecompletion.PyCodeCompletion in project Pydev by fabioz.

the class PythonCompletionParametersTest method setUp.

/*
     * @see TestCase#setUp()
     */
@Override
public void setUp() throws Exception {
    super.setUp();
    CompiledModule.COMPILED_MODULES_ENABLED = false;
    this.restorePythonPath(false);
    codeCompletion = new PyCodeCompletion();
}
Also used : PyCodeCompletion(org.python.pydev.ast.codecompletion.PyCodeCompletion)

Example 5 with PyCodeCompletion

use of org.python.pydev.ast.codecompletion.PyCodeCompletion in project Pydev by fabioz.

the class AbstractJythonWorkbenchTests method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    // Set Interpreter Configuration Auto to DONT_ASK. We can't have the
    // Python not configured dialog open in the tests as that causes the tests to hang
    IPreferenceStore store = PydevPlugin.getDefault().getPreferenceStore();
    store.setValue(InterpreterGeneralPreferences.NOTIFY_NO_INTERPRETER_PY, false);
    store.setValue(InterpreterGeneralPreferences.NOTIFY_NO_INTERPRETER_JY, false);
    store.setValue(InterpreterGeneralPreferences.NOTIFY_NO_INTERPRETER_IP, false);
    CompiledModule.COMPILED_MODULES_ENABLED = true;
    this.restorePythonPath(false);
    codeCompletion = new PyCodeCompletion();
}
Also used : PyCodeCompletion(org.python.pydev.ast.codecompletion.PyCodeCompletion) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore)

Aggregations

PyCodeCompletion (org.python.pydev.ast.codecompletion.PyCodeCompletion)11 CtxParticipant (com.python.pydev.codecompletion.ctxinsensitive.CtxParticipant)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 CompletionRecursionException (org.python.pydev.core.structure.CompletionRecursionException)2 Refactorer (com.python.pydev.analysis.refactoring.refactorer.Refactorer)1 IEclipsePreferences (org.eclipse.core.runtime.preferences.IEclipsePreferences)1 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)1 IPyCodeCompletion (org.python.pydev.ast.codecompletion.IPyCodeCompletion)1 DefaultCompletionProposalFactory (org.python.pydev.editor.codecompletion.proposals.DefaultCompletionProposalFactory)1 InMemoryEclipsePreferences (org.python.pydev.shared_core.preferences.InMemoryEclipsePreferences)1