Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
NEOVIM_VERSION ?= v0.9.5
NEOVIM_RUNNER_VERSION ?= v0.10.0

NVIM_TS_SHA ?= 140f534c
NVIM_TS_SHA ?= 894cb3c

FILTER=.*

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Note: support for specific languages is strictly community maintained and can br
- [ ] `mermaid`
- [ ] `meson`
- [ ] `nickel`
- [x] `nu`
- [ ] `ocamllex`
- [ ] `pascal`
- [ ] `perl`
Expand Down
43 changes: 43 additions & 0 deletions queries/nu/context.scm
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions test/lang/test.nu
Original file line number Diff line number Diff line change
@@ -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
)
Loading