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

support & auto complete nixvim options #517

Closed
inclyc opened this issue May 31, 2024 · 4 comments · Fixed by #518
Closed

support & auto complete nixvim options #517

inclyc opened this issue May 31, 2024 · 4 comments · Fixed by #518
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@inclyc
Copy link
Member

inclyc commented May 31, 2024

Write documentation & serious testing about nixvim modules. It is a nice module system we'd like to cover.

@inclyc inclyc added the documentation Improvements or additions to documentation label May 31, 2024
@inclyc
Copy link
Member Author

inclyc commented Jun 1, 2024

    programs.nixvim = mkOption {
      default = { };
      type = types.submoduleWith {
        shorthandOnlyDefinesConfig = true;
        specialArgs = {
          hmConfig = config;
          inherit helpers;
        };
        modules = [ (import ./modules/hm.nix { inherit lib; }) ] ++ shared.topLevelModules;
      };
    };

currently all nixvim options are nested under "submodules". We have basic support for things like attrsOf (submoules) but the options completion stops at programs.nixvim so thus it cannot complete the rest.

CC @GaetanLepage

This is a funny case exists in real world, and I think it is mandatory to support it. Let's mark this issue an enhancement for this specific types.

@inclyc inclyc added the enhancement New feature or request label Jun 1, 2024
@inclyc inclyc self-assigned this Jun 1, 2024
inclyc added a commit that referenced this issue Jun 1, 2024
Trying to get completions from nixvim gets trouble,
because all of its options are nested under a "submodule".

The PR adds basic support for mangling submodule options into it's declaration,
and completions for nixvim works.

Fixes: #517
@GaetanLepage
Copy link
Member

    programs.nixvim = mkOption {
      default = { };
      type = types.submoduleWith {
        shorthandOnlyDefinesConfig = true;
        specialArgs = {
          hmConfig = config;
          inherit helpers;
        };
        modules = [ (import ./modules/hm.nix { inherit lib; }) ] ++ shared.topLevelModules;
      };
    };

Where is this snippet coming from ? Nixvim codebase ?

Anyway, thanks for your efforts in including Nixvim support in nixd !

@inclyc
Copy link
Member Author

inclyc commented Jun 1, 2024

Where is this snippet coming from ? Nixvim codebase ?

https://github.com/nix-community/nixvim/blob/d15fade62b743839a20d927d3506d503858f49f0/wrappers/hm.nix#L30

inclyc added a commit that referenced this issue Jun 2, 2024
Trying to get completions from nixvim gets trouble, because all of its
options are nested under a "submodule".

The PR adds basic support for mangling submodule options into it's
declaration, and completion for nixvim works.

Fixes: #517
@inclyc
Copy link
Member Author

inclyc commented Jun 2, 2024

The documentation part, see #520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants