Use plugin for diagnosticls config
This commit is contained in:
parent
5678db20ca
commit
b8d3bc0d4e
2 changed files with 25 additions and 8 deletions
|
@ -12,29 +12,45 @@ local attach_fn = function()
|
|||
vim.keymap.set('n', '<leader>dl', '<cmd>Telescope diagnostics<CR>', { buffer = 0, remap = false })
|
||||
end
|
||||
|
||||
local lspconfig = require'lspconfig'
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
-- General purpose diagnostics
|
||||
require'lspconfig'.diagnosticls.setup {
|
||||
local diagnosticls = require'diagnosticls'
|
||||
lspconfig.diagnosticls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
filetypes = { 'python' },
|
||||
filetypes = {
|
||||
'python',
|
||||
unpack(diagnosticls.filetypes),
|
||||
},
|
||||
init_options = {
|
||||
linters = vim.tbl_deep_extend("force", diagnosticls.linters, {
|
||||
}),
|
||||
formatters = diagnosticls.formatters,
|
||||
filetypes = {
|
||||
python = { 'flake8', 'mypy' },
|
||||
},
|
||||
formatFiletypes = {
|
||||
python = { 'isort', 'black' },
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
-- Ansible
|
||||
require'lspconfig'.ansiblels.setup {
|
||||
lspconfig.ansiblels.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
}
|
||||
|
||||
-- Bash
|
||||
require'lspconfig'.bashls.setup {
|
||||
lspconfig.bashls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
}
|
||||
|
||||
-- LaTeX
|
||||
require'lspconfig'.texlab.setup {
|
||||
lspconfig.texlab.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
settings = {
|
||||
|
@ -48,7 +64,7 @@ require'lspconfig'.texlab.setup {
|
|||
}
|
||||
|
||||
-- Lua
|
||||
require'lspconfig'.sumneko_lua.setup {
|
||||
lspconfig.sumneko_lua.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
settings = {
|
||||
|
@ -75,13 +91,13 @@ require'lspconfig'.sumneko_lua.setup {
|
|||
}
|
||||
|
||||
-- Markdown
|
||||
require'lspconfig'.marksman.setup {
|
||||
lspconfig.marksman.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
}
|
||||
|
||||
-- Python
|
||||
require'lspconfig'.jedi_language_server.setup {
|
||||
lspconfig.jedi_language_server.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = attach_fn,
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ return require('packer').startup(function(use)
|
|||
|
||||
-- Nvim LSP
|
||||
use 'neovim/nvim-lspconfig'
|
||||
use 'lithammer/nvim-diagnosticls'
|
||||
|
||||
-- Tree-sitter
|
||||
use {
|
||||
|
|
Loading…
Add table
Reference in a new issue