1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-09 12:06:05 +01:00
Commit graph

10 commits

Author SHA1 Message Date
Matt Sturgeon
bb9d744b64 modules/lsp: propagate pkgs arg to server modules
This allows simplifying the `importApply` and also paves the way for
custom server modules to define arbitrary package options.
2025-10-10 14:11:54 +00:00
Matt Sturgeon
9e77c8e4a9 modules/lsp: allow servers to install multiple packages
Adds two internal per-server options: `packages.prefix` & `packages.suffix`.

These options allow the server module to install multiple packages, and
control which end up being prefixed or suffixed on the PATH.

This simplifies the propagating code in `modules/lsp/servers/default.nix`,
which can now zip up the enabled server `packages` attrs.
2025-10-10 14:11:54 +00:00
Matt Sturgeon
2414e8e99f modules/lsp: auto-import per-server custom modules
Adding a module in the following places will import the module into that
specific server's submodule.

This allows creating server-specific options.

Added a test case to ensure all custom modules correspond to an actual
server option to avoid accidental dead code.
2025-10-10 14:11:54 +00:00
Matt Sturgeon
cf6c8ef1fa modules/lsp: be explicit about shorthandOnlyDefinesConfig
`shorthandOnlyDefinesConfig` is true by default for `lib.types.submodule`,
and false by default for `lib.types.submoduleWith` and `lib.evalModules`.

Since we rely on it for our `lsp.servers.*.config` option, let's enable
it explicitly.
2025-10-09 15:31:01 +00:00
Matt Sturgeon
9f336d2d71 modules/lsp: rename server settingsconfig
See RFC: https://github.com/nix-community/nixvim/issues/3745

This effectively reverts 21688b1d2a
2025-10-09 15:31:01 +00:00
Matt Sturgeon
20a7c92306 modules/lsp: handle missing package in server option desc
The `lsp.servers.<name>` option description links to the server's
homepage if it can evaluate the default package's `meta.homepage`.

However, users may evaluate this description, e.g. when building NixOS
docs with `documentation.nixos.includeAllModules`. Further, users may
have a different nixpkgs revisions to ours. Therefore, we need to allow
for the package not being in nixpkgs.

Since `mkPackageOption` will throw in the default, we can catch it with
`tryEval`.
2025-10-07 21:41:36 +00:00
Matt Sturgeon
94331cc50d plugins/lsp: use the new lsp module under the hood
- Re-implement setup wrapping and capabilities to preserve existing
  behaviour
- Alias `package` options to new lsp module
- Alias `packageFallback` options to new lsp module
- Alias `preConfig` and `postConfig` to `lsp.luaConfig`
2025-09-30 20:16:00 +00:00
Matt Sturgeon
167ea865e5 modules/lsp: port packageFallback option from plugins.lsp
Added to `plugins.lsp` in 6a054de04d
2025-09-28 23:07:35 +00:00
Andrey Petrov
1c5c991fda
modules/lsp/servers: Fix lua_ls example
Example was referring to `luals` instead of `lua_ls`
2025-05-25 11:29:19 -04:00
Matt Sturgeon
5308425718
modules/lsp/servers: move to dedicated file/dir
Move the code related to the `lsp.servers` option into a dedicated module,
cleaning up `modules/lsp/default.nix`.
2025-05-05 23:43:30 +01:00