diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2025-09-17 23:30:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-17 20:30:24 -0700 |
| commit | 1f7fbc34e6420476142b5cc85e9bee52717540fb (patch) | |
| tree | 522a7211a104b20a65ee1e63871d1d25f8dd8520 | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-1f7fbc34e6420476142b5cc85e9bee52717540fb.tar nvim-lspconfig-1f7fbc34e6420476142b5cc85e9bee52717540fb.tar.gz nvim-lspconfig-1f7fbc34e6420476142b5cc85e9bee52717540fb.tar.bz2 nvim-lspconfig-1f7fbc34e6420476142b5cc85e9bee52717540fb.tar.lz nvim-lspconfig-1f7fbc34e6420476142b5cc85e9bee52717540fb.tar.xz nvim-lspconfig-1f7fbc34e6420476142b5cc85e9bee52717540fb.tar.zst nvim-lspconfig-1f7fbc34e6420476142b5cc85e9bee52717540fb.zip | |
refactor!: deprecate old framework/configs, Nvim 0.10 #4077
| -rw-r--r-- | doc/lspconfig.txt | 35 | ||||
| -rw-r--r-- | lsp/volar.lua | 2 | ||||
| -rw-r--r-- | lua/lspconfig.lua | 12 | ||||
| -rw-r--r-- | lua/lspconfig/configs.lua | 2 | ||||
| -rw-r--r-- | plugin/lspconfig.lua | 4 |
5 files changed, 52 insertions, 3 deletions
diff --git a/doc/lspconfig.txt b/doc/lspconfig.txt index 7dff0755..e086bfef 100644 --- a/doc/lspconfig.txt +++ b/doc/lspconfig.txt @@ -116,6 +116,41 @@ COMPLETION SUPPORT *lspconfig-completion* See |lsp-completion|. ============================================================================== +Migrate to vim.lsp.config *lspconfig-nvim-0.11* + +The "framework" part of nvim-lspconfig is DEPRECATED. The "configs" are NOT +deprecated, but were moved to the lsp/ directory so that |vim.lsp.config()| +automatically finds them. + +This means: +- `require'lspconfig'[…]` must NOT be used. Use `vim.lsp.config(…)` instead. +- The `require'lspconfig'` quasi-framework will be DELETED, and is not + supported in Nvim 0.11+. +- The nvim-lspconfig configs (|lspconfig-all|) now live in "lsp/" instead of + "lua/lspconfig/". +- To use the configs, call `vim.lsp.config(…)` instead of `require'lspconfig'[…]`. + +MIGRATION INSTRUCTIONS + +To migrate: +- Upgrade to Nvim 0.11 or later. +- Change `require'lspconfig'[…]` to `vim.lsp.config(…)`. + - Some field names changed, see |lspconfig-vs-vim.lsp.config|. + - See |lsp-config| for details. + +BACKGROUND + +Since Nvim 0.11, nvim-lspconfig provides configs in its "lsp/" directory. The +old configs still exist in "lua/lspconfig/configs/" but are deprecated and +will be DELETED. + +This means the "configs" role of nvim-lspconfig continues to be relevant, but +it is now a "data-only" repository instead of a "framework". The only change +needed from you, and from plugins, is to use the Nvim 0.11 `vim.lsp.config` +interface to setup LSP configs instead of the old `require'lspconfig'` +quasi-framework. + +============================================================================== DEBUGGING AND TROUBLESHOOTING *lspconfig-debugging* See |lsp-log| to enable verbose logs. diff --git a/lsp/volar.lua b/lsp/volar.lua index 8b0cfefd..040a93eb 100644 --- a/lsp/volar.lua +++ b/lsp/volar.lua @@ -3,7 +3,7 @@ --- Renamed to [vue_ls](#vue_ls) --- --- -vim.deprecate('volar', 'vue_ls', '3.0.0', 'lspconfig', false) +vim.deprecate('volar', 'vue_ls', '3.0.0', 'nvim-lspconfig', false) ---@type vim.lsp.Config return vim.lsp.config.vue_ls diff --git a/lua/lspconfig.lua b/lua/lspconfig.lua index ecd30df4..79df2beb 100644 --- a/lua/lspconfig.lua +++ b/lua/lspconfig.lua @@ -77,9 +77,19 @@ end local mt = {} function mt:__index(k) if configs[k] == nil then + if vim.fn.has('nvim-0.11') == 1 then + vim.deprecate( + 'The `require(\'lspconfig\')` "framework"', + 'vim.lsp.config (see :help lspconfig-nvim-0.11)', + 'v3.0.0', + 'nvim-lspconfig', + false + ) + end + local alias = M.server_aliases(k) if alias then - vim.deprecate(k, alias.to, alias.version, 'lspconfig', false) + vim.deprecate(k, alias.to, alias.version, 'nvim-lspconfig', false) alias.inconfig = true k = alias.to end diff --git a/lua/lspconfig/configs.lua b/lua/lspconfig/configs.lua index 344b648e..784f0c4a 100644 --- a/lua/lspconfig/configs.lua +++ b/lua/lspconfig/configs.lua @@ -49,7 +49,7 @@ function configs.__newindex(t, config_name, config_def) config_name, config_def.default_config.deprecate.to, config_def.default_config.deprecate.version, - 'lspconfig', + 'nvim-lspconfig', false ) end diff --git a/plugin/lspconfig.lua b/plugin/lspconfig.lua index 35898e17..550f92e7 100644 --- a/plugin/lspconfig.lua +++ b/plugin/lspconfig.lua @@ -3,6 +3,10 @@ if vim.g.lspconfig ~= nil then end vim.g.lspconfig = 1 +if vim.fn.has('nvim-0.11') == 0 then + vim.deprecate('nvim-lspconfig support for Nvim 0.10 or older', 'Nvim 0.11+', 'v3.0.0', 'nvim-lspconfig', false) +end + local api, lsp = vim.api, vim.lsp local util = require('lspconfig.util') |
