1
1
mirror of https://github.com/oxalica/nil.git synced 2024-11-23 03:57:06 +03:00
nil/README.md

60 lines
1.6 KiB
Markdown
Raw Normal View History

2022-08-04 10:53:05 +03:00
nil: Language server for Nix Expression Language
2022-08-01 04:31:10 +03:00
2022-08-02 07:03:47 +03:00
🚧 *This project is under development, but be happy to try it out!*
Super fast incremental analysis! Scans `all-packages.nix` in less then 0.1s and completes with no delay!
## Features
- [x] Goto definition. `textDocument/definition`
- [x] Find references. `textDocument/reference`
2022-08-03 11:45:38 +03:00
- [x] Local binding references.
- [x] With expression references.
2022-08-02 07:03:47 +03:00
- [x] Completion. `textDocument/completion`
- [x] Builtin names.
- [x] Local bindings.
- [ ] Attrset fields.
- [ ] Cross-file analysis.
- [ ] Multi-threaded.
2022-08-01 04:31:10 +03:00
## Installation
2022-08-04 10:53:05 +03:00
**TODO: Beginner friendly instructions.**
This repo is packaged via [Nix flakes][nix-flakes], the language server binary package is
available through the default flake output `github:oxalica/nil#` with the path `bin/nil`.
Flake output structure:
```
├───devShells
│ └───(...)
└───packages
├───x86_64-linux
│ ├───default: package 'nil-unstable-2022-08-04'
│ └───nil: package 'nil-unstable-2022-08-04'
└───(...)
```
[nix-flakes]: https://nixos.wiki/wiki/Flakes
2022-08-01 04:31:10 +03:00
### For neovim `nvim-lspconfig` user
Add the following vimscript to your configuration.
```vim
lua <<EOF
require('lspconfig').rnix.setup {
autostart = true,
2022-08-04 10:53:05 +03:00
-- Change it to the path to the `nil` binary you installed.
2022-08-04 11:13:31 +03:00
cmd = { "/run/current-system/sw/bin/nil" },
2022-08-01 04:31:10 +03:00
}
EOF
```
## License
"nil" is primarily distributed under the terms of both the MIT
license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT for details.