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 #526

Merged
merged 9 commits into from
Jun 22, 2024
Merged

nixd/hover: hover documentation for options #526

merged 9 commits into from
Jun 22, 2024

Conversation

Grafcube
Copy link
Contributor

@Grafcube Grafcube commented Jun 19, 2024

Closes #174

This patch implements hover documentation for options.

nixd/tools/nixd/test/hover-options.md Outdated Show resolved Hide resolved
nixd/lib/Controller/Hover.cpp Outdated Show resolved Hide resolved
Copy link
Member

@inclyc inclyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit test is insufficient because it just tests the old behaviour but I couldn't figure out how to test an actual docstring.

Just use

meson test -C <your-build-dir>

it will be executed automatically. The CHECK: strings are obtained from command standard outputs.

Do this in your shell:

<installed-nixd-bin> --lit-test --nixos-options-expr="{ foo.bar = { _type = \"option\"; }; }"  nixd/tools/nixd/test/hover-options.md

And it should emit some JSON outputs, prefix the important response with CHECK and CHECK-NEXT, just like other tests.

Currently the CI is failing because the behavior is not "old" (we can pop options doc now!)

https://github.com/nix-community/nixd/actions/runs/9584839786?pr=526

nixd/lib/Controller/Hover.cpp Outdated Show resolved Hide resolved
nixd/lib/Controller/Hover.cpp Outdated Show resolved Hide resolved
nixd/lib/Controller/Hover.cpp Outdated Show resolved Hide resolved
nixd/lib/Controller/Hover.cpp Show resolved Hide resolved
Copy link
Member

@inclyc inclyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry. I will help you update the test cases on this weekend.

@inclyc inclyc changed the title nixd/hover: Implement hover documentation for options nixd/hover: hover documentation for options Jun 22, 2024
@inclyc inclyc added the enhancement New feature or request label Jun 22, 2024
Copy link
Member

@inclyc inclyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM again

@inclyc inclyc merged commit dc19271 into nix-community:main Jun 22, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nixd/hover: hover documentation for options
2 participants