File tree 2 files changed +23
-0
lines changed
exts/devins-lang/src/main
kotlin/cc/unitmesh/devti/language/highlight
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ package cc.unitmesh.devti.language.highlight
2
+
3
+ import cc.unitmesh.devti.language.psi.DevInTypes
4
+ import com.intellij.lang.annotation.AnnotationHolder
5
+ import com.intellij.lang.annotation.Annotator
6
+ import com.intellij.lang.annotation.HighlightSeverity
7
+ import com.intellij.openapi.editor.DefaultLanguageHighlighterColors
8
+ import com.intellij.psi.PsiElement
9
+ import com.intellij.psi.util.PsiUtilCore
10
+
11
+ class DevInHighlightingAnnotator : Annotator {
12
+ override fun annotate (element : PsiElement , holder : AnnotationHolder ) {
13
+ when (PsiUtilCore .getElementType(element)) {
14
+ DevInTypes .IDENTIFIER -> {
15
+ holder.newSilentAnnotation(HighlightSeverity .INFORMATION )
16
+ .textAttributes(DefaultLanguageHighlighterColors .IDENTIFIER )
17
+ .create()
18
+ }
19
+ }
20
+ }
21
+ }
Original file line number Diff line number Diff line change 24
24
<lang .syntaxHighlighterFactory language =" DevIn"
25
25
implementationClass =" cc.unitmesh.devti.language.highlight.DevInSyntaxHighlighterFactory" />
26
26
27
+ <annotator language =" Shire" implementationClass =" cc.unitmesh.devti.language.highlight.DevInHighlightingAnnotator" />
28
+
27
29
<lang .ast.factory language =" DevIn"
28
30
implementationClass =" cc.unitmesh.devti.language.DevInAstFactory" />
29
31
You can’t perform that action at this time.
0 commit comments