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.scm117
1 files changed, 46 insertions, 71 deletions
diff --git a/runtime/queries/nix/highlights.scm b/runtime/queries/nix/highlights.scm
index b55bcf8c..741b73b5 100644
--- a/runtime/queries/nix/highlights.scm
+++ b/runtime/queries/nix/highlights.scm
@@ -1,54 +1,19 @@
(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)$")
+ (#match? @variable.builtin "^(__currentSystem|__currentTime|__nixPath|__nixVersion|__storeDir|builtins|false|null|true)$")
(#is-not? local))
((identifier) @function.builtin
@@ -56,57 +21,67 @@
(#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)
+ (float)
+] @number
-(integer_expression) @constant.numeric.integer
-(float_expression) @constant.numeric.float
+(interpolation
+ "${" @punctuation.special
+ "}" @punctuation.special) @embedded
-(escape_sequence) @constant.character.escape
-(dollar_escape) @constant.character.escape
+(escape_sequence) @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) @property
+(inherit attrs: (attrs_inherited (identifier) @property) )
-(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