File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,15 @@ function M.parse_cargo_test_diagnostics(output, bufnr)
3131 for failure_content , test_id , lnum , col in
3232 output :gmatch (" (thread '([^']+)' panicked at [^:]+:(%d+):(%d+):%s-\n .-\n )\n " )
3333 do
34+ local diagnostic_lnum = tonumber (lnum ) - 1
35+ local diagnostic_col = tonumber (col ) or 0
3436 table.insert (diagnostics , {
3537 bufnr = bufnr ,
3638 test_id = test_id ,
37- lnum = tonumber ( lnum ) ,
38- end_lnum = tonumber ( lnum ) ,
39- col = tonumber ( col ) ,
40- end_col = tonumber ( col ) ,
39+ lnum = diagnostic_lnum ,
40+ end_lnum = diagnostic_lnum ,
41+ col = diagnostic_col ,
42+ end_col = diagnostic_col ,
4143 message = remove_ansi_codes (unescape_html (failure_content )),
4244 source = ' rustaceanvim' ,
4345 severity = vim .diagnostic .severity .ERROR ,
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2323 local expected = {
2424 {
2525 bufnr = 0 ,
26- lnum = 86 ,
27- end_lnum = 86 ,
26+ lnum = 85 ,
27+ end_lnum = 85 ,
2828 col = 64 ,
2929 end_col = 64 ,
3030 message = [[
You can’t perform that action at this time.
0 commit comments