mirror of
https://gitlab.com/baco/dotconf.git
synced 2024-06-19 14:17:03 +00:00
Show LSP diagnostics in floating window on Neovim
This commit is contained in:
parent
f10a66bfac
commit
cdb04aceb2
|
@ -11,6 +11,14 @@ let g:ale_completion_enabled = v:false
|
|||
" nvim-lspconfig
|
||||
lua << EOF
|
||||
local nvim_lsp = require('lspconfig')
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
vim.api.nvim_command('autocmd CursorHold <buffer> lua vim.lsp.diagnostic.show_line_diagnostics()')
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||
vim.lsp.diagnostic.on_publish_diagnostics, {virtual_text=false}
|
||||
)
|
||||
end
|
||||
|
||||
local settings = {
|
||||
pyls = {
|
||||
plugins = {
|
||||
|
@ -26,9 +34,10 @@ local settings = {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
local servers = {'pyls', 'clangd'}
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup{settings={[lsp]=settings[lsp]}}
|
||||
nvim_lsp[lsp].setup{on_attach=on_attach, settings={[lsp]=settings[lsp]}}
|
||||
end
|
||||
EOF
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user