updated some depreciated LSP stuff

This commit is contained in:
Gabe Venberg 2022-11-02 23:00:26 -05:00
parent bd5af3b7d4
commit 2b717818af
2 changed files with 128 additions and 127 deletions

View file

@ -2,6 +2,7 @@ local opts = {}
local on_attach = function()
local function set_keymap(...) vim.api.nvim_set_keymap(...) end
local function set_option(...) vim.api.nvim_set_option(...) end
-- Enable completion triggered by <c-x><c-o>
@ -12,7 +13,7 @@ local on_attach = function()
-- See `:help vim.lsp.*` for documentation on any of the below functions
set_keymap('', '<leader>lc', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
set_keymap('', '<leader>lf', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
set_keymap('', '<leader>ld', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
set_keymap('', '<leader>lh', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
set_keymap('', '<leader>li', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
set_keymap('', '<leader>ls', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
@ -26,7 +27,7 @@ local on_attach = function()
set_keymap('', '<leader>lo', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
set_keymap('', '<leader>ln', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
set_keymap('', '<leader>lp', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
set_keymap('', '<leader>lm', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
set_keymap('', '<leader>lm', '<cmd>lua vim.lsp.buf.format {async=true}<CR>', opts)
end
require("mason-lspconfig").setup_handlers({
function(server_name)