nvim: lua: lsp: Add support for incremental sync

Support for incremental sync landed in neovim with this MR.
https://github.com/neovim/neovim/pull/13371
This commit is contained in:
Sanchayan Maity 2020-12-09 10:14:18 +05:30
parent ab59251f2e
commit eb8346e80f

View file

@ -49,6 +49,10 @@ local on_attach = function(client, bufnr)
completion.on_attach(client, bufnr) completion.on_attach(client, bufnr)
lsp_status.on_attach(client, bufnr) lsp_status.on_attach(client, bufnr)
if client.config.flags then
client.config.flags.allow_incremental_sync = true
end
local opts = { noremap=true, silent=true } local opts = { noremap=true, silent=true }
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)