Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/nix/highlights.scm')
-rw-r--r--runtime/queries/nix/highlights.scm108
1 files changed, 43 insertions, 65 deletions
diff --git a/runtime/queries/nix/highlights.scm b/runtime/queries/nix/highlights.scm
index b55bcf8c..f6682065 100644
--- a/runtime/queries/nix/highlights.scm
+++ b/runtime/queries/nix/highlights.scm
@@ -1,52 +1,17 @@
(comment) @comment
[
- ";"
- "."
- ","
- "="
- ":"
- (ellipses)
-] @punctuation.delimiter
-
-[
- "("
- ")"
- "["
- "]"
- "{"
- "}"
-] @punctuation.bracket
-
-"assert" @keyword.control.exception
-"or" @keyword.operator
-"rec" @keyword.control.repeat
-
-[
- "if"
+ "if"
"then"
"else"
-] @keyword.control.conditional
-
-[
"let"
"inherit"
"in"
- "with"
+ "rec"
+ "with"
+ "assert"
] @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))
@@ -56,57 +21,70 @@
(#is-not? local))
[
- (string_expression)
- (indented_string_expression)
+ (string)
+ (indented_string)
] @string
[
- (path_expression)
- (hpath_expression)
- (spath_expression)
+ (path)
+ (hpath)
+ (spath)
] @string.special.path
-(uri_expression) @string.special.uri
+(uri) @string.special.uri
; boolean
((identifier) @constant.builtin.boolean (#match? @constant.builtin.boolean "^(true|false)$")) @constant.builtin.boolean
; null
((identifier) @constant.builtin (#eq? @constant.builtin "null")) @constant.builtin
-(integer_expression) @constant.numeric.integer
-(float_expression) @constant.numeric.float
+(integer) @constant.numeric.integer
+(float) @constant.numeric.float
+
+(interpolation
+ "${" @punctuation.special
+ "}" @punctuation.special) @embedded
(escape_sequence) @constant.character.escape
-(dollar_escape) @constant.character.escape
-(function_expression
- "@"? @punctuation.delimiter
+(function
universal: (identifier) @variable.parameter
- "@"? @punctuation.delimiter
)
(formal
name: (identifier) @variable.parameter
"?"? @punctuation.delimiter)
-(interpolation
- "${" @punctuation.special
- "}" @punctuation.special) @embedded
+(app
+ function: [
+ (identifier) @function
+ (select
+ attrpath: (attrpath
+ attr: (attr_identifier) @function .))])
+
-(unary_expression
+(unary
operator: _ @operator)
-(binary_expression
+(binary
operator: _ @operator)
-(binding
- attrpath: (attrpath attr: (identifier)) @variable.other.member)
+(attr_identifier) @variable.other.member
+(inherit attrs: (attrs_inherited (identifier) @variable.other.member) )
-(inherit_from attrs: (inherited_attrs attr: (identifier) @variable.other.member))
-(inherited_attrs attr: (identifier) @variable)
+[
+ ";"
+ "."
+ ","
+] @punctuation.delimiter
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
-(has_attr_expression
- expression: (_)
- "?" @operator
- attrpath: (attrpath
- attr: (identifier) @variable.other.member))
+(identifier) @variable