mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-46321 Suggest "pycon" as the main alias for Python console code on GitHub
GitOrigin-RevId: 892043c4a320ebb6618cc3b526f2fdb72ae5057f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6d8428ee4e
commit
f04f102683
+9
-1
@@ -2,6 +2,7 @@ package com.jetbrains.python.markdown
|
||||
|
||||
import com.intellij.codeInsight.completion.CompletionParameters
|
||||
import com.intellij.codeInsight.lookup.LookupElement
|
||||
import com.intellij.codeInsight.lookup.LookupElementBuilder
|
||||
import com.intellij.lang.Language
|
||||
import com.jetbrains.python.PythonLanguage
|
||||
import com.jetbrains.python.documentation.doctest.PyDocstringLanguageDialect
|
||||
@@ -23,5 +24,12 @@ class PyCodeFenceLanguageProvider : CodeFenceLanguageProvider {
|
||||
else -> null
|
||||
}
|
||||
|
||||
override fun getCompletionVariantsForInfoString(parameters: CompletionParameters): List<LookupElement> = emptyList()
|
||||
override fun getCompletionVariantsForInfoString(parameters: CompletionParameters): List<LookupElement> {
|
||||
return listOf(
|
||||
LookupElementBuilder
|
||||
.create("pycon")
|
||||
.withIcon(PyDocstringLanguageDialect.getInstance().associatedFileType?.icon)
|
||||
.withTypeText("Python console"),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,9 @@ package com.jetbrains.python.markdown
|
||||
|
||||
import com.jetbrains.python.fixtures.PyTestCase
|
||||
|
||||
/**
|
||||
* Tests for [PyCodeFenceLanguageProvider].
|
||||
*/
|
||||
class PyCodeFenceTest : PyTestCase() {
|
||||
fun testPythonInjected() {
|
||||
myFixture.configureByText("a.md", """
|
||||
@@ -121,7 +124,7 @@ class PyCodeFenceTest : PyTestCase() {
|
||||
```
|
||||
""".trimIndent())
|
||||
myFixture.completeBasic()
|
||||
assertContainsElements(lookupStrings, "doctest", "python")
|
||||
assertContainsElements(lookupStrings, "doctest", "python", "pycon")
|
||||
}
|
||||
|
||||
private val lookupStrings: List<String>
|
||||
|
||||
Reference in New Issue
Block a user