trouble.nvim
trouble.nvim copied to clipboard
fix: ensure that the diagnostic parameters are complete
fix #156
debug
- The
range.start.characterfield may not exist - The
range.endfield may not exist
log
{
bufnr = 6,
col = 12,
end_col = 27,
end_lnum = 74,
lnum = 74,
message = "could use strings.ReplaceAll instead",
namespace = 25,
range = {
start = {
line = 74
}
},
severity = 4,
source = "QF1004",
user_data = {
lsp = {}
}
}
@folke Can we just change it to:
local start = {
line = item.col,
character = item.lnum,
}
local finish = {
line = item.end_col,
character = item.end_lnum,
}
Looks the same as the value in range
This is what I was going to fix. The range field seems to be not defined in Neovim docs and some LSP, e.g. lua-ls, emit diagnostic items with range field but without end field in it.
Sorry for the late reply. Thanks!