Skip to content

Commit

Permalink
bugfix: check diagnostic type before using (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzz authored Oct 14, 2024
1 parent 0d09982 commit fb612d1
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lua/go/lsp_diag.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@ end

return {
setup = function()
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(
function(err, result, ctx, config)
vim.lsp.diagnostic.on_publish_diagnostics(err, result, ctx, config)
if _GO_NVIM_CFG.diagnostic.hdlr then
hdlr(result)
end
end,
{}
)
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(function(err, result, ctx, config)
vim.lsp.diagnostic.on_publish_diagnostics(err, result, ctx, config)
if type(_GO_NVIM_CFG.diagnostic) == 'table' and _GO_NVIM_CFG.diagnostic.hdlr then
hdlr(result)
end
end, {})
end,
}

0 comments on commit fb612d1

Please sign in to comment.