Skip to content

Commit 34db2c0

Browse files
committed
feat: mark line numbers as weak
1 parent 32f99d2 commit 34db2c0

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/main/kotlin/com/github/xepozz/php_opcodes_language/language/PHPOpAnnotator.kt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import com.github.xepozz.php_opcodes_language.language.psi.PHPOpParameter
1010
import com.github.xepozz.php_opcodes_language.language.psi.PHPOpParenParameter
1111
import com.github.xepozz.php_opcodes_language.language.psi.PHPOpPropertyHookName
1212
import com.github.xepozz.php_opcodes_language.language.psi.PHPOpPropertyName
13+
import com.github.xepozz.php_opcodes_language.language.psi.PHPOpStatement
1314
import com.github.xepozz.php_opcodes_language.language.psi.PHPOpVarName
15+
import com.intellij.codeInspection.ProblemHighlightType
1416
import com.intellij.lang.annotation.AnnotationHolder
1517
import com.intellij.lang.annotation.Annotator
1618
import com.intellij.lang.annotation.HighlightSeverity
@@ -28,10 +30,17 @@ class PHPOpAnnotator : Annotator {
2830
}
2931

3032
is PHPOpLineNumber -> {
31-
holder.newSilentAnnotation(HighlightSeverity.INFORMATION)
32-
.range(element)
33-
.textAttributes(PhpHighlightingData.NUMBER)
34-
.create()
33+
if (element.parent is PHPOpStatement) {
34+
holder.newSilentAnnotation(HighlightSeverity.INFORMATION)
35+
.range(element)
36+
.highlightType(ProblemHighlightType.LIKE_UNUSED_SYMBOL)
37+
.create()
38+
} else {
39+
holder.newSilentAnnotation(HighlightSeverity.INFORMATION)
40+
.range(element)
41+
.textAttributes(PhpHighlightingData.NUMBER)
42+
.create()
43+
}
3544
}
3645

3746
is PHPOpParameter -> {

0 commit comments

Comments
 (0)