nvim: Switch to pylsp and modify diagnostic
This commit is contained in:
@@ -98,6 +98,10 @@ set smartcase
|
||||
|
||||
set gdefault
|
||||
|
||||
set textwidth=80
|
||||
set formatoptions+=t
|
||||
set scrolloff=10
|
||||
|
||||
" space one line, home,end globally increase/decrease
|
||||
nnoremap <Home> zc
|
||||
nnoremap <End> zo
|
||||
@@ -223,7 +227,7 @@ lspconfig.ccls.setup {
|
||||
EOF
|
||||
|
||||
lua << EOF
|
||||
require'lspconfig'.pyls.setup{}
|
||||
require'lspconfig'.pylsp.setup{}
|
||||
EOF
|
||||
|
||||
lua << EOF
|
||||
@@ -278,19 +282,31 @@ local on_attach = function(client, bufnr)
|
||||
require'completion'.on_attach()
|
||||
end
|
||||
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
signs = {
|
||||
severity_limit = 'Warning',
|
||||
},
|
||||
underline = false,
|
||||
update_in_insert = false,
|
||||
virtual_text = {
|
||||
spacing = 40,
|
||||
severity_limit = 'Warning',
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
local servers = { "pyls", "rls", "cmake", 'ccls' }
|
||||
local servers = { "pylsp", "rls", "cmake", 'ccls' }
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup { on_attach = on_attach }
|
||||
nvim_lsp[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
on_publish_diagnostics = diagnostic_handler
|
||||
}
|
||||
end
|
||||
EOF
|
||||
"
|
||||
" lua require'lspconfig'.pyls.setup{on_attach=require'completion'.on_attach}
|
||||
" lua require'lspconfig'.ccls.setup{on_attach=require'completion'.on_attach}
|
||||
" lua require'lspconfig'.cmake.setup{on_attach=require'completion'.on_attach}
|
||||
" lua require'lspconfig'.rls.setup{on_attach=require'completion'.on_attach}
|
||||
"
|
||||
|
||||
" Set completeopt to have a better completion experience
|
||||
set completeopt=menuone,noinsert,noselect
|
||||
let g:completion_enable_snippet = 'UltiSnips'
|
||||
|
||||
Reference in New Issue
Block a user