Language Server Protocol implementation for nushell
the official nushell project
(from version 0.79, onwards)
is where the language-specific smarts are implemented,
e.g. nu --ide-hover
the official extension for Visual Studio Code
is an IDE-specific wrapper around nu --ide-hover
, etc
similarly, nuls
(this project) is a wrapper around the nu --ide-hover
, etc,
but implements the Language Server Protocol
nuls
aims to have all the same LSP-powered features as the Visual Studio Code extension,
but also working in any other IDE/editor that can connect to a language server,
e.g. helix
, lapce
, neovim
, zed
, etc
for now, please keep feature requests and bug reports focused on this goal
functionality that is not supported by upstream nu --ide-...
is out-of-scope
functionality in vscode-nushell-lang
that goes beyond LSP is out-of-scope
(in no particular order, and open to suggestions)
nu --ide-hover
nu --ide-complete
nu --ide-goto-def
nu --ide-check
nu --ide-check
vscode-nushell-lang
to replace its wrapper/glue code with nuls
nu --ide-check
nufmt
it's still an open question as to how this project will be distributed and in what form
we'd like to tackle those specific in close collaboration with the nushell maintainers (#3), perhaps once we're a little closer to integation with the Visual Studio Code extension (#9)
you'll need a stable Rust toolchain
cargo install --git https://github.com/jokeyrhyme/nuls.git --locked
helix
(23.05)(optional) follow https://github.com/nushell/tree-sitter-nu/blob/main/installation/helix.md for the treesitter grammar
add the following to your languages.toml:
[[language]]
name = "nu"
auto-format = false
comment-token = "#"
file-types = [ "nu" ]
language-server = { command = "path/to/nuls" }
roots = []
scope = "source.nu"
shebangs = ["nu"]
helix
with multiple language servers per languagerecent-enough commits of helix
now include the nushell grammar and language definition out-of-the-box,
so all we need to do here tell it to use nuls
add the following to your languages.toml:
[language-server.nuls]
command = "nuls" # or "some/path/to/nuls"
[[language]]
name = "nu"
language-servers = [ "nuls" ]