diagnostic update

This commit is contained in:
Chris 2021-03-27 03:49:27 -04:00
parent 4450d30d3e
commit e6e7eafdaf
5 changed files with 32 additions and 21 deletions

View file

@ -1,12 +1,12 @@
-- TODO figure out why this don't work
vim.fn.sign_define("LspDiagnosticsSignError",
{texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"})
{texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"})
vim.fn.sign_define("LspDiagnosticsSignWarning",
{texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"})
vim.fn.sign_define("LspDiagnosticsSignInformation",
{texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"})
vim.fn.sign_define("LspDiagnosticsSignHint",
{texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"})
{texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"})
vim.fn.sign_define("LspDiagnosticsSignInformation",
{texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"})
vim.cmd('nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>')
vim.cmd('nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>')

View file

@ -2,11 +2,13 @@
require'lspconfig'.pyright.setup {
cmd = {DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver", "--stdio"},
on_attach = require'lsp'.common_on_attach,
handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = O.python.virtual_text
}
),
}
handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = O.python.diagnostics.virtual_text,
signs = O.python.diagnostics.signs,
underline = O.python.diagnostics.underline,
update_in_insert = true
})
}
}

View file

@ -17,7 +17,8 @@ local colors = {
vivid_blue = '#4FC1FF',
light_blue = '#9CDCFE',
red = '#D16969',
error_red = '#F44747'
error_red = '#F44747',
info_yellow = '#FFCC66'
}
local condition = require('galaxyline.condition')
local gls = gl.section
@ -110,9 +111,11 @@ gls.right[1] = {
}
gls.right[2] = {DiagnosticWarn = {provider = 'DiagnosticWarn', icon = '', highlight = {colors.orange, colors.bg}}}
gls.right[3] = {DiagnosticHint = {provider = 'DiagnosticHint', icon = '', highlight = {colors.blue, colors.bg}}}
gls.right[3] = {
DiagnosticHint = {provider = 'DiagnosticHint', icon = '', highlight = {colors.vivid_blue, colors.bg}}
}
gls.right[4] = {DiagnosticInfo = {provider = 'DiagnosticInfo', icon = '', highlight = {colors.blue, colors.bg}}}
gls.right[4] = {DiagnosticInfo = {provider = 'DiagnosticInfo', icon = '', highlight = {colors.info_yellow, colors.bg}}}
gls.right[5] = {
ShowLspClient = {

View file

@ -2,13 +2,18 @@ O = {
auto_complete = true,
colorscheme = 'nvcode',
python = {linter = '', formatter = '', autoformat = false, virtual_text=true},
javascript = {linter = '', formatter = '', autoformat = false, virtual_text=true},
javascriptreact = {linter = '', formatter = '', autoformat = false, virtual_text=true},
lua = {formatter = '', autoformat = false, virtual_text=true},
bash = {linter = '', formatter = '', autoformat = false, virtual_text=true},
css = {formatter = '', autoformat = false, virtual_text=true},
json = {formatter = '', autoformat = false, virtual_text=true},
python = {
linter = '',
formatter = '',
autoformat = false,
diagnostics = {virtual_text = false, signs = false, underline = false}
},
javascript = {linter = '', formatter = '', autoformat = false, virtual_text = true},
javascriptreact = {linter = '', formatter = '', autoformat = false, virtual_text = true},
lua = {formatter = '', autoformat = false, virtual_text = true},
bash = {linter = '', formatter = '', autoformat = false, virtual_text = true},
css = {formatter = '', autoformat = false, virtual_text = true},
json = {formatter = '', autoformat = false, virtual_text = true}
}

View file

@ -65,6 +65,7 @@ let g:which_key_map.a = {
\ 'name' : '+actions' ,
\ 'c' : [':ColorizerToggle' , 'colorizer'],
\ 'h' : [':let @/ = ""' , 'remove search highlight'],
\ 'i' : [':IndentBlanklineToggle' , 'toggle indent lines'],
\ 'l' : [':Bracey' , 'start live server'],
\ 'L' : [':BraceyStop' , 'stop live server'],
\ 'n' : [':set nonumber!' , 'line-numbers'],