aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-01-22 22:27:45 -0500
committerStephan Seitz <stephan.seitz@fau.de>2023-01-23 08:42:27 +0100
commit1913ce2fd2caa406455d058802cd04f5b6f046e1 (patch)
tree74343e56c568c789315b6ce7be38535dbf5ed2e2
parenthighlights(rst): don't spell check links (diff)
downloadnvim-treesitter-1913ce2fd2caa406455d058802cd04f5b6f046e1.tar
nvim-treesitter-1913ce2fd2caa406455d058802cd04f5b6f046e1.tar.gz
nvim-treesitter-1913ce2fd2caa406455d058802cd04f5b6f046e1.tar.bz2
nvim-treesitter-1913ce2fd2caa406455d058802cd04f5b6f046e1.tar.lz
nvim-treesitter-1913ce2fd2caa406455d058802cd04f5b6f046e1.tar.xz
nvim-treesitter-1913ce2fd2caa406455d058802cd04f5b6f046e1.tar.zst
nvim-treesitter-1913ce2fd2caa406455d058802cd04f5b6f046e1.zip
feat(thrift): refactor queries for better highlights, fixes bugs where certain ones went past where they should've ended
-rw-r--r--lockfile.json2
-rw-r--r--queries/thrift/highlights.scm19
2 files changed, 11 insertions, 10 deletions
diff --git a/lockfile.json b/lockfile.json
index 5ab72e4e8..b57597cc8 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -390,7 +390,7 @@
"revision": "0ff887f2a60a147452d52db060de6b42f42f1441"
},
"thrift": {
- "revision": "999a27d87b8f90a74306d4e79c5e22db3ab61633"
+ "revision": "b05fca8fa29b9ecaae0cd153ba590e4b7f840819"
},
"tiger": {
"revision": "a233ebe360a73a92c50978e5c4e9e471bc59ff42"
diff --git a/queries/thrift/highlights.scm b/queries/thrift/highlights.scm
index d3795aef8..d06fbe03f 100644
--- a/queries/thrift/highlights.scm
+++ b/queries/thrift/highlights.scm
@@ -19,11 +19,12 @@
"list"
"map"
"set"
+ "void"
] @type.builtin
; Function
-(function) @function
+(function_identifier) @function
; Fields
@@ -32,6 +33,7 @@
; Parameters
(param_identifier) @parameter
+(exception_param_identifier) @parameter
; Variables
@@ -45,6 +47,8 @@
; Types
(enum_identifier) @type
+(exception_identifier) @type
+(exception_param_type) @type
(field_type) @type
(type_identifier) @type
@@ -64,14 +68,12 @@
; Exceptions
[
- (exception)
- (throws)
+ "throws"
] @exception
; Keywords
[
- "const"
"cpp_include"
"enum"
"exception"
@@ -84,10 +86,8 @@
"senum"
"service"
"struct"
- "throws"
"typedef"
"union"
- "void"
] @keyword
; Deprecated Keywords
@@ -113,7 +113,7 @@
"xsd_optional"
] @keyword
-(namespace_scope) @keyword
+(namespace_scope) @namespace
; Literals
@@ -125,9 +125,12 @@
(boolean) @boolean
+; Typedefs
(typedef_definition) @type.definition
(namespace_definition) @type.definition
+; Misc
+
[
"const"
] @type.qualifier
@@ -136,8 +139,6 @@
"*"
] @punctuation.special
-; Misc
-
(field_modifier) @attribute
["{" "}"] @punctuation.bracket