mfussenegger / nvim-lint

An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support.
GNU General Public License v3.0
1.94k stars 204 forks source link

Feature Request: Change default behavior when linter only provides start column #544

Closed EricDriussi closed 7 months ago

EricDriussi commented 7 months ago

Hi there! I was migrating over from null-ls/none-ls and noticed that markdownlint behaved differently: No underlines would appear where they did with null-ls.

I looked around the issues and found this similar one. This comment seems to explain the issue.

This got me thinking: wouldn't it be reasonable to change the default behavior so that, if the provided diagnostics don't contain a range/end column, the end of the line would be used instead of the starting column?

I'm guessing there might be more linters that only provide start column to signify the whole line as troublesome.

Looking around the code it seems like changing this and this line would achieve that but I'm not quite sure it this makes sense.

Is there a reason why the default behavior is the way it currently is?

mfussenegger commented 7 months ago

I don't see why highlighting the end of line would be more reasonable. The diagnostic could refer to the word starting at the column, or a couple of words, without end information it's simply not clear what range is affected.

I've no plans to change this