Skip to content

Commit 1c58f51

Browse files
committed
feat(devin-lang): add highlighting for property values #101
The DevInSyntaxHighlighter now correctly highlights property values in addition to agent starts and command IDs, enhancing code readability and developer experience. The DevInCustomVariableFoldingBuilder now considers both variable IDs and property values when building folding descriptors, ensuring a more comprehensive folding experience for users of the DevInT language.
1 parent 26f823f commit 1c58f51

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

exts/devin-lang/src/main/kotlin/cc/unitmesh/devti/language/folding/DevInCustomVariableFoldingBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class DevInCustomVariableFoldingBuilder : FoldingBuilderEx() {
1717
val descriptors = mutableListOf<FoldingDescriptor>()
1818
root.accept(object : PsiElementVisitor() {
1919
override fun visitElement(element: PsiElement) {
20-
if (element.elementType == DevInTypes.VARIABLE_ID) {
20+
if (element.elementType == DevInTypes.VARIABLE_ID || element.elementType == DevInTypes.PROPERTY_VALUE) {
2121
descriptors.add(FoldingDescriptor(element.node, element.textRange))
2222
}
2323
element.acceptChildren(this)

exts/devin-lang/src/main/kotlin/cc/unitmesh/devti/language/highlight/DevInSyntaxHighlighter.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class DevInSyntaxHighlighter : SyntaxHighlighter {
2525

2626
ATTRIBUTES[DevInTypes.AGENT_START] = DefaultLanguageHighlighterColors.KEYWORD
2727
ATTRIBUTES[DevInTypes.AGENT_ID] = DefaultLanguageHighlighterColors.NUMBER
28+
ATTRIBUTES[DevInTypes.PROPERTY_VALUE] = DefaultLanguageHighlighterColors.CONSTANT
2829

2930
ATTRIBUTES[DevInTypes.COMMAND_START] = DefaultLanguageHighlighterColors.KEYWORD
3031
ATTRIBUTES[DevInTypes.COMMAND_ID] = DefaultLanguageHighlighterColors.NUMBER

0 commit comments

Comments
 (0)