Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixd/hover: hover documentation for options #174

Closed
Tracked by #165
inclyc opened this issue Jun 24, 2023 · 5 comments · Fixed by #526
Closed
Tracked by #165

nixd/hover: hover documentation for options #174

inclyc opened this issue Jun 24, 2023 · 5 comments · Fixed by #526
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@inclyc
Copy link
Member

inclyc commented Jun 24, 2023

Give option documentation to our user.

@inclyc inclyc added the enhancement New feature or request label Jun 24, 2023
@inclyc inclyc mentioned this issue Apr 19, 2024
9 tasks
@Atemu
Copy link

Atemu commented Apr 24, 2024

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.

@inclyc
Copy link
Member Author

inclyc commented Apr 24, 2024

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:

This content looks like:

class OptionsDefinitionProvider {

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

auto R = findAttrPath(*N, PM, Scope);

here (in Controller::onHover), to get attrpath used for RPC request.

const ParentMapAnalysis &PM = *TU->parentMap();

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:

# RUN: --nixos-options-expr="{ foo.bar = { _type = \"option\"; }; }" \

@inclyc inclyc added the good first issue Good for newcomers label Apr 24, 2024
@inclyc
Copy link
Member Author

inclyc commented Apr 24, 2024

Anyone who wants to take this please comment here, and I can give you commit access after patches merged! (Functional improvements).

@Grafcube
Copy link
Contributor

I would like to try and implement this feature.

@Grafcube
Copy link
Contributor

I've opened the PR at #526

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants