nixd
nixd copied to clipboard
Autocomplete breaks in NixOS module with explicit config section
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:
- 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.
Currently a known issue, nixd's auto-completion works via a set of idioms, leading config may just be a missing form of idioms.
I can confirm that either add let in or lib.mkIf between confg = and { ... } can workaround this issue.