Skip to content

Commit

Permalink
feat(nu): added nu support
Browse files Browse the repository at this point in the history
  • Loading branch information
melMass committed Dec 7, 2024
1 parent e25ec23 commit 2ecd4bf
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
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
16 changes: 16 additions & 0 deletions queries/nu/context.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(decl_def) @context
(decl_module) @context
(decl_export) @context

(ctrl_if) @context
(ctrl_try) @context
(ctrl_match) @context
(ctrl_for) @context
(ctrl_while) @context
(ctrl_do) @context

(match_arm) @context
(pipe_element) @context
(block) @context
(expr_parenthesized) @context
(val_closure) @context
37 changes: 37 additions & 0 deletions test/lang/test.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env nu

# {{TEST}}

def foo [] { # {{CONTEXT}}
let bar = [1,2,3,4,5]
for n in $bar { # {{CONTEXT}}

if true { # {{CONTEXT}}

# {{CURSOR}}
}

# {{CURSOR}}
}

# {{CURSOR}}
}
# {{POPCONTEXT}}

# {{TEST}}

module bar { # {{CONTEXT}}

# {{CURSOR}}
}


# {{TEST}}

export-env { # {{CONTEXT}}

$env.FOO = "bar"

# {{CURSOR}}
}

0 comments on commit 2ecd4bf

Please sign in to comment.