mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 20:41:22 +07:00
PY-40480 Lift literal type completion results higher in a lookup
GitOrigin-RevId: 51fcf9b611250104fdeff04284e908cce1164560
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e401164f05
commit
01d14fab4e
@@ -1,6 +1,7 @@
|
||||
package com.jetbrains.python.codeInsight.completion
|
||||
|
||||
import com.intellij.codeInsight.completion.*
|
||||
import com.intellij.codeInsight.completion.ml.MLRankingIgnorable
|
||||
import com.intellij.codeInsight.lookup.LookupElementBuilder
|
||||
import com.intellij.patterns.PlatformPatterns.psiElement
|
||||
import com.intellij.patterns.StandardPatterns.or
|
||||
@@ -71,11 +72,13 @@ private class PyLiteralTypeCompletionProvider : CompletionProvider<CompletionPar
|
||||
.filterIsInstance<PyStringLiteralExpression>()
|
||||
.forEach {
|
||||
result.addElement(
|
||||
PrioritizedLookupElement.withPriority(
|
||||
LookupElementBuilder
|
||||
.create(lookupString(it))
|
||||
.withIcon(IconManager.getInstance().getPlatformIcon(PlatformIcons.Parameter)),
|
||||
PythonCompletionWeigher.PRIORITY_WEIGHT.toDouble()
|
||||
MLRankingIgnorable.wrap(
|
||||
PrioritizedLookupElement.withPriority(
|
||||
LookupElementBuilder
|
||||
.create(lookupString(it))
|
||||
.withIcon(IconManager.getInstance().getPlatformIcon(PlatformIcons.Parameter)),
|
||||
PythonCompletionWeigher.PRIORITY_WEIGHT.toDouble()
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user