1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 19:46:06 +01:00

ci/nvim-lspconfig: migrate to the new API

This is nearly a full rewrite of the lspconfig-servers update-script,
migrating it to the new `lsp/` directory system and simplifying where
possible.

- plugins/lsp: adapt to new file format
- flake/locate-lsp-packages: update for new lspconfig file format
- generated: Updated lspconfig-servers.json
This commit is contained in:
Matt Sturgeon 2025-10-02 20:44:07 +01:00
parent 308e5b3843
commit b9c5a75cc6
7 changed files with 456 additions and 1561 deletions

View file

@ -7,6 +7,7 @@
with lib;
let
renamedServers = import ./_renamed.nix;
unsupportedServers = lib.importJSON ../../../generated/unsupported-lspconfig-servers.json;
lspExtraArgs = {
dartls = {
@ -192,15 +193,10 @@ let
generatedServers = lib.pipe ../../../generated/lspconfig-servers.json [
lib.importJSON
(lib.map (
(lib.mapAttrsToList (
name: description:
{
name,
desc ? "${name} language server",
...
}:
{
inherit name;
description = desc;
inherit name description;
}
// lib.optionalAttrs (lspPackages.packages ? ${name}) {
package = lspPackages.packages.${name};
@ -216,26 +212,7 @@ in
imports =
let
mkLsp = import ./_mk-lsp.nix;
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;
lspModules = map mkLsp generatedServers;
baseLspPath = [
"plugins"
"lsp"
@ -244,9 +221,18 @@ in
renameModules = mapAttrsToList (
old: new: lib.mkRenamedOptionModule (baseLspPath ++ [ old ]) (baseLspPath ++ [ new ])
) renamedServers;
unsupportedModules = map (
name:
lib.mkRemovedOptionModule [ "plugins" "lsp" "servers" name ] ''
nvim-lspconfig has switched from its own LSP configuration API to neovim's built-in LSP API.
'${name}' has not been updated to support neovim's built-in LSP API.
See https://github.com/neovim/nvim-lspconfig/issues/3705
''
) unsupportedServers;
in
lspModules
++ renameModules
++ unsupportedModules
++ [
./ccls.nix
./hls.nix

View file

@ -7,6 +7,7 @@
"antlersls"
"ansiblels"
"apex_ls"
"atopile"
"autohotkey_lsp"
"awk_ls"
"azure_pipelines_ls"
@ -14,26 +15,26 @@
"basics_ls"
"bazelrc_lsp"
"bicep" # Bicep.Cli is packaged, but not Bicep.LangServer
"bitbake_ls"
"bqls"
"bqnlsp"
"bright_script"
"bsl_ls"
"buddy_ls"
"bufls"
"bzl"
"c3_lsp"
"cadence"
"cairo_ls"
"cds_lsp"
"cir_lsp_server"
"circom-lsp"
"clarity_lsp"
"clarinet"
"cobol_ls"
"codeqlls"
"codebook"
"coffeesense"
"contextive"
"copilot"
# coqPackages.coq-lsp is unavailable since the bump to coq 9.0: https://github.com/NixOS/nixpkgs/pull/389454
"coq_lsp"
"cspell_ls"
"css_variables"
"cssmodules_ls"
"cucumber_language_server"
@ -42,14 +43,15 @@
"daedalus_ls"
"dcmls"
"debputy"
"delphi_ls"
"djlsp"
"drools_lsp"
"docker_language_server"
"ds_pinyin_lsp"
"dts_lsp"
"ecsact"
"ember"
"emmylua_ls"
"esbonio"
"expert"
"facility_language_server"
"fennel_language_server"
"flux_lsp"
@ -62,13 +64,14 @@
"ginko_ls"
"glasgow"
"glint"
"gnls"
"gradle_ls"
"grammarly"
"graphql" # nodePackages.graphql-language-service-cli was removed in https://github.com/NixOS/nixpkgs/pull/382557
"groovyls"
"guile_ls"
"haxe_language_server"
"hdl_checker"
"herb_ls"
"hhvm"
"hie"
"hlasm"
@ -79,6 +82,7 @@
"jinja_lsp"
"julials"
"kcl"
"kotlin_lsp"
"kulala_ls"
"laravel_ls"
"lean3ls"
@ -102,15 +106,15 @@
"nxls"
"ocamlls"
"opencl_ls"
"openedge_ls"
"openscad_ls"
"pact_ls"
"pasls"
"pbls"
"perlls"
"phptools"
"pico8_ls"
"pkgbuild_language_server"
"please"
"pli"
"poryscript_pls"
"powershell_es"
"prismals"
@ -120,17 +124,18 @@
"puppet"
"purescriptls"
"pyre"
"pyrefly"
"r_language_server"
"racket_langserver"
"raku_navigator"
"reason_ls"
"relay_lsp"
"remark_ls"
"rnix"
"robotcode"
"robotframework_ls"
"roc_ls"
"rome"
"roslyn_ls"
"rpmspec"
"ruff_lsp" # deprecated and removed from nixpkgs
"salt_ls"
@ -148,19 +153,25 @@
"solidity_ls_nomicfoundation"
"somesass_ls"
"sorbet"
"sourcery"
"spyglassmc_language_server"
"sqlls"
"sqruff"
"steep"
"stimulus_ls"
"stylua"
"stylua3p_ls"
"svlangserver"
"tabby_ml"
"termux_language_server"
"textlsp"
"theme_check"
"tofu_ls"
"tombi"
"tsgo"
"tsp_server"
"turbo_ls"
"turtle_ls"
"ty"
# typst-lsp has been removed from nixpkgs as the project is archived
"typst_lsp"
"tvm_ffi_navigator"
@ -170,17 +181,18 @@
"unocss"
"uvls"
"v_analyzer"
"vdmj"
"veridian"
"vespa_ls"
"visualforce_ls"
# coqPackages.vscoq-language-server is unavailable since the bump to coq 9.0: https://github.com/NixOS/nixpkgs/pull/389454
"vscoqtop"
"vuels"
"vue_ls"
"wasm_language_tools"
"yang_lsp"
"yls"
"ziggy"
"ziggy_schema"
"zuban"
];
packages = {