Skip to content
forked from nix-community/nixd

Nix language server, based on nix libraries | WIP, for internal use only [maintainer=@inclyc]

License

Notifications You must be signed in to change notification settings

adisbladis/nixd

 
 

Repository files navigation

nixd

Nix language server

About

This is a Nix language server that directly uses (i.e., is linked with) the official Nix library (https://github.com/NixOS/nix).

Some notable features provided by linking with the Nix library include:

  • Diagnostics and evaluation that produce identical results as the real Nix command.
  • Shared eval caches (flake, file) with your system's Nix.
  • Native support for cross-file analysis.
  • Precise Nix language support. We do not maintain "yet another parser & evaluator".
  • Support for built-ins, including Nix plugins.

Features Preview

Handle evaluations exactly same as nix evaluator

infinte-recursion

Support *all* builtins

eval-builtin-json

And diagnostic:

eval-builtin-diagnostic

Eval nixpkgs

eval-nixpkgs

Print internal AST Node type, and evalution result just as same as nix repl

eval-ast

Complete dynamic envs, like `with` expression

complete-with

Installation

Build the project

This project is working in progress, and does not vendored dedicated derivation yet. However, if you'd like to help us improve this work, please enter the devShell, and build this project via meson.

Here are a short snippet used in our CI, should works fine and reproducible in your environment.

meson setup build/ --buildtype=${{ matrix.buildtype }} -Db_sanitize=${{ matrix.sanitizer }} -Db_ndebug=${{ matrix.ndebug }}
meson compile -C build
meson test -C build

Editors

We do not provide a custom editor extension or plugins now, configuring nixd like other nix lsp should work out of box.

Tooling

We provide some extra tools based on our codebase.

nix-ast-dump

Used for dumping internal data structures in nix parser.

Demo: all-grammar.nix

Resources

About

Nix language server, based on nix libraries | WIP, for internal use only [maintainer=@inclyc]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 96.1%
  • Nix 2.2%
  • Meson 1.1%
  • Other 0.6%