Search in sources :

Example 11 with PyDocumentationSettings

use of com.jetbrains.python.documentation.PyDocumentationSettings in project intellij-community by JetBrains.

the class PySmartEnterTest method testDocEpytext.

public void testDocEpytext() {
    CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance();
    boolean oldStubOnEnter = codeInsightSettings.JAVADOC_STUB_ON_ENTER;
    codeInsightSettings.JAVADOC_STUB_ON_ENTER = true;
    PyDocumentationSettings documentationSettings = PyDocumentationSettings.getInstance(myFixture.getModule());
    documentationSettings.setFormat(DocStringFormat.EPYTEXT);
    try {
        doTest();
    } finally {
        documentationSettings.setFormat(DocStringFormat.PLAIN);
        codeInsightSettings.JAVADOC_STUB_ON_ENTER = oldStubOnEnter;
    }
}
Also used : CodeInsightSettings(com.intellij.codeInsight.CodeInsightSettings) PyCodeInsightSettings(com.jetbrains.python.codeInsight.PyCodeInsightSettings) PyDocumentationSettings(com.jetbrains.python.documentation.PyDocumentationSettings)

Example 12 with PyDocumentationSettings

use of com.jetbrains.python.documentation.PyDocumentationSettings in project intellij-community by JetBrains.

the class PythonHighlightingTest method testDocstring.

public void testDocstring() {
    // PY-8025
    PyDocumentationSettings documentationSettings = PyDocumentationSettings.getInstance(myFixture.getModule());
    documentationSettings.setFormat(DocStringFormat.REST);
    try {
        doTest(false, true);
    } finally {
        documentationSettings.setFormat(DocStringFormat.PLAIN);
    }
}
Also used : PyDocumentationSettings(com.jetbrains.python.documentation.PyDocumentationSettings)

Example 13 with PyDocumentationSettings

use of com.jetbrains.python.documentation.PyDocumentationSettings in project intellij-community by JetBrains.

the class PythonCompletionTest method testEpydocTagsMiddle.

public void testEpydocTagsMiddle() {
    final PyDocumentationSettings settings = PyDocumentationSettings.getInstance(myFixture.getModule());
    settings.setFormat(DocStringFormat.EPYTEXT);
    try {
        myFixture.configureByFile("epydocTagsMiddle.py");
        myFixture.completeBasic();
        myFixture.checkResultByFile("epydocTagsMiddle.after.py");
    } finally {
        settings.setFormat(DocStringFormat.PLAIN);
    }
}
Also used : PyDocumentationSettings(com.jetbrains.python.documentation.PyDocumentationSettings)

Example 14 with PyDocumentationSettings

use of com.jetbrains.python.documentation.PyDocumentationSettings in project intellij-community by JetBrains.

the class PythonCompletionTest method testEpydocParamTag.

public void testEpydocParamTag() {
    final PyDocumentationSettings settings = PyDocumentationSettings.getInstance(myFixture.getModule());
    settings.setFormat(DocStringFormat.EPYTEXT);
    try {
        doTest();
    } finally {
        settings.setFormat(DocStringFormat.PLAIN);
    }
}
Also used : PyDocumentationSettings(com.jetbrains.python.documentation.PyDocumentationSettings)

Aggregations

PyDocumentationSettings (com.jetbrains.python.documentation.PyDocumentationSettings)14 CodeInsightSettings (com.intellij.codeInsight.CodeInsightSettings)3 PyCodeInsightSettings (com.jetbrains.python.codeInsight.PyCodeInsightSettings)3 DocStringFormat (com.jetbrains.python.documentation.docstrings.DocStringFormat)2 LookupElement (com.intellij.codeInsight.lookup.LookupElement)1 ModalityState (com.intellij.openapi.application.ModalityState)1 Module (com.intellij.openapi.module.Module)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)1 PythonDocumentationProvider (com.jetbrains.python.documentation.PythonDocumentationProvider)1 PythonSdkType (com.jetbrains.python.sdk.PythonSdkType)1 Collection (java.util.Collection)1 List (java.util.List)1 Nullable (org.jetbrains.annotations.Nullable)1