nil icon indicating copy to clipboard operation
nil copied to clipboard

Option-completion in inlined modules?

Open Ma27 opened this issue 2 years ago • 1 comments

While a lot of modules are in their own files, it's also possible to inline them in e.g. a flake.nix:

{
  description = "foobar";
  outputs = { self, nixpkgs, ... }: {
    nixosModules.default = { lib, ... }: {
      services.|
    };
  };
}

Right now (as of 97abe7d3d48721d4e0fcc1876eea83bb4247825b) there's no completion for option-names at the |-symbol in the example above. A similar case can be observed when using imports or mkMerge:

{ lib, ... }: {
  imports = [
    ({ config, ... }: {
      # no completion in here
    })
  ];
}
{ lib, ... }: {
  services = lib.mkMerge [{
    # no completion in here
  }];
}

Ma27 avatar Aug 29 '23 16:08 Ma27

```nix
{
  description = "foobar";
  outputs = { self, nixpkgs, ... }: {
    nixosModules.default = { lib, ... }: {
      services.|
    };
  };
}
{ lib, ... }: {
  imports = [
    ({ config, ... }: {
      # no completion in here
    })
  ];
}

These are doable, I think. But some extra work should be done to correctly handle recursive types.

{ lib, ... }: {
  services = lib.mkMerge [{
    # no completion in here
  }];
}

This is a dup of #104.

oxalica avatar Sep 02 '23 03:09 oxalica