nixd
                                
                                 nixd copied to clipboard
                                
                                    nixd copied to clipboard
                            
                            
                            
                        nixd/hover: hover documentation for options
Give option documentation to our user.
This would be great.
What would be especially helpful would be the type signature; that's what I'd want to see in my single line of emacs minibuffer when hovering.
What would be especially helpful would be the type signature; that's what I'd want to see in my single line of emacs minibuffer when hovering.
This is already shown in the completion list, I suppose I'd rather straightforward to do this.
Contributors who wants to take this should:
Write a class OptionsHoverProvider in this anonymous namespace here:
https://github.com/nix-community/nixd/blob/a8d7322d35dce8c0d6a54eb24213cfe31f5339d3/nixd/lib/Controller/Hover.cpp#L88
This content looks like:
https://github.com/nix-community/nixd/blob/a8d7322d35dce8c0d6a54eb24213cfe31f5339d3/nixd/lib/Controller/Definition.cpp#L170
The class shown above is used for "providing" locations, thus for hover request the new class should provide "Hover" information.
After writing that class, invoke
https://github.com/nix-community/nixd/blob/a8d7322d35dce8c0d6a54eb24213cfe31f5339d3/nixd/lib/Controller/Definition.cpp#L241
here (in Controller::onHover), to get attrpath used for RPC request.
https://github.com/nix-community/nixd/blob/a8d7322d35dce8c0d6a54eb24213cfe31f5339d3/nixd/lib/Controller/Hover.cpp#L106
Finally, update the tests
Should be a new entry, like "hover-options.md", put it here
https://github.com/nix-community/nixd/blob/main/nixd/tools/nixd/test/
The content looks like https://github.com/nix-community/nixd/blob/main/nixd/tools/nixd/test/hover-package.md, and options list can be provided like this:
https://github.com/nix-community/nixd/blob/a8d7322d35dce8c0d6a54eb24213cfe31f5339d3/nixd/tools/nixd/test/completion-options.md?plain=1#L2
Anyone who wants to take this please comment here, and I can give you commit access after patches merged! (Functional improvements).
I would like to try and implement this feature.
I've opened the PR at #526