Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show diagnostics on multiline diags #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kazy
Copy link

@Kazy Kazy commented Jun 13, 2024

Currently if a diagnostic spans multiple lines, the current implementation doesn't show anything past the first line. This changes this behavior.

This is set as the default, but happy to but that behind a flag if needed.

The one case that is problematic (even now) is if end_col doesn't exist (as it seems it can be, same for end_lnum) then the last check diag.col <= col and (diag.end_col or diag.col) >= col) will only be true on the actual col and nowhere else since (diag.col <= col and diag.col >= col) is equivalent to the two being equal. I don't know how often this happens in practice. This is why I've kept the old behavior if we don't have diag.end_col and diag.end_lnum, though personally I would show it for the whole line if we don't have a end_col.

If a diagnostic spans multiple lines, the current implementation doesn't
show anything past the first line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant