Commit 48585c9b authored by Petr's avatar Petr Committed by intellij-monorepo-bot
Browse files

PY-40480 Lift literal type completion results higher in a lookup

(cherry picked from commit 51fcf9b611250104fdeff04284e908cce1164560)

IJ-CR-134619

GitOrigin-RevId: e6a9abd58ee9efd90114a5c0800bb4cdd347d4e7
parent 90dac1cd
Showing with 8 additions and 5 deletions
+8 -5
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
......@@ -73,11 +74,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()
)
)
)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment