Fork of Nushell with a generic LSP client for showing real-time diagnostics. Intended to use with nu-lint but could be used with any other LSP server.
Disclaimer: This fork was made to make it easier for people to experiment with inline diagnostics in the terminal for Nushell. As far as I know this is not too common yet. For the most-up-to date mainline Nushell features and development, please refer to the original repository. Otherwise, go ahead and play around with this fork.
Features:
- Multiple underlined spans
- Inline hints under spans
- Colors for warning / info / error level
- Automatic fixes (for most rules)
- User / workspace ignore action (for noisy rules)
Screenshot of inline diagnostics with multiple labels:
Screenshot of the code action menu being active and suggesting fixes:
flowchart LR
subgraph Terminal
Nu[nu binary]
Reedline[reedline fork]
end
subgraph LSP Server
NuLint[nu-lint]
end
Nu -->|line editing| Reedline
Reedline <-->|LSP protocol| NuLint
NuLint -->|diagnostics, fixes| Reedline
The forked reedline adds an LSP client that communicates with any language server specified via $env.REEDLINE_LS. The LSP server analyzes input and returns diagnostics and code actions displayed inline.
Install a language protocol server (LSP server). I recommend nu-lint:
cargo install nu-lintBuild the main binary nu with a Rust compiler toolchain:
- For Nix users:
nix run .(or add this repo's flake to your system dependencies) - Otherwise, if you are on a more mainstream machine, install
rustupand:
cargo install --git https://github.com/wvhulle/nushellKeep in mind this will overwrite any other nu binary you have there (such as the official one).
Set the environment variable with the startup command for the language server:
$env.REEDLINE_LS = "nu-lint --lsp"
# Or any other LSP server command you like
# $env.REEDLINE_LS = "nu --lsp"Run the shell: ~/.cargo/bin/nu (or add to your path)
Key bindings:
- Open fix/ignore menu when a violation is detected with
ctrl+.. - Navigate between fixes and ignore actions:
tab - Apply fix directly in the prompt:
enter
You can file issues related to incorrect lints and fixes at nu-lint.

