nixd icon indicating copy to clipboard operation
nixd copied to clipboard

nixd/hover: hover documentation for nixpkgs functions

Open inclyc opened this issue 2 years ago • 1 comments

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 avatar Jun 24 '23 08:06 inclyc

  • RFC https://github.com/NixOS/rfcs/pull/145 specified the relationship between doc-comments and expressions.
  • We have upstream PR that extract comments and can be used in :doc https://github.com/NixOS/nix/pull/9054

inclyc avatar Oct 18 '23 17:10 inclyc