Skip to content

Commit

Permalink
fix: use vim.diagnostic instead of vim.lsp.diagnostic when available
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 22, 2021
1 parent fd8ec33 commit a2e2e7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/trouble/providers/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ function M.diagnostics(_win, buf, cb, options)
if options.mode == "lsp_workspace_diagnostics" then
buf = nil
end
local buffer_diags = buf and { [buf] = vim.lsp.diagnostic.get(buf, nil) } or vim.lsp.diagnostic.get_all()
local diag = vim.diagnostic or vim.lsp.diagnostic
local buffer_diags = buf and { [buf] = diag.get(buf, nil) } or diag.get_all()

local items = util.locations_to_items(buffer_diags, 1)
cb(items)
Expand Down

0 comments on commit a2e2e7b

Please sign in to comment.