Skip to content

Commit

Permalink
Do not require diagnostic severity for ale
Browse files Browse the repository at this point in the history
Some LSPs like for example neocmakelsp [0] do not mark the diagnostics
with a severity, which would throw an error:

```
Error detected while processing function <SNR>66_Output_cb[5]..lsp#handlers#ProcessMess
ages[32]..lsp#handlers#ProcessNotif[52]..<SNR>67_ProcessDiagNotif[2]..lsp#diag#DiagNoti
fication[72]..lsp#diag#ProcessNewDiags[5]..<SNR>69_SendAleDiags[14]..<lambda>46:
line    6:
E716: Key not present in Dictionary: "severity"
```

To fix this, default to "INFO" severity level.

[0] https://github.com/Decodetalkers/neocmakelsp
  • Loading branch information
vimpostor committed Jun 26, 2024
1 parent 89d5350 commit 2639104
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/lsp/diag.vim
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def SendAleDiags(bnr: number, timerid: number)
col: util.GetLineByteFromPos(bnr, v.range.start) + 1,
end_lnum: v.range.end.line + 1,
end_col: util.GetLineByteFromPos(bnr, v.range.end) + 1,
type: "EWIH"[v.severity - 1]}
type: "EWIH"[get(v, "severity", 3) - 1]}
})
)
enddef
Expand Down

0 comments on commit 2639104

Please sign in to comment.