fix deprecated lsp function call
This commit is contained in:
@@ -38,14 +38,14 @@ return {
|
|||||||
vim.keymap.set("n", "gd", function()
|
vim.keymap.set("n", "gd", function()
|
||||||
vim.lsp.buf.definition({
|
vim.lsp.buf.definition({
|
||||||
on_list = function(list)
|
on_list = function(list)
|
||||||
vim.lsp.util.jump_to_location(list.items[1].user_data, "utf-8", true)
|
vim.lsp.util.show_document(list.items[1].user_data, "utf-8", { focus = true })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end, { buffer = bufnr, remap = false, nowait = true })
|
end, { buffer = bufnr, remap = false, nowait = true })
|
||||||
vim.keymap.set("n", "gi", function()
|
vim.keymap.set("n", "gi", function()
|
||||||
vim.lsp.buf.implementation({
|
vim.lsp.buf.implementation({
|
||||||
on_list = function(list)
|
on_list = function(list)
|
||||||
vim.lsp.util.jump_to_location(list.items[1].user_data, "utf-8", true)
|
vim.lsp.util.show_document(list.items[1].user_data, "utf-8", { focus = true })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end, lsp_opts)
|
end, lsp_opts)
|
||||||
@@ -59,10 +59,10 @@ return {
|
|||||||
vim.diagnostic.open_float()
|
vim.diagnostic.open_float()
|
||||||
end, lsp_opts)
|
end, lsp_opts)
|
||||||
vim.keymap.set("n", "[d", function()
|
vim.keymap.set("n", "[d", function()
|
||||||
vim.diagnostic.goto_next()
|
vim.diagnostic.jump({ count = 1 })
|
||||||
end, lsp_opts)
|
end, lsp_opts)
|
||||||
vim.keymap.set("n", "]d", function()
|
vim.keymap.set("n", "]d", function()
|
||||||
vim.diagnostic.goto_prev()
|
vim.diagnostic.jump({ count = -1 })
|
||||||
end, lsp_opts)
|
end, lsp_opts)
|
||||||
vim.keymap.set("n", "<leader>vca", function()
|
vim.keymap.set("n", "<leader>vca", function()
|
||||||
vim.lsp.buf.code_action()
|
vim.lsp.buf.code_action()
|
||||||
@@ -184,7 +184,7 @@ return {
|
|||||||
if
|
if
|
||||||
opts.inlay_hints.enabled
|
opts.inlay_hints.enabled
|
||||||
and client ~= nil
|
and client ~= nil
|
||||||
and client.supports_method("textDocument/inlayHint")
|
and client.supports_method(client, "textDocument/inlayHint")
|
||||||
then
|
then
|
||||||
vim.lsp.inlay_hint.enable(true)
|
vim.lsp.inlay_hint.enable(true)
|
||||||
end
|
end
|
||||||
@@ -195,7 +195,7 @@ return {
|
|||||||
pattern = { "*.svelte", "*.js", "*.ts" },
|
pattern = { "*.svelte", "*.js", "*.ts" },
|
||||||
group = vim.api.nvim_create_augroup("svelte_ondidchangetsorjsfile", { clear = true }),
|
group = vim.api.nvim_create_augroup("svelte_ondidchangetsorjsfile", { clear = true }),
|
||||||
callback = function(ctx)
|
callback = function(ctx)
|
||||||
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
|
client.notify(client, "$/onDidChangeTsOrJsFile", { uri = ctx.match })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@@ -204,7 +204,7 @@ return {
|
|||||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||||
pattern = { "*.svelte", "*.js", "*.ts" },
|
pattern = { "*.svelte", "*.js", "*.ts" },
|
||||||
callback = function(ctx)
|
callback = function(ctx)
|
||||||
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
|
client.notify(client, "$/onDidChangeTsOrJsFile", { uri = ctx.match })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user