yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
458 stars 49 forks source link

Add: diagnostic virtual text wrapping mode option #449

Closed TheDreadedAndy closed 7 months ago

TheDreadedAndy commented 7 months ago

There's currently not a way to configure the wrapping mode of diagnostic virtual text. This prevents users from configuring diagnostics like the default in neovim, which is after the line containing the error and truncated when too long.

This PR adds a configuration option that lets the wrapping mode be forced to either 'wrap' or 'truncate', or kept as it was before this PR ('default', the default value, which uses 'wrap' for 'after' and 'truncate' for 'above' and 'below').

TheDreadedAndy commented 7 months ago

Just a note: It seems vims virtual text behavior with 'after' + 'truncate' is a little odd. It will keep appending to the line until the first text must be truncated, then any future text will go on the next line until it needs to be truncated, etc.

Example:

def foo(): E> An error E> Another err...
E> A third error E> A long fourth err...