Skip to content

Commit

Permalink
add support for data object
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Oct 26, 2023
1 parent 8ba572c commit 77d4163
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/Kotlin.JSON-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@
"name": "entity.name.function.constructor"
},
{
"match": "\\b(companion|object)\\b",
"match": "\\b(companion|object|data\\s+object)\\b",
"name": "storage.type.kotlin"
}
]
Expand Down
2 changes: 1 addition & 1 deletion dist/Kotlin.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ repository:
match: \b(constructor|init)\b
name: entity.name.function.constructor
-
match: \b(companion|object)\b
match: \b(companion|object|data\s+object)\b
name: storage.type.kotlin
operators:
patterns:
Expand Down
2 changes: 1 addition & 1 deletion dist/Kotlin.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@
</dict>
<dict>
<key>match</key>
<string>\b(companion|object)\b</string>
<string>\b(companion|object|data\s+object)\b</string>
<key>name</key>
<string>storage.type.kotlin</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion src/keywords.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ repository:
match: \b(constructor|init)\b
name: entity.name.function.constructor
-
match: \b(companion|object)\b
match: \b(companion|object|data\s+object)\b
name: storage.type.kotlin
operators:
patterns:
Expand Down
4 changes: 4 additions & 0 deletions test/Objects.test.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@
})
//^ meta.group.kotlin meta.block.kotlin punctuation.section.group.end.kotlin
// ^ meta.group.kotlin punctuation.section.group.end.kotlin

data object Foo
// <------- source.kotlin storage.type.kotlin
// ^^^ source.kotlin entity.name.type.class.kotlin

0 comments on commit 77d4163

Please sign in to comment.