Recently I wrote a language server for Nix, aiming at better coding assistance.
Main features currently implemented:
- Complete and error-tolerant syntax parser.
- Please file issues if it failed to parse any valid syntax, or has bad error-recovery during typing.
- Goto definition and find references for local names and
with
exprs. Relative paths and attributes defined in multiple locations are also well supported. - Completion of keywords, local names and builtins.
- Diagnostics, including warnings for dead names, dead code, deprecated syntax, duplicated attributes and more.
- Renaming of all kinds of names.
- Expand selection.
- Semantic highlighting (experimental).
Feature requests are welcome!
The code is written in Rust with salsa
, a multi-threaded incremental computation library. Thus intermediate computation will be cached and reused. Many designs follow rust-analyzer
. (Multi-threading is not enabled currently since it’s already fast enough )
The LSP server is already included in nixpkgs under attrpath nil
, thanks to @figsoda