|
2 | 2 |
|
3 | 3 | Language Server Protocol implementation for nushell
|
4 | 4 |
|
| 5 | +## status |
| 6 | + |
| 7 | +- the official [nushell](http://www.nushell.sh/) project |
| 8 | + (from version [0.79](https://www.nushell.sh/blog/2023-04-25-nushell_0_79.html), onwards) |
| 9 | + is where the language-specific smarts are implemented, |
| 10 | + e.g. `nu --ide-hover` |
| 11 | + |
| 12 | +- the official [extension for Visual Studio Code](https://github.com/nushell/vscode-nushell-lang) |
| 13 | + is an IDE-specific wrapper around `nu --ide-hover`, etc |
| 14 | + |
| 15 | +- similarly, `nuls` (this project) is a wrapper around the `nu --ide-hover`, etc, |
| 16 | + but implements the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) |
| 17 | + |
| 18 | +## project scope |
| 19 | + |
| 20 | +- `nuls` aims to have all the same LSP-powered features as the Visual Studio Code extension, |
| 21 | + but working in any IDE/editor that can connect to a language server, |
| 22 | + e.g. [`helix`](https://helix-editor.com/), [`neovim`](https://neovim.io/), etc |
| 23 | + |
| 24 | +- for now, please keep feature requests and bug reports focused on this goal |
| 25 | + |
| 26 | +- functionality that is not supported by upstream `nu --ide-...` is out-of-scope |
| 27 | + |
| 28 | +- functionality in `vscode-nushell-lang` that goes beyond LSP is out-of-scope |
| 29 | + |
| 30 | +## roadmap |
| 31 | + |
| 32 | +(in no particular order, and open to suggestions) |
| 33 | + |
| 34 | +- [x] [textDocument/hover](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_hover) -> `nu --ide-hover` |
| 35 | +- [x] [textDocument/completion](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_completion) -> `nu --ide-complete` |
| 36 | +- [x] [textDocument/definition](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_definition) -> `nu --ide-goto-def` |
| 37 | + (navigates to file containing the definition) |
| 38 | +- [ ] [textDocument/definition](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_definition) -> `nu --ide-goto-def` |
| 39 | + (navigates to precise row and column for the definition) |
| 40 | +- [ ] [textDocument/inlayHint](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_inlayHint) -> `nu --ide-check` |
| 41 | +- [ ] [textDocument/publishDiagnostics](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_publishDiagnostics) -> `nu --ide-check` |
| 42 | +- [ ] [textDocument/didOpen](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_synchronization), etc |
| 43 | +- [ ] [textDocument/formatting](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_formatting) -> [`nufmt`](https://github.com/nushell/nufmt) |
| 44 | +- [ ] raise a PR for `vscode-nushell-lang` to replace its wrapper/glue code with `nuls` |
| 45 | + |
| 46 | +## getting started |
| 47 | + |
| 48 | +### `helix` (23.05) |
| 49 | + |
| 50 | +- (optional) follow https://github.com/nushell/tree-sitter-nu/blob/main/installation/helix.md for the treesitter grammar |
| 51 | + |
| 52 | +- add the following to your languages.toml: |
| 53 | + |
| 54 | + ``` |
| 55 | + [[language]] |
| 56 | + name = "nu" |
| 57 | + auto-format = false |
| 58 | + comment-token = "#" |
| 59 | + file-types = [ "nu" ] |
| 60 | + language-server = { command = "path/to/nuls" } |
| 61 | + roots = [] |
| 62 | + scope = "source.nu" |
| 63 | + shebangs = ["nu"] |
| 64 | + ``` |
| 65 | + |
5 | 66 | ## see also
|
6 | 67 |
|
7 | 68 | - http://www.nushell.sh/
|
8 | 69 | - https://github.com/nushell/vscode-nushell-lang
|
| 70 | +- https://github.com/nushell/vscode-nushell-lang/issues/117 |
9 | 71 | - https://github.com/nushell/tree-sitter-nu
|
| 72 | +- https://microsoft.github.io/language-server-protocol/ |
0 commit comments