diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2dca9d81a6..efafbeeb93 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -132,12 +132,17 @@ If a config needs to be renamed or deprecated, changes its contents like this: ```lua ---@brief --- ---- Renamed to [vsrocq](#vsrocq) - -vim.deprecate('vscoqtop', 'vsrocq', '2.0.0', 'nvim-lspconfig', false) +--- Renamed to [systemd_lsp](#systemd_lsp) ---@type vim.lsp.Config -return vim.lsp.config.vsrocq +return vim.tbl_extend('force', vim.lsp.config.systemd_lsp, { + on_init = function(...) + vim.deprecate('systemd_ls', 'systemd_lsp', '3.0.0', 'nvim-lspconfig', false) + if vim.lsp.config.systemd_lsp.on_init then + vim.lsp.config.systemd_lsp.on_init(...) + end + end, +}) ``` ## Commit style diff --git a/lsp/systemd_ls.lua b/lsp/systemd_ls.lua index 9bea066506..e0478e28fd 100644 --- a/lsp/systemd_ls.lua +++ b/lsp/systemd_ls.lua @@ -2,7 +2,12 @@ --- --- Renamed to [systemd_lsp](#systemd_lsp) -vim.deprecate('systemd_ls', 'systemd_lsp', '2.0.0', 'nvim-lspconfig', false) - ---@type vim.lsp.Config -return vim.lsp.config.systemd_lsp +return vim.tbl_extend('force', vim.lsp.config.systemd_lsp, { + on_init = function(...) + vim.deprecate('systemd_ls', 'systemd_lsp', '3.0.0', 'nvim-lspconfig', false) + if vim.lsp.config.systemd_lsp.on_init then + vim.lsp.config.systemd_lsp.on_init(...) + end + end, +}) diff --git a/lsp/volar.lua b/lsp/volar.lua index 040a93eb08..f797541c6d 100644 --- a/lsp/volar.lua +++ b/lsp/volar.lua @@ -1,9 +1,13 @@ ---@brief --- --- Renamed to [vue_ls](#vue_ls) ---- ---- -vim.deprecate('volar', 'vue_ls', '3.0.0', 'nvim-lspconfig', false) ---@type vim.lsp.Config -return vim.lsp.config.vue_ls +return vim.tbl_extend('force', vim.lsp.config.vue_ls, { + on_init = function(...) + vim.deprecate('volar', 'vue_ls', '3.0.0', 'nvim-lspconfig', false) + if vim.lsp.config.vue_ls.on_init then + vim.lsp.config.vue_ls.on_init(...) + end + end, +}) diff --git a/lsp/vscoqtop.lua b/lsp/vscoqtop.lua index 78186c51ed..897113b42e 100644 --- a/lsp/vscoqtop.lua +++ b/lsp/vscoqtop.lua @@ -2,7 +2,12 @@ --- --- Renamed to [vsrocq](#vsrocq) -vim.deprecate('vscoqtop', 'vsrocq', '2.0.0', 'nvim-lspconfig', false) - ---@type vim.lsp.Config -return vim.lsp.config.vsrocq +return vim.tbl_extend('force', vim.lsp.config.vsrocq, { + on_init = function(...) + vim.deprecate('vscoqtop', 'vsrocq', '3.0.0', 'nvim-lspconfig', false) + if vim.lsp.config.vsrocq.on_init then + vim.lsp.config.vsrocq.on_init(...) + end + end, +})