Search in sources :

Example 6 with PyCodeInsightSettings

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

the class PyIntentionTest method testGoogleDocStubWithTypes.

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

Example 7 with PyCodeInsightSettings

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

the class PyAutoImportOptions method reset.

public void reset() {
    final PyCodeInsightSettings settings = PyCodeInsightSettings.getInstance();
    myRbFromImport.setSelected(settings.PREFER_FROM_IMPORT);
    myRbImport.setSelected(!settings.PREFER_FROM_IMPORT);
    myShowImportPopupCheckBox.setSelected(settings.SHOW_IMPORT_POPUP);
}
Also used : PyCodeInsightSettings(com.jetbrains.python.codeInsight.PyCodeInsightSettings)

Example 8 with PyCodeInsightSettings

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

the class PyAutoImportOptions method apply.

public void apply() throws ConfigurationException {
    final PyCodeInsightSettings settings = PyCodeInsightSettings.getInstance();
    settings.PREFER_FROM_IMPORT = myRbFromImport.isSelected();
    settings.SHOW_IMPORT_POPUP = myShowImportPopupCheckBox.isSelected();
}
Also used : PyCodeInsightSettings(com.jetbrains.python.codeInsight.PyCodeInsightSettings)

Example 9 with PyCodeInsightSettings

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

the class PySmartEnterTest method testDocTypeRType.

public void testDocTypeRType() {
    CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance();
    boolean oldStubOnEnter = codeInsightSettings.JAVADOC_STUB_ON_ENTER;
    codeInsightSettings.JAVADOC_STUB_ON_ENTER = true;
    PyCodeInsightSettings pyCodeInsightSettings = PyCodeInsightSettings.getInstance();
    boolean oldInsertType = pyCodeInsightSettings.INSERT_TYPE_DOCSTUB;
    pyCodeInsightSettings.INSERT_TYPE_DOCSTUB = true;
    PyDocumentationSettings documentationSettings = PyDocumentationSettings.getInstance(myFixture.getModule());
    documentationSettings.setFormat(DocStringFormat.EPYTEXT);
    try {
        doTest();
    } finally {
        documentationSettings.setFormat(DocStringFormat.PLAIN);
        codeInsightSettings.JAVADOC_STUB_ON_ENTER = oldStubOnEnter;
        pyCodeInsightSettings.INSERT_TYPE_DOCSTUB = oldInsertType;
    }
}
Also used : CodeInsightSettings(com.intellij.codeInsight.CodeInsightSettings) PyCodeInsightSettings(com.jetbrains.python.codeInsight.PyCodeInsightSettings) PyDocumentationSettings(com.jetbrains.python.documentation.PyDocumentationSettings) 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