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.
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.