Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

Add diagnostic_enable_location_list to enable/disable loclist #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lua/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ function M.diagnostics_loclist(local_result)
v.uri = v.uri or local_result.uri
end
end
vim.lsp.util.set_loclist(vim.lsp.util.locations_to_items(local_result.diagnostics))

if vim.api.nvim_get_var('diagnostic_enable_location_list') == 1 then
vim.lsp.util.set_loclist(vim.lsp.util.locations_to_items(local_result.diagnostics))
end
end

function M.publish_diagnostics(bufnr)
Expand Down
4 changes: 4 additions & 0 deletions plugin/diagnostic.vim
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ if ! exists('g:diagnostic_level')
let g:diagnostic_level = 'Hint'
endif

if ! exists('g:diagnostic_enable_location_list')
let g:diagnostic_enable_location_list = 1
endif


let &cpo = s:save_cpo
unlet s:save_cpo
Expand Down