plugins.lsp: automatically remove unsupported servers

A new update script will check which "old" files do not have an
equivalent "new" file, then the plugins.lsp module will create a
removal assertion for any servers that are listed in the generated
file.
This commit is contained in:
Matt Sturgeon 2025-10-01 22:53:06 +01:00
parent fc779c6e82
commit 5c4a10093d
6 changed files with 68 additions and 3 deletions

View file

@ -212,7 +212,26 @@ in
imports =
let
mkLsp = import ./_mk-lsp.nix;
lspModules = map mkLsp generatedServers;
mkUnsupportedLsp =
{
name,
serverName ? name,
...
}:
lib.mkRemovedOptionModule [ "plugins" "lsp" "servers" name ] ''
nvim-lspconfig has switched from its own LSP configuration API to neovim's built-in LSP API.
'${serverName}' has not been updated to support neovim's built-in LSP API.
See https://github.com/neovim/nvim-lspconfig/issues/3705
'';
unsupported = lib.importJSON ../../../generated/unsupported-lspconfig-servers.json;
lspModules = map (
{
name,
serverName ? name,
...
}@lsp:
(if lib.elem serverName unsupported then mkUnsupportedLsp else mkLsp) lsp
) generatedServers;
baseLspPath = [
"plugins"
"lsp"