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

Autocomplete breaks in NixOS module with explicit config section #566

Open
arianvp opened this issue Aug 2, 2024 · 2 comments
Open

Autocomplete breaks in NixOS module with explicit config section #566

arianvp opened this issue Aug 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@arianvp
Copy link
Member

arianvp commented Aug 2, 2024

Describe the bug

If I have a config like:

{ lib, pkgs, config, ...}:
{
  systemd.se<TAB>
}

autocomplete works

However if I have a config like:

{ lib, pkgs, config, ... }: {
  config = {
    systemd.s<TAB>
  };
}

auto complete does not work

However it does work when I have

{ lib, pkgs, config, ... }: {
  config = lib.mkIf true {
    systemd.se<TAB>
  };
}

Logs (Required)

E[16:35:36.158] 22467: option worker reported: -32001: attrname config not found in attrset

Configuration

If you have some custom configuration, please paste it here.

To Reproduce
Steps to reproduce the behavior:

  1. Create a NixOS config like { config = {}; }

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

Screen.Recording.2024-08-02.at.16.34.20.mov

Additional context
Add any other context about the problem here.

@arianvp arianvp added the bug Something isn't working label Aug 2, 2024
@inclyc
Copy link
Member

inclyc commented Aug 2, 2024

Currently a known issue, nixd's auto-completion works via a set of idioms, leading config may just be a missing form of idioms.

@luochen1990
Copy link

I can confirm that either add let in or lib.mkIf between confg = and { ... } can workaround this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants