aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorObserverOfTime <chronobserver@disroot.org>2024-01-20 18:17:24 +0200
committerChristian Clason <c.clason@uni-graz.at>2024-01-24 13:47:19 +0100
commitd23192fb175b39aecf5eadb964d38432fea83dbe (patch)
tree95b3f59e47e616458c866bd6b224d60863cb2bf8
parentfix(highlights): clean up tag highlights (diff)
downloadnvim-treesitter-d23192fb175b39aecf5eadb964d38432fea83dbe.tar
nvim-treesitter-d23192fb175b39aecf5eadb964d38432fea83dbe.tar.gz
nvim-treesitter-d23192fb175b39aecf5eadb964d38432fea83dbe.tar.bz2
nvim-treesitter-d23192fb175b39aecf5eadb964d38432fea83dbe.tar.lz
nvim-treesitter-d23192fb175b39aecf5eadb964d38432fea83dbe.tar.xz
nvim-treesitter-d23192fb175b39aecf5eadb964d38432fea83dbe.tar.zst
nvim-treesitter-d23192fb175b39aecf5eadb964d38432fea83dbe.zip
fix(godot_resource): improve highlights
And add a comment injection
-rw-r--r--queries/godot_resource/highlights.scm30
-rw-r--r--queries/godot_resource/injections.scm2
2 files changed, 26 insertions, 6 deletions
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"))