Search in sources :

Example 1 with PyCodeInsightSettings

use of com.jetbrains.python.codeInsight.PyCodeInsightSettings in project intellij-community by JetBrains.

the class PyIntentionTest method testNumpyDocStubWithTypes.

// PY-4717
public void testNumpyDocStubWithTypes() {
    final PyCodeInsightSettings codeInsightSettings = PyCodeInsightSettings.getInstance();
    final boolean oldInsertTypeDocStub = codeInsightSettings.INSERT_TYPE_DOCSTUB;
    codeInsightSettings.INSERT_TYPE_DOCSTUB = true;
    try {
        doDocStubTest(DocStringFormat.NUMPY);
    } finally {
        codeInsightSettings.INSERT_TYPE_DOCSTUB = oldInsertTypeDocStub;
    }
}
Also used : PyCodeInsightSettings(com.jetbrains.python.codeInsight.PyCodeInsightSettings)

Example 2 with PyCodeInsightSettings

use of com.jetbrains.python.codeInsight.PyCodeInsightSettings in project intellij-community by JetBrains.

the class PyEditingTest method testSpaceDocstringStubNoReturnSectionForInit.

// PY-15532
public void testSpaceDocstringStubNoReturnSectionForInit() {
    final PyCodeInsightSettings codeInsightSettings = PyCodeInsightSettings.getInstance();
    final boolean oldInsertTypeDocStub = codeInsightSettings.INSERT_TYPE_DOCSTUB;
    codeInsightSettings.INSERT_TYPE_DOCSTUB = true;
    try {
        doDocStringTypingTest(" ", DocStringFormat.GOOGLE);
    } finally {
        codeInsightSettings.INSERT_TYPE_DOCSTUB = oldInsertTypeDocStub;
    }
}
Also used : PyCodeInsightSettings(com.jetbrains.python.codeInsight.PyCodeInsightSettings)

Example 3 with PyCodeInsightSettings

use of com.jetbrains.python.codeInsight.PyCodeInsightSettings in project intellij-community by JetBrains.

the class PyClassNameCompletionTest method doTestWithoutFromImport.

private void doTestWithoutFromImport() {
    final PyCodeInsightSettings settings = PyCodeInsightSettings.getInstance();
    boolean oldValue = settings.PREFER_FROM_IMPORT;
    settings.PREFER_FROM_IMPORT = false;
    try {
        doTest();
    } finally {
        settings.PREFER_FROM_IMPORT = oldValue;
    }
}
Also used : PyCodeInsightSettings(com.jetbrains.python.codeInsight.PyCodeInsightSettings)

Example 4 with PyCodeInsightSettings

use of com.jetbrains.python.codeInsight.PyCodeInsightSettings in project intellij-community by JetBrains.

the class PyQuickFixTest method testQualifyByImport.

public void testQualifyByImport() {
    final PyCodeInsightSettings settings = PyCodeInsightSettings.getInstance();
    boolean oldPreferFrom = settings.PREFER_FROM_IMPORT;
    boolean oldHighlightUnused = settings.HIGHLIGHT_UNUSED_IMPORTS;
    settings.PREFER_FROM_IMPORT = false;
    settings.HIGHLIGHT_UNUSED_IMPORTS = false;
    try {
        doInspectionTest(new String[] { "QualifyByImport.py", "QualifyByImportFoo.py" }, PyUnresolvedReferencesInspection.class, PyBundle.message("ACT.qualify.with.module"), true, true);
    } finally {
        settings.PREFER_FROM_IMPORT = oldPreferFrom;
        settings.HIGHLIGHT_UNUSED_IMPORTS = oldHighlightUnused;
    }
}
Also used : PyCodeInsightSettings(com.jetbrains.python.codeInsight.PyCodeInsightSettings)

Example 5 with PyCodeInsightSettings

use of com.jetbrains.python.codeInsight.PyCodeInsightSettings in project intellij-community by JetBrains.

the class PyQuickFixTest method testAddToImportFromList.

public void testAddToImportFromList() {
    final PyCodeInsightSettings settings = PyCodeInsightSettings.getInstance();
    boolean oldHighlightUnused = settings.HIGHLIGHT_UNUSED_IMPORTS;
    settings.HIGHLIGHT_UNUSED_IMPORTS = false;
    try {
        doInspectionTest(new String[] { "AddToImportFromList.py", "AddToImportFromFoo.py" }, PyUnresolvedReferencesInspection.class, "Import 'add_to_import_test_unique_name() from AddToImportFromFoo'", true, true);
    } finally {
        settings.HIGHLIGHT_UNUSED_IMPORTS = oldHighlightUnused;
    }
}
Also used : PyCodeInsightSettings(com.jetbrains.python.codeInsight.PyCodeInsightSettings)

Aggregations

PyCodeInsightSettings (com.jetbrains.python.codeInsight.PyCodeInsightSettings)9 CodeInsightSettings (com.intellij.codeInsight.CodeInsightSettings)1 PyDocumentationSettings (com.jetbrains.python.documentation.PyDocumentationSettings)1