mirror of
https://github.com/chylex/IntelliJ-Keyboard-Master.git
synced 2024-11-25 10:42:46 +01:00
Compare commits
2 Commits
15e459d885
...
a0500a8666
Author | SHA1 | Date | |
---|---|---|---|
a0500a8666 | |||
9953e3b057 |
@ -8,7 +8,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.chylex.intellij.keyboardmaster"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -16,7 +16,7 @@ repositories {
|
||||
|
||||
intellij {
|
||||
type.set("IU")
|
||||
version.set("2023.2")
|
||||
version.set("233.11799-EAP-CANDIDATE-SNAPSHOT")
|
||||
updateSinceUntilBuild.set(false)
|
||||
|
||||
plugins.add("com.intellij.java")
|
||||
@ -35,7 +35,7 @@ dependencies {
|
||||
}
|
||||
|
||||
tasks.patchPluginXml {
|
||||
sinceBuild.set("232")
|
||||
sinceBuild.set("233.11799.30")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
|
@ -1,10 +1,13 @@
|
||||
package com.chylex.intellij.keyboardmaster.feature.codeCompletion
|
||||
|
||||
import com.intellij.codeInsight.lookup.Lookup
|
||||
import com.intellij.codeInsight.lookup.LookupElement
|
||||
import com.intellij.codeInsight.lookup.LookupElementPresentation
|
||||
import com.intellij.codeInsight.lookup.LookupManagerListener
|
||||
import com.intellij.codeInsight.lookup.impl.LookupCellRenderer.ItemPresentationCustomizer
|
||||
import com.intellij.codeInsight.lookup.impl.LookupImpl
|
||||
import com.intellij.openapi.util.Key
|
||||
import javax.swing.Icon
|
||||
|
||||
/**
|
||||
* Adds hints to code completion popup items with the character that selects the item.
|
||||
@ -37,7 +40,8 @@ class CodeCompletionPopupListener : LookupManagerListener {
|
||||
newLookup.putUserData(IS_MODIFIED_KEY, true)
|
||||
|
||||
@Suppress("UnstableApiUsage")
|
||||
newLookup.addPresentationCustomizer { item, presentation ->
|
||||
newLookup.addPresentationCustomizer(object : ItemPresentationCustomizer {
|
||||
override fun customizePresentation(item: LookupElement, presentation: LookupElementPresentation): LookupElementPresentation {
|
||||
val itemList = newLookup.list.model
|
||||
val itemCount = itemList.size
|
||||
val offset = getPageOffset(newLookup)
|
||||
@ -52,11 +56,16 @@ class CodeCompletionPopupListener : LookupManagerListener {
|
||||
val customized = LookupElementPresentation()
|
||||
customized.copyFrom(presentation)
|
||||
customized.appendTailTextItalic(CodeCompletionPopupConfiguration.getHintText(index), true)
|
||||
return@addPresentationCustomizer customized
|
||||
return customized
|
||||
}
|
||||
}
|
||||
|
||||
presentation
|
||||
}
|
||||
return presentation
|
||||
}
|
||||
|
||||
override fun customizeEmptyIcon(icon: Icon): Icon {
|
||||
return icon
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user