Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f7fbc3

Browse files
authored
refactor!: deprecate old framework/configs, Nvim 0.10#4077
1 parent5bfcc89 commit1f7fbc3

File tree

5 files changed

+52
-3
lines changed

5 files changed

+52
-3
lines changed

‎doc/lspconfig.txt‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,41 @@ COMPLETION SUPPORT *lspconfig-completion*
115115

116116
See|lsp-completion|.
117117

118+
==============================================================================
119+
Migrate to vim.lsp.config*lspconfig-nvim-0.11*
120+
121+
The "framework" part of nvim-lspconfig isDEPRECATED. The "configs" are NOT
122+
deprecated, but were moved to the lsp/ directory so that|vim.lsp.config()|
123+
automatically finds them.
124+
125+
This means:
126+
-`require'lspconfig'[…]` must NOT be used. Use`vim.lsp.config(…)` instead.
127+
- The`require'lspconfig'` quasi-framework will be DELETED, and is not
128+
supported in Nvim 0.11+.
129+
- The nvim-lspconfig configs (|lspconfig-all|) now live in "lsp/" instead of
130+
"lua/lspconfig/".
131+
- To use the configs, call`vim.lsp.config(…)` instead of`require'lspconfig'[…]`.
132+
133+
MIGRATION INSTRUCTIONS
134+
135+
To migrate:
136+
- Upgrade to Nvim 0.11 or later.
137+
- Change`require'lspconfig'[…]` to`vim.lsp.config(…)`.
138+
- Some field names changed, see|lspconfig-vs-vim.lsp.config|.
139+
- See|lsp-config| for details.
140+
141+
BACKGROUND
142+
143+
Since Nvim 0.11, nvim-lspconfig provides configs in its "lsp/" directory. The
144+
old configs still exist in "lua/lspconfig/configs/" but are deprecated and
145+
will be DELETED.
146+
147+
This means the "configs" role of nvim-lspconfig continues to be relevant, but
148+
it is now a "data-only" repository instead of a "framework". The only change
149+
needed from you, and from plugins, is to use the Nvim 0.11`vim.lsp.config`
150+
interface to setup LSP configs instead of the old`require'lspconfig'`
151+
quasi-framework.
152+
118153
==============================================================================
119154
DEBUGGING AND TROUBLESHOOTING*lspconfig-debugging*
120155

‎lsp/volar.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--- Renamed to [vue_ls](#vue_ls)
44
---
55
---
6-
vim.deprecate('volar','vue_ls','3.0.0','lspconfig',false)
6+
vim.deprecate('volar','vue_ls','3.0.0','nvim-lspconfig',false)
77

88
---@typevim.lsp.Config
99
returnvim.lsp.config.vue_ls

‎lua/lspconfig.lua‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,19 @@ end
7777
localmt= {}
7878
functionmt:__index(k)
7979
ifconfigs[k]==nilthen
80+
ifvim.fn.has('nvim-0.11')==1then
81+
vim.deprecate(
82+
'The `require(\'lspconfig\')` "framework"',
83+
'vim.lsp.config (see :help lspconfig-nvim-0.11)',
84+
'v3.0.0',
85+
'nvim-lspconfig',
86+
false
87+
)
88+
end
89+
8090
localalias=M.server_aliases(k)
8191
ifaliasthen
82-
vim.deprecate(k,alias.to,alias.version,'lspconfig',false)
92+
vim.deprecate(k,alias.to,alias.version,'nvim-lspconfig',false)
8393
alias.inconfig=true
8494
k=alias.to
8595
end

‎lua/lspconfig/configs.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function configs.__newindex(t, config_name, config_def)
4949
config_name,
5050
config_def.default_config.deprecate.to,
5151
config_def.default_config.deprecate.version,
52-
'lspconfig',
52+
'nvim-lspconfig',
5353
false
5454
)
5555
end

‎plugin/lspconfig.lua‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ if vim.g.lspconfig ~= nil then
33
end
44
vim.g.lspconfig=1
55

6+
ifvim.fn.has('nvim-0.11')==0then
7+
vim.deprecate('nvim-lspconfig support for Nvim 0.10 or older','Nvim 0.11+','v3.0.0','nvim-lspconfig',false)
8+
end
9+
610
localapi,lsp=vim.api,vim.lsp
711
localutil=require('lspconfig.util')
812

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp