From d23192fb175b39aecf5eadb964d38432fea83dbe Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Sat, 20 Jan 2024 18:17:24 +0200 Subject: fix(godot_resource): improve highlights And add a comment injection --- queries/godot_resource/highlights.scm | 30 ++++++++++++++++++++++++------ queries/godot_resource/injections.scm | 2 ++ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 queries/godot_resource/injections.scm diff --git a/queries/godot_resource/highlights.scm b/queries/godot_resource/highlights.scm index 764818234..15cbadd10 100644 --- a/queries/godot_resource/highlights.scm +++ b/queries/godot_resource/highlights.scm @@ -1,7 +1,16 @@ -(identifier) @type.builtin +(identifier) @variable + +(section + (identifier) @tag) + +(section + [ + "[" + "]" + ] @tag.delimiter) (attribute - (identifier) @property) + (identifier) @tag.attribute) (property (path) @property) @@ -15,13 +24,20 @@ (float) @number.float -(true) @constant.builtin +[ + (true) + (false) +] @boolean -(false) @constant.builtin +(null) @constant.builtin + +(array + [ + "[" + "]" + ] @punctuation.bracket) [ - "[" - "]" "(" ")" "{" @@ -29,3 +45,5 @@ ] @punctuation.bracket "=" @operator + +(comment) @comment @spell diff --git a/queries/godot_resource/injections.scm b/queries/godot_resource/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/queries/godot_resource/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) -- cgit v1.3.1