Skip to content

Commit 1b39899

Browse files
committed
Replace custom HighlightSeverity with INFORMATION
1 parent d7ec651 commit 1b39899

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

src/main/kotlin/org/rust/ide/annotator/RsCfgDisabledCodeAnnotator.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class RsCfgDisabledCodeAnnotator : AnnotatorBase() {
2424

2525
private fun AnnotationHolder.createCondDisabledAnnotation() {
2626
val color = RsColor.CFG_DISABLED_CODE
27-
val severity = if (isUnitTestMode) color.testSeverity else CONDITIONALLY_DISABLED_CODE_SEVERITY
27+
val severity = if (isUnitTestMode) color.testSeverity else HighlightSeverity.INFORMATION
2828

2929
newAnnotation(severity, RsBundle.message("text.conditionally.disabled.code"))
3030
.textAttributes(color.textAttributesKey)
@@ -43,10 +43,5 @@ class RsCfgDisabledCodeAnnotator : AnnotatorBase() {
4343
&& element.isDisabledCfgAttrAttribute(crate)
4444
&& element.owner?.isEnabledByCfgSelfOrInAttrProcMacroBody(crate) == true
4545
}
46-
47-
val CONDITIONALLY_DISABLED_CODE_SEVERITY = HighlightSeverity(
48-
"CONDITIONALLY_DISABLED_CODE",
49-
HighlightSeverity.INFORMATION.myVal + 1
50-
)
5146
}
5247
}

src/main/kotlin/org/rust/ide/annotator/RsHighlightingMutableAnnotator.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,12 @@ class RsHighlightingMutableAnnotator : AnnotatorBase() {
6161
}
6262

6363
private fun addHighlightingAnnotation(holder: AnnotationHolder, target: PsiElement, key: RsColor) {
64-
val annotationSeverity = if (isUnitTestMode) key.testSeverity else MUTABLE_HIGHLIGHTING
64+
val annotationSeverity = if (isUnitTestMode) key.testSeverity else HighlightSeverity.INFORMATION
6565

6666
holder.newSilentAnnotation(annotationSeverity)
6767
.range(target.textRange)
6868
.textAttributes(key.textAttributesKey).create()
6969
}
70-
71-
companion object {
72-
private val MUTABLE_HIGHLIGHTING = HighlightSeverity(
73-
"MUTABLE_HIGHLIGHTING",
74-
HighlightSeverity.INFORMATION.myVal + 1
75-
)
76-
}
7770
}
7871

7972
private val RsElement.isMut: Boolean

src/main/kotlin/org/rust/ide/annotator/RsMacroExpansionHighlightingPass.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import com.intellij.codeInsight.daemon.impl.*
1212
import com.intellij.lang.annotation.Annotation
1313
import com.intellij.lang.annotation.AnnotationSession
1414
import com.intellij.lang.annotation.Annotator
15+
import com.intellij.lang.annotation.HighlightSeverity
1516
import com.intellij.openapi.editor.Document
1617
import com.intellij.openapi.editor.Editor
1718
import com.intellij.openapi.progress.ProgressIndicator
@@ -179,7 +180,7 @@ class RsMacroExpansionHighlightingPass(
179180

180181
for (mappedRange in cfgDisabledMappedRanges) {
181182
val color = RsColor.CFG_DISABLED_CODE
182-
val severity = if (isUnitTestMode) color.testSeverity else RsCfgDisabledCodeAnnotator.CONDITIONALLY_DISABLED_CODE_SEVERITY
183+
val severity = if (isUnitTestMode) color.testSeverity else HighlightSeverity.INFORMATION
183184
results += HighlightInfo.newHighlightInfo(HighlightInfoType.INFORMATION)
184185
.severity(severity)
185186
.textAttributes(color.textAttributesKey)

0 commit comments

Comments
 (0)