feat: add diagnostic sources option vim_lsp (#151)
This commit is contained in:
parent
78b8260084
commit
a2721e5ada
|
@ -219,7 +219,7 @@ In addition, some components have unique options.
|
||||||
|
|
||||||
Option | Default | Behaviour | Format
|
Option | Default | Behaviour | Format
|
||||||
:------: | :------: | :----: | :---:
|
:------: | :------: | :----: | :---:
|
||||||
sources | `nil` | displays diagnostic count from defined source | array containing one or many string from set `{'nvim_lsp', 'coc', 'ale'}`
|
sources | `nil` | displays diagnostic count from defined source | array containing one or many string from set `{'nvim_lsp', 'coc', 'ale', 'vim_lsp'}`
|
||||||
sections | `{'error', 'warn', 'info'}` | displays diagnostics of defined severity | array containing one or many string from set `{'error', 'warn', 'info'}`
|
sections | `{'error', 'warn', 'info'}` | displays diagnostics of defined severity | array containing one or many string from set `{'error', 'warn', 'info'}`
|
||||||
color_error | `DiffDelete` foreground color | changes diagnostic's error section foreground color | color in `#rrggbb` format
|
color_error | `DiffDelete` foreground color | changes diagnostic's error section foreground color | color in `#rrggbb` format
|
||||||
color_warn | `DiffText` foreground color | changes diagnostic's warn section foreground color | color in `#rrggbb` format
|
color_warn | `DiffText` foreground color | changes diagnostic's warn section foreground color | color in `#rrggbb` format
|
||||||
|
|
|
@ -277,7 +277,7 @@ List of options are given below.
|
||||||
• sources (nil)
|
• sources (nil)
|
||||||
displays diagnostic count from defined source.
|
displays diagnostic count from defined source.
|
||||||
array containing one or many string from set
|
array containing one or many string from set
|
||||||
{'nvim_lsp', 'coc', 'ale'}
|
{'nvim_lsp', 'coc', 'ale', 'vim_lsp'}
|
||||||
|
|
||||||
• sections ({'error', 'warn', 'info'})
|
• sections ({'error', 'warn', 'info'})
|
||||||
displays diagnostics of defined severity.
|
displays diagnostics of defined severity.
|
||||||
|
|
|
@ -32,6 +32,14 @@ local diagnostic_sources = {
|
||||||
else
|
else
|
||||||
return 0, 0, 0
|
return 0, 0, 0
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
|
vim_lsp = function()
|
||||||
|
local ok, data = pcall(vim.fn['lsp#get_buffer_diagnostics_counts'])
|
||||||
|
if ok then
|
||||||
|
return data.error, data.warning, data.information
|
||||||
|
else
|
||||||
|
return 0, 0, 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue