nvim lsp deprecation
This commit is contained in:
+5
-6
@@ -36,7 +36,7 @@ local lspstatus = require('lsp-status')
|
||||
lspstatus.register_progress()
|
||||
|
||||
local function find_repo_root(names)
|
||||
local util = require("lspconfig.util")
|
||||
local util = vim.lsp.config.util
|
||||
local config = names.configfiles
|
||||
local function matcher(filename, _bufnr)
|
||||
local gitroot = util.root_pattern('.git')(filename)
|
||||
@@ -123,10 +123,10 @@ local lsp_confs = {
|
||||
configfiles = { ".eslintrc", ".eslintrc.js", "package.json" }
|
||||
}),
|
||||
on_new_config = function(config, new_root_dir)
|
||||
local default_config = require('lspconfig.server_configurations.eslint').default_config
|
||||
local default_config = vim.lsp.config.eslint.default_config
|
||||
default_config.on_new_config(config, new_root_dir)
|
||||
|
||||
local util = require('lspconfig.util')
|
||||
local util = vim.lsp.config.util
|
||||
local pnp_cjs = util.path.join(new_root_dir, '.pnp.cjs')
|
||||
local pnp_js = util.path.join(new_root_dir, '.pnp.js')
|
||||
if util.path.exists(pnp_cjs) or util.path.exists(pnp_js) then
|
||||
@@ -145,8 +145,6 @@ local function on_attach(client, _bufnr)
|
||||
lspstatus.on_attach(client)
|
||||
end
|
||||
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
|
||||
for server, conf in pairs(lsp_confs) do
|
||||
local source_on_attach = conf.on_attach
|
||||
@@ -171,7 +169,8 @@ for server, conf in pairs(lsp_confs) do
|
||||
if special_setup then
|
||||
special_setup(final_config)
|
||||
else
|
||||
lspconfig[server].setup(final_config)
|
||||
vim.lsp.config[server] = final_config
|
||||
vim.lsp.enable(server)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user