1
0
mirror of https://github.com/chylex/IntelliJ-Rainbow-Brackets.git synced 2025-05-05 13:34:02 +02:00

Revert "remove some deprecated API usage"

This reverts commit 2b71a61172.
This commit is contained in:
张志豪 2021-03-06 15:14:27 +08:00
parent 48897f6e7a
commit 890df1b02b
3 changed files with 3 additions and 16 deletions
src/main/kotlin/com/github/izhangzhihao/rainbow/brackets

View File

@ -3,7 +3,6 @@ package com.github.izhangzhihao.rainbow.brackets.action
import com.github.izhangzhihao.rainbow.brackets.RainbowInfo
import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings
import com.github.izhangzhihao.rainbow.brackets.util.alphaBlend
import com.github.izhangzhihao.rainbow.brackets.util.create
import com.intellij.codeInsight.highlighting.HighlightManager
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.colors.EditorColorsManager
@ -25,7 +24,7 @@ class ScopeHighlightingAction : AbstractScopeHighlightingAction() {
highlightManager.addRangeHighlight(this,
rainbowInfo.startOffset,
rainbowInfo.endOffset,
create("ScopeHighlightingAction", attributes),
attributes,
false, //hideByTextChange
RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey
highlighters)

View File

@ -3,7 +3,6 @@ package com.github.izhangzhihao.rainbow.brackets.action
import com.github.izhangzhihao.rainbow.brackets.RainbowInfo
import com.github.izhangzhihao.rainbow.brackets.settings.RainbowSettings
import com.github.izhangzhihao.rainbow.brackets.util.alphaBlend
import com.github.izhangzhihao.rainbow.brackets.util.create
import com.intellij.codeInsight.highlighting.HighlightManager
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.colors.EditorColorsManager
@ -29,7 +28,7 @@ class ScopeOutsideHighlightingRestrainAction : AbstractScopeHighlightingAction()
highlightManager.addRangeHighlight(this,
0,
startOffset,
create("ScopeOutsideHighlightingRestrainAction", attributes),
attributes,
false, //hideByTextChange
RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey
highlighters)
@ -41,7 +40,7 @@ class ScopeOutsideHighlightingRestrainAction : AbstractScopeHighlightingAction()
highlightManager.addRangeHighlight(this,
endOffset,
lastOffset,
create("ScopeOutsideHighlightingRestrainAction", attributes),
attributes,
false, //hideByTextChange
RainbowSettings.instance.pressAnyKeyToRemoveTheHighlightingEffects, //hideByAnyKey
highlighters)

View File

@ -1,11 +0,0 @@
package com.github.izhangzhihao.rainbow.brackets.util
import com.intellij.openapi.editor.colors.TextAttributesKey
import com.intellij.openapi.editor.markup.TextAttributes
import kotlin.reflect.jvm.isAccessible
fun create(name: String, textAttributes: TextAttributes): TextAttributesKey {
val cons = TextAttributesKey::class.constructors.first { it.parameters.size == 3 }
cons.isAccessible = true
return cons.call(name, textAttributes, null)
}