nix-community / nixd

Nix language server, based on nix libraries [maintainer=@inclyc,@Aleksanaa]
https://github.com/nix-community/nixd
GNU Lesser General Public License v3.0
919 stars 31 forks source link

Add support for completing nixosModules.default.options #590

Open kjeremy opened 2 months ago

kjeremy commented 2 months ago

Is your feature request related to a problem? Please describe.

I would like completion for a module that I am exposing from a flake.

Describe the solution you'd like

This should expose my options but it doesn't seem to (or possibly this should just work).

"nix.serverSettings": {
        "nixd": {
            "options": {
                "my-cool-module": {
                    "expr": "(builtins.getFlake \"/home/jkolb/ara/ipd-nix\").nixosModules.default.options",
                }
            }
        }
    }

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

inclyc commented 1 month ago

I would like completion for a module that I am exposing from a flake.

Please show nix-repl for that module.

(builtins.getFlake \"/home/jkolb/ara/ipd-nix\").nixosModules.default.options

For example,

nix-repl> (builtins.getFlake "/home/jkolb/ara/ipd-nix").nixosModules.default.options

What is the result?