nix-community / nixd

Nix language server, based on nix libraries [maintainer=@inclyc,@Aleksanaa]
https://github.com/nix-community/nixd
GNU Lesser General Public License v3.0
904 stars 29 forks source link

nixd/hover: hover documentation for nixpkgs functions #173

Open inclyc opened 1 year ago

inclyc commented 1 year ago

It might be useful if we can extract comments from nixpkgs, this need a slightly modified lexer.

https://github.com/nix-community/nixd/blob/3dbe1eb6bde1949b510e19a2d1863a2f4d2329a6/lib/nixd/src/nix/Lexer.l#L310

The comments are discarded directly in our lexer now, we need to preserve this information and a dedicated structure for comments.


Another problem is, the location information is not correct for a Currying lambda. e.g. stdenv.mkDerivation takes us to the location where the origin lambda defined, not "alias"-d location.

inclyc commented 1 year ago