You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helix/runtime/queries/nix/highlights.scm

113 lines
3.2 KiB
Scheme

3 years ago
(comment) @comment
"assert" @keyword.control.exception
"or" @keyword.operator
"rec" @keyword.control.repeat
3 years ago
[
"if"
3 years ago
"then"
"else"
] @keyword.control.conditional
[
3 years ago
"let"
"inherit"
"in"
"with"
3 years ago
] @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 .))])
3 years ago
((identifier) @variable.builtin
(#match? @variable.builtin "^(__currentSystem|__currentTime|__nixPath|__nixVersion|__storeDir|builtins)$")
3 years ago
(#is-not? local))
((identifier) @function.builtin
(#match? @function.builtin "^(__add|__addErrorContext|__all|__any|__appendContext|__attrNames|__attrValues|__bitAnd|__bitOr|__bitXor|__catAttrs|__compareVersions|__concatLists|__concatMap|__concatStringsSep|__deepSeq|__div|__elem|__elemAt|__fetchurl|__filter|__filterSource|__findFile|__foldl'|__fromJSON|__functionArgs|__genList|__genericClosure|__getAttr|__getContext|__getEnv|__hasAttr|__hasContext|__hashFile|__hashString|__head|__intersectAttrs|__isAttrs|__isBool|__isFloat|__isFunction|__isInt|__isList|__isPath|__isString|__langVersion|__length|__lessThan|__listToAttrs|__mapAttrs|__match|__mul|__parseDrvName|__partition|__path|__pathExists|__readDir|__readFile|__replaceStrings|__seq|__sort|__split|__splitVersion|__storePath|__stringLength|__sub|__substring|__tail|__toFile|__toJSON|__toPath|__toXML|__trace|__tryEval|__typeOf|__unsafeDiscardOutputDependency|__unsafeDiscardStringContext|__unsafeGetAttrPos|__valueSize|abort|baseNameOf|derivation|derivationStrict|dirOf|fetchGit|fetchMercurial|fetchTarball|fromTOML|import|isNull|map|placeholder|removeAttrs|scopedImport|throw|toString)$")
(#is-not? local))
[
(string_expression)
(indented_string_expression)
3 years ago
] @string
[
(path_expression)
(hpath_expression)
(spath_expression)
3 years ago
] @string.special.path
(uri_expression) @string.special.uri
3 years ago
; 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
3 years ago
(escape_sequence) @constant.character.escape
(dollar_escape) @constant.character.escape
3 years ago
(function_expression
"@"? @punctuation.delimiter
3 years ago
universal: (identifier) @variable.parameter
"@"? @punctuation.delimiter
3 years ago
)
(formal
name: (identifier) @variable.parameter
"?"? @punctuation.delimiter)
(interpolation
"${" @punctuation.special
"}" @punctuation.special) @embedded
(unary_expression
3 years ago
operator: _ @operator)
(binary_expression
3 years ago
operator: _ @operator)
(binding
attrpath: (attrpath attr: (identifier)) @variable.other.member)
(inherit_from attrs: (inherited_attrs attr: (identifier) @variable.other.member))
(inherited_attrs attr: (identifier) @variable)
(has_attr_expression
expression: (_)
"?" @operator
attrpath: (attrpath
attr: (identifier) @variable.other.member))
3 years ago
[
";"
"."
","
"="
":"
(ellipses)
3 years ago
] @punctuation.delimiter
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket