LSP
LSP copied to clipboard
Add setting for diagnostics sort order
This is a suggestion to make the sort order for diagnostics (per file) configurable by the user. It allows for example to restore the former sorting by location, which was removed when the DiagnosticsManager / Goto Diagnostic quick panel was added.
I've left the default value to be unsorted (current behavior).
For some context see https://github.com/sublimelsp/LSP/pull/1884#issuecomment-960159248
I've also move the "show_multiline_diagnostics_highlights" setting up a little bit in LSP.sublime-settings, so that all settings related to diagnostics are grouped together.
Even though I've originally raised this need, I don't think anymore that it's better to sort by location after using the current logic for a while.
Nonetheless, this looks like potentially useful and simple feature.
@jwortmann are you fine with dropping this PR? Nobody else complained, I personally don't miss this feature either so it's probably not worth complicating the code.
Well, I still find it weird to use just the arbitrary and sometimes random ordering from the server, rather than sorting the diagnostics. Especially for the "Goto diagnostic" in the command palette it seems confusing to me that the view scrolls back and forth when you repeatedly press the arrow-down key in the list.

VSCode for example seems to sort the diagnostics by line number in its problem panel. But the matter is not that important to me and I rarely use the diagnostics panel anyway, so I guess we can close this.
Nobody else complained
That's true, but not really an argument that it is the best solution what is currently used, because before the PR which removed the sorting I think also nobody complained over a time of several years :)