Unnamed repository; edit this file 'description' to name the repository.
fix(languages): fix highlight queries for gnuplot (#15422)
This fixes a few bugs with the highlight queries not matching correctly.
Marian Buschsieweke 4 months ago
parent 2f6d0d5 · commit 284933c
-rw-r--r--runtime/queries/gnuplot/highlights.scm21
1 files changed, 13 insertions, 8 deletions
diff --git a/runtime/queries/gnuplot/highlights.scm b/runtime/queries/gnuplot/highlights.scm
index b6e6c4bd..44d935e5 100644
--- a/runtime/queries/gnuplot/highlights.scm
+++ b/runtime/queries/gnuplot/highlights.scm
@@ -21,22 +21,27 @@
"notitle" @keyword.operator
"via" @keyword.operator
+;; Identifiers (variables)
+(identifier) @variable
+
;; Function calls
(function_call
- name: (identifier) @function
-)
+ (expression_list
+ (expression
+ (identifier) @variable.parameter)))
+
(function_call
- (identifier) @variable.parameter
-)
+ name: (_) @function)
+
(builtin_function) @function.builtin
;; Function definitions
(function_definition
- name: (identifier) @function
-)
+ name: (identifier) @function)
-;; Identifiers (variables)
-(identifier) @variable
+(function_definition
+ (parameter_list
+ (_) @variable.parameter))
;; Numbers (distinct integer/float if desired):
(number) @constant.numeric.float