nvim-treesitter/tests/query/highlights/nix/test.nix
Riley Bruins e9321bb914
feat(nix): misc cleanups + comment injection (#6418)
* fix(nix): highlight strings within interpolations

* feat(nix): move `derivation` to function.builtin

* fix(nix): removes all `priority` workarounds

* feat(nix): arbitrary injections using `#` comments
2024-04-09 14:20:26 +09:00

21 lines
716 B
Nix

{
func1 = param: builtins.readFile param;
# ^ @function
# ^ @variable.parameter
# ^ @constant.builtin
# ^ @function.builtin
func2 = { p1, p2 }: p2;
# ^ @function
# ^ @variable.parameter
readFile' = readFile;
# ^ @function.builtin
x = func1 ./path/to/file.nix;
# ^ @variable.member
# ^ @function.call
# ^ @string.special.path
hi = if true then 9 else throw "an error ${here + "string"}";
# ^ @keyword.exception
# ^ @string
# ^ @variable
# ^ @string
}