From 917ada37df97cd1b0ab6a3d3e2b480036595d8e4 Mon Sep 17 00:00:00 2001 From: postsolar <120750161+postsolar@users.noreply.github.com> Date: Mon, 11 Mar 2024 23:07:15 +0200 Subject: [PATCH] Reverse Nix highlights queries --- runtime/queries/nix/highlights.scm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/runtime/queries/nix/highlights.scm b/runtime/queries/nix/highlights.scm index 4633e1786..a733d6a64 100644 --- a/runtime/queries/nix/highlights.scm +++ b/runtime/queries/nix/highlights.scm @@ -17,6 +17,18 @@ "with" ] @keyword +(variable_expression name: (identifier) @variable) + +(select_expression + attrpath: (attrpath attr: (identifier)) @variable.other.member) + +(apply_expression + function: [ + (variable_expression name: (identifier) @function) + (select_expression + attrpath: (attrpath + attr: (identifier) @function .))]) + ((identifier) @variable.builtin (#match? @variable.builtin "^(__currentSystem|__currentTime|__nixPath|__nixVersion|__storeDir|builtins)$") (#is-not? local)) @@ -59,28 +71,16 @@ name: (identifier) @variable.parameter "?"? @punctuation.delimiter) -(select_expression - attrpath: (attrpath attr: (identifier)) @variable.other.member) - (interpolation "${" @punctuation.special "}" @punctuation.special) @embedded -(apply_expression - function: [ - (variable_expression name: (identifier) @function) - (select_expression - attrpath: (attrpath - attr: (identifier) @function .))]) - (unary_expression operator: _ @operator) (binary_expression operator: _ @operator) -(variable_expression name: (identifier) @variable) - (binding attrpath: (attrpath attr: (identifier)) @variable.other.member) @@ -109,4 +109,4 @@ "]" "{" "}" -] @punctuation.bracket \ No newline at end of file +] @punctuation.bracket