nixd icon indicating copy to clipboard operation
nixd copied to clipboard

Autocomplete breaks in NixOS module with explicit config section

Open arianvp opened this issue 1 year ago • 2 comments

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

https://github.com/user-attachments/assets/b94c2457-e2a7-4e6c-bb64-eccc289bb1e3

Additional context Add any other context about the problem here.

arianvp avatar Aug 02 '24 14:08 arianvp

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

inclyc avatar Aug 02 '24 14:08 inclyc

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

luochen1990 avatar Sep 26 '24 23:09 luochen1990