aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorr001 <rob@nyar.eu>2024-08-28 04:51:27 -0300
committerGitHub <noreply@github.com>2024-08-28 16:51:27 +0900
commit5071ca777ce37df866305cbd272cd4ef7c30624a (patch)
treebebf0fcfb1838ded2417144d07b04dcf1dee0e78
parentci: bump stylua-action to v4 (diff)
downloadnvim-treesitter-5071ca777ce37df866305cbd272cd4ef7c30624a.tar
nvim-treesitter-5071ca777ce37df866305cbd272cd4ef7c30624a.tar.gz
nvim-treesitter-5071ca777ce37df866305cbd272cd4ef7c30624a.tar.bz2
nvim-treesitter-5071ca777ce37df866305cbd272cd4ef7c30624a.tar.lz
nvim-treesitter-5071ca777ce37df866305cbd272cd4ef7c30624a.tar.xz
nvim-treesitter-5071ca777ce37df866305cbd272cd4ef7c30624a.tar.zst
nvim-treesitter-5071ca777ce37df866305cbd272cd4ef7c30624a.zip
fix(leo): update queries (#7086)
* small bugfixes of variables, records, and struct highlighting * lockfile.json update * fixed @constant bug, and added self.address, and network.id as builtins to highlight * fixed associated function calls
-rw-r--r--lockfile.json2
-rw-r--r--queries/leo/highlights.scm35
2 files changed, 25 insertions, 12 deletions
diff --git a/lockfile.json b/lockfile.json
index 66d0fb6cd..e7c370f9c 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -393,7 +393,7 @@
"revision": "8a841fb20ce683bfbb3469e6ba67f2851cfdf94a"
},
"leo": {
- "revision": "f5ecaaa869a845e689399092cb9a61feca66cf12"
+ "revision": "07fbb1d1dd193cf9995945e5412aff61c95c67e0"
},
"linkerscript": {
"revision": "f99011a3554213b654985a4b0a65b3b032ec4621"
diff --git a/queries/leo/highlights.scm b/queries/leo/highlights.scm
index e33aed7bc..53db26ab5 100644
--- a/queries/leo/highlights.scm
+++ b/queries/leo/highlights.scm
@@ -1,7 +1,3 @@
-(variable_identifier) @variable
-
-(constant_identifier) @constant
-
[
"assert"
"assert_eq"
@@ -31,6 +27,8 @@
"self" @variable.builtin
+"network" @variable.builtin
+
"async" @keyword.coroutine
[
@@ -115,7 +113,15 @@
(boolean_literal) @boolean
(constant_declaration
- (identifier) @constant)
+ (identifier
+ (constant_identifier) @constant))
+
+(variable
+ (constant_identifier) @constant)
+
+(associated_constant) @constant
+
+(variable) @variable
[
(program_id)
@@ -124,7 +130,7 @@
;record declaration
(record_declaration
- (identifier) @variable.member)
+ (identifier) @type.definition)
;struct component
(struct_component_declaration
@@ -132,18 +138,26 @@
(type) @type
-(associated_constant) @constant
-
[
(block_height)
+ (self_address)
(self_caller)
(self_signer)
+ (network_id)
] @constant.builtin
(free_function_call
(locator
(identifier) @function))
+(associated_function_call
+ (named_type
+ (identifier
+ (constant_identifier) @function)))
+
+(associated_function_call
+ (identifier) @function.call)
+
(record_type
(locator
(identifier) @variable.member))
@@ -173,11 +187,10 @@
(identifier) @variable.parameter)
(struct_declaration
- name: (identifier) @variable.member)
+ name: (identifier) @type.definition)
(variable_declaration
- (identifier_or_identifiers
- (identifier) @variable))
+ (identifier) @variable)
[
(address_literal)