aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateus Melchiades <mateusbmelchiades@gmail.com>2022-03-07 11:02:25 -0300
committerStephan Seitz <stephan.seitz@fau.de>2022-03-07 15:51:08 +0100
commitcbfa53db225447ef9bc8f1ce20d210af447b53a6 (patch)
treead36a46bbb91370680cdeb85ff0309fe9464841f
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-cbfa53db225447ef9bc8f1ce20d210af447b53a6.tar
nvim-treesitter-cbfa53db225447ef9bc8f1ce20d210af447b53a6.tar.gz
nvim-treesitter-cbfa53db225447ef9bc8f1ce20d210af447b53a6.tar.bz2
nvim-treesitter-cbfa53db225447ef9bc8f1ce20d210af447b53a6.tar.lz
nvim-treesitter-cbfa53db225447ef9bc8f1ce20d210af447b53a6.tar.xz
nvim-treesitter-cbfa53db225447ef9bc8f1ce20d210af447b53a6.tar.zst
nvim-treesitter-cbfa53db225447ef9bc8f1ce20d210af447b53a6.zip
highlights(vala): Reflect upstream refactor
-rw-r--r--lockfile.json2
-rw-r--r--queries/vala/highlights.scm28
2 files changed, 20 insertions, 10 deletions
diff --git a/lockfile.json b/lockfile.json
index 71a5bd911..3d4543c7b 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -282,7 +282,7 @@
"revision": "e8e8e8dc2745840b036421b4e43286750443cb13"
},
"vala": {
- "revision": "4c31aa2f3c077fa69acc49e5c5a58cd87c704229"
+ "revision": "31a08784cc74b61cb10c5d8314cf8a8aa98aa9a8"
},
"verilog": {
"revision": "8f6b1f357d1231c420404b5f7a368a73c25adfa2"
diff --git a/queries/vala/highlights.scm b/queries/vala/highlights.scm
index 912c7cad6..d1be32530 100644
--- a/queries/vala/highlights.scm
+++ b/queries/vala/highlights.scm
@@ -1,15 +1,24 @@
+; Identifiers
+
+((identifier) @constant (#match? @constant "^[A-Z][A-Z\\d_]+$"))
+
(namespaced_identifier
left: [
- (identifier) @namespace
+ ; Lowercased names in lhs typically are variables, while camel cased are namespaces
+ ; ((identifier) @namespace (#match? @namespace "^[A-Z]+[a-z]+$"))
+ ((identifier) @variable (#match? @variable "^[a-z]"))
(_)
]
right: [
- ((identifier) @constructor (#match? @constructor "^[A-Z]*[a-z]+"))
- ((identifier) @constant (#match? @constant "^[A-Z][A-Z_]*"))
+ ; Lowercased are variables, camel cased are types
+ ; ((identifier) @parameter (#match? @parameter "^[a-z]"))
+ ((identifier) @type (#match? @type "^[A-Z]+[a-z]+$"))
(_)
]
)
+((identifier) @constructor (#match? @constructor "^[A-Z]*[a-z]+"))
+
; Pointers
(address_of_identifier "&" @symbol)
@@ -155,9 +164,6 @@
name: [
(identifier) @method
(generic_identifier (_) @type)
- (namespaced_identifier
- (_) @method .
- )
]
)
@@ -165,9 +171,13 @@
identifier: [
(identifier) @method
(generic_identifier (_) @type)
- (namespaced_identifier
- (_) @method .
- )
+ ]
+)
+
+(member_function
+ identifier: [
+ (identifier) @method
+ (generic_identifier (_) @type)
]
)