emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.72k stars 861 forks source link

Allow Flycheck to determine a diagnostic end position when needed. #4429

Closed brownts closed 2 months ago

brownts commented 2 months ago

When a Language Server doesn't support an end position for a diagnostic (by specifying an end position the same as the start position) Flycheck should be asked to compute the end position using it's flycheck-highlighting-mode setting. This is accomplished by passing nil as the end-column to flycheck-error-new.

This provides consistent behavior between Flymake and Flycheck as the Flymake integration already checks for this condition and uses it's similar functionality (i.e., flymake-diag-region) to compute an end position.