navigator.lua/lua/navigator/lspclient/config.lua

26 lines
565 B
Lua
Raw Normal View History

2022-06-01 15:41:26 +00:00
local M = {}
2021-04-19 02:56:32 +00:00
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
function M.reload_lsp()
2021-08-06 07:24:03 +00:00
vim.cmd("LspStop")
local timer = vim.loop.new_timer()
local i = 0
timer:start(500, 100, function()
if i >= 5 then
timer:close() -- Always close handles to avoid leaks.
end
i = i + 1
end)
vim.cmd("LspStart")
vim.cmd([[write]])
vim.cmd([[edit]])
2021-04-19 02:56:32 +00:00
end
function M.open_lsp_log()
local path = vim.lsp.get_log_path()
vim.cmd("edit " .. path)
end
return M