diff --git a/Makefile b/Makefile index 509441a9..0af88c45 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ NEOVIM_VERSION ?= v0.9.5 NEOVIM_RUNNER_VERSION ?= v0.10.0 -NVIM_TS_SHA ?= 140f534c +NVIM_TS_SHA ?= 894cb3c FILTER=.* diff --git a/README.md b/README.md index 0f083603..c3e7f727 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ Note: support for specific languages is strictly community maintained and can br - [ ] `mermaid` - [ ] `meson` - [ ] `nickel` + - [x] `nu` - [ ] `ocamllex` - [ ] `pascal` - [ ] `perl` diff --git a/queries/nu/context.scm b/queries/nu/context.scm new file mode 100644 index 00000000..32ed9a9a --- /dev/null +++ b/queries/nu/context.scm @@ -0,0 +1,43 @@ +;; Functions and modules +(decl_def + (_) @context.end +) @context + +(decl_module + (_) @context.end +) @context + +(decl_export + (_) @context.end +) @context + +;; Control flow +(ctrl_if + (_) @context.end +) @context + +(ctrl_try + (_) @context.end +) @context + +(ctrl_match + (_) @context.end +) @context + +(ctrl_for + (_) @context.end +) @context + +(ctrl_while + (_) @context.end +) @context + +(ctrl_do + (_) @context.end +) @context + +(match_arm) @context +(pipe_element) @context +(block) @context +(expr_parenthesized) @context +(val_closure) @context diff --git a/test/lang/test.nu b/test/lang/test.nu new file mode 100644 index 00000000..6e0fee5e --- /dev/null +++ b/test/lang/test.nu @@ -0,0 +1,48 @@ +#!/usr/bin/env nu + +def foo [] { + # comment +} + +module bar { + # comment +} + +export-env { + # comment +} + +if true { + # comment +} + +try { + # comment +} catch { +} + +match "A" { + # comment + "A" => "B" +} + +for x in 0..10 { + # comment +} + +while true { + # comment +} + +do {|| + print "foo" + # comment +} + +let foo = ( + ls + | # context + get name + | # context + first +)