From 77d41631db8dad1bb0ed9debe75a41f5c86130b9 Mon Sep 17 00:00:00 2001 From: Jan Skrasek Date: Thu, 26 Oct 2023 19:57:41 +0200 Subject: [PATCH] add support for data object --- dist/Kotlin.JSON-tmLanguage | 2 +- dist/Kotlin.YAML-tmLanguage | 2 +- dist/Kotlin.tmLanguage | 2 +- src/keywords.YAML-tmLanguage | 2 +- test/Objects.test.kt | 4 ++++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dist/Kotlin.JSON-tmLanguage b/dist/Kotlin.JSON-tmLanguage index 561dd98..8132a73 100644 --- a/dist/Kotlin.JSON-tmLanguage +++ b/dist/Kotlin.JSON-tmLanguage @@ -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" } ] diff --git a/dist/Kotlin.YAML-tmLanguage b/dist/Kotlin.YAML-tmLanguage index a1b65b3..5ca45a9 100644 --- a/dist/Kotlin.YAML-tmLanguage +++ b/dist/Kotlin.YAML-tmLanguage @@ -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: diff --git a/dist/Kotlin.tmLanguage b/dist/Kotlin.tmLanguage index 292df8d..1c8337f 100644 --- a/dist/Kotlin.tmLanguage +++ b/dist/Kotlin.tmLanguage @@ -978,7 +978,7 @@ match - \b(companion|object)\b + \b(companion|object|data\s+object)\b name storage.type.kotlin diff --git a/src/keywords.YAML-tmLanguage b/src/keywords.YAML-tmLanguage index f2b6563..11861bf 100644 --- a/src/keywords.YAML-tmLanguage +++ b/src/keywords.YAML-tmLanguage @@ -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: diff --git a/test/Objects.test.kt b/test/Objects.test.kt index 9693b03..67a294c 100644 --- a/test/Objects.test.kt +++ b/test/Objects.test.kt @@ -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