Update generated neovim config
This commit is contained in:
@ -0,0 +1,99 @@
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
"if"
|
||||
"then"
|
||||
"else"
|
||||
"let"
|
||||
"inherit"
|
||||
"in"
|
||||
"rec"
|
||||
"with"
|
||||
"assert"
|
||||
"or"
|
||||
] @keyword
|
||||
|
||||
((identifier) @variable.builtin
|
||||
(#match? @variable.builtin "^(__currentSystem|__currentTime|__nixPath|__nixVersion|__storeDir|builtins|false|null|true)$")
|
||||
(#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))
|
||||
|
||||
[
|
||||
(integer_expression)
|
||||
(float_expression)
|
||||
] @number
|
||||
|
||||
(escape_sequence) @escape
|
||||
(dollar_escape) @escape
|
||||
|
||||
(function_expression
|
||||
universal: (identifier) @variable.parameter
|
||||
)
|
||||
|
||||
(formal
|
||||
name: (identifier) @variable.parameter
|
||||
"?"? @punctuation.delimiter)
|
||||
|
||||
(select_expression
|
||||
attrpath: (attrpath (identifier)) @property)
|
||||
|
||||
(apply_expression
|
||||
function: [
|
||||
(variable_expression (identifier)) @function
|
||||
(select_expression
|
||||
attrpath: (attrpath
|
||||
attr: (identifier) @function .))])
|
||||
|
||||
(unary_expression
|
||||
operator: _ @operator)
|
||||
|
||||
(binary_expression
|
||||
operator: _ @operator)
|
||||
|
||||
(variable_expression (identifier) @variable)
|
||||
|
||||
(binding
|
||||
attrpath: (attrpath (identifier)) @property)
|
||||
|
||||
(identifier) @property
|
||||
|
||||
(inherit_from attrs: (inherited_attrs attr: (identifier) @property) )
|
||||
|
||||
[
|
||||
";"
|
||||
"."
|
||||
","
|
||||
"="
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
[
|
||||
(string_expression)
|
||||
(indented_string_expression)
|
||||
] @string
|
||||
|
||||
[
|
||||
(path_expression)
|
||||
(hpath_expression)
|
||||
(spath_expression)
|
||||
] @string.special.path
|
||||
|
||||
(uri_expression) @string.special.uri
|
||||
|
||||
(interpolation
|
||||
"${" @punctuation.special
|
||||
(_) @embedded
|
||||
"}" @punctuation.special)
|
||||
@ -0,0 +1,39 @@
|
||||
; mark arbitary languages with a comment
|
||||
((((comment) @injection.language) .
|
||||
(indented_string_expression (string_fragment) @injection.content))
|
||||
(#set! injection.combined))
|
||||
|
||||
((binding
|
||||
attrpath: (attrpath (identifier) @_path)
|
||||
expression: (indented_string_expression
|
||||
(string_fragment) @injection.content))
|
||||
(#match? @_path "(^\\w*Phase|(pre|post)\\w*|(.*\\.)?\\w*([sS]cript|[hH]ook)|(.*\\.)?startup)$")
|
||||
(#set! injection.language "bash")
|
||||
(#set! injection.combined))
|
||||
|
||||
((apply_expression
|
||||
function: (apply_expression function: (_) @_func)
|
||||
argument: (indented_string_expression (string_fragment) @injection.content))
|
||||
(#match? @_func "(^|\\.)writeShellScript(Bin)?$")
|
||||
(#set! injection.language "bash")
|
||||
(#set! injection.combined))
|
||||
|
||||
(apply_expression
|
||||
(apply_expression
|
||||
function: (apply_expression
|
||||
function: ((_) @_func)))
|
||||
argument: (indented_string_expression (string_fragment) @injection.content)
|
||||
(#match? @_func "(^|\\.)runCommand(((No)?(CC))?(Local)?)?$")
|
||||
(#set! injection.language "bash")
|
||||
(#set! injection.combined))
|
||||
|
||||
(apply_expression
|
||||
function: ((_) @_func)
|
||||
argument: (_ (_)* (_ (_)* (binding
|
||||
attrpath: (attrpath (identifier) @_path)
|
||||
expression: (indented_string_expression
|
||||
(string_fragment) @injection.content))))
|
||||
(#match? @_func "(^|\\.)writeShellApplication$")
|
||||
(#match? @_path "^text$")
|
||||
(#set! injection.language "bash")
|
||||
(#set! injection.combined))
|
||||
@ -0,0 +1,33 @@
|
||||
;; when using @local.reference, tree-sitter seems to
|
||||
;; apply the scope from the identifier it has looked up,
|
||||
;; which makes sense for most languages.
|
||||
;; however, we want to highlight things as function based on their call-site,
|
||||
;; not their definition; therefore using TS's support for tracking locals
|
||||
;; impedes our ability to get the highlighting we want.
|
||||
;;
|
||||
;; also, TS doesn't seem to support scoping as implemented in languages
|
||||
;; with lazy let bindings, which results in syntax highlighting/goto-reference
|
||||
;; results that depend on the order of definitions, which is counter to the
|
||||
;; semantics of Nix.
|
||||
;;
|
||||
;; so for now we'll opt for not having any locals queries.
|
||||
;;
|
||||
;; see: https://github.com/tree-sitter/tree-sitter/issues/918
|
||||
|
||||
;(function_expression
|
||||
; universal: (identifier)? @local.definition
|
||||
; formals: (formals (formal name: (identifier) @local.definition)*)
|
||||
; universal: (identifier)? @local.definition
|
||||
; ) @local.scope
|
||||
;
|
||||
;(rec_attrset_expression
|
||||
; bind: (binding
|
||||
; attrpath: (attrpath . (attr_identifier) @local.definition))
|
||||
;) @local.scope
|
||||
;
|
||||
;(let_expression
|
||||
; bind: (binding
|
||||
; attrpath: (attrpath . (attr_identifier) @local.definition))
|
||||
;) @local.scope
|
||||
;
|
||||
;(identifier) @local.reference
|
||||
Reference in New Issue
Block a user