mirror of
https://github.com/tweag/nickel.git
synced 2024-10-26 11:52:13 +03:00
Merge pull request #506 from tweag/avi/language-server/vs-code-client
Avi/language server/vs code client
This commit is contained in:
commit
140f41a1e7
@ -18,6 +18,27 @@ To enter a shell with `nickel` and `nls` run
|
||||
nix shell github:tweag/nickel
|
||||
```
|
||||
|
||||
To install `nickel` and `nls` into your profile run
|
||||
|
||||
```
|
||||
nix profile install github:tweag/nickel
|
||||
```
|
||||
|
||||
To build the `nickel` and `nls` executables run
|
||||
|
||||
```
|
||||
# The executables will be placed in ./result/bin/
|
||||
nix build github:tweag/nickel
|
||||
```
|
||||
|
||||
Alternatively to install without nix flakes using nix run:
|
||||
|
||||
```
|
||||
git clone https://github.com/tweag/nickel.git
|
||||
cd nickel
|
||||
nix-env -f . -i
|
||||
```
|
||||
|
||||
## Client
|
||||
|
||||
|
||||
@ -45,4 +66,35 @@ The VS Code extension offers three configuration options:
|
||||
|
||||
- `"nls.server.path"`: Path to nickel language server
|
||||
- `"nls.server.trace"`: "Enables performance tracing to the given file"
|
||||
- `"nls.server.debugLog"`: "Logs the communication between VS Code and the language server."
|
||||
- `"nls.server.debugLog"`: "Logs the communication between VS Code and the language server."
|
||||
|
||||
### Neovim
|
||||
|
||||
After installing `nickel` and `nls`
|
||||
`nls` is supported in [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig).
|
||||
Using `nvim-lspconfig` setup `nls` like all your other LSP servers as described by the `nvim-lspconfig` ReadMe.
|
||||
|
||||
```lua
|
||||
require('lspconfig')["nickel_ls"].setup {}
|
||||
```
|
||||
|
||||
### Neo(Vim) with Coc.nvim
|
||||
|
||||
Add the `nickel_ls` `JSON` object to your `:CocConfig`/`coc-settings.json`.
|
||||
```
|
||||
{
|
||||
"languageserver": {
|
||||
"nickel_ls": {
|
||||
"command": "nls",
|
||||
// You can enable performance tracing with:
|
||||
// "command": "nls --trace <file>",
|
||||
"rootPatterns": [
|
||||
".git"
|
||||
],
|
||||
"filetypes": [
|
||||
"ncl"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user