Update generated neovim config
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
return {
|
||||
get_icon = function(filename, extension, options)
|
||||
if filename == 'LICENSE' then return '', 'DevIconLicense' end
|
||||
if vim.endswith(filename, 'lua') then return '', 'DevIconLua' end
|
||||
if vim.endswith(filename, 'txt') then return '', 'DevIconTxt' end
|
||||
if (options or {}).default then return '', 'DevIconDefault' end
|
||||
end,
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
vim.diagnostic.get = function(_, _)
|
||||
local s = vim.diagnostic.severity
|
||||
return {
|
||||
{ severity = s.ERROR },
|
||||
{ severity = s.WARN },
|
||||
{ severity = s.INFO },
|
||||
{ severity = s.HINT },
|
||||
{ severity = s.ERROR },
|
||||
{ severity = s.WARN },
|
||||
{ severity = s.INFO },
|
||||
{ severity = s.ERROR },
|
||||
{ severity = s.WARN },
|
||||
{ severity = s.ERROR },
|
||||
}
|
||||
end
|
||||
|
||||
if vim.fn.has('nvim-0.10') == 1 then
|
||||
vim.diagnostic.count = function(_, _)
|
||||
local s = vim.diagnostic.severity
|
||||
return { [s.ERROR] = 4, [s.WARN] = 3, [s.INFO] = 2, [s.HINT] = 1 }
|
||||
end
|
||||
end
|
||||
@ -0,0 +1,25 @@
|
||||
_G.n_lsp_clients = 0
|
||||
local mock_buf_clients = function()
|
||||
local res = {}
|
||||
for i = 1, _G.n_lsp_clients do
|
||||
res[i] = { id = i }
|
||||
end
|
||||
return res
|
||||
end
|
||||
vim.lsp.buf_get_clients = mock_buf_clients
|
||||
vim.lsp.get_clients = mock_buf_clients
|
||||
|
||||
_G.attach_lsp = function()
|
||||
_G.n_lsp_clients = _G.n_lsp_clients + 1
|
||||
vim.api.nvim_exec_autocmds('LspAttach', { data = { client_id = _G.n_lsp_clients } })
|
||||
end
|
||||
|
||||
_G.detach_lsp = function()
|
||||
local n = _G.n_lsp_clients
|
||||
if n == 0 then return end
|
||||
|
||||
_G.n_lsp_clients = _G.n_lsp_clients - 1
|
||||
vim.api.nvim_exec_autocmds('LspDetach', { data = { client_id = n } })
|
||||
end
|
||||
|
||||
_G.attach_lsp()
|
||||
Reference in New Issue
Block a user