Closed ratmice closed 1 year ago
FWIW, I filed https://github.com/microsoft/language-server-protocol/issues/1458 and https://github.com/microsoft/language-server-protocol/issues/1461 related to this,
I think currently we could so something hacky, by generating a file directly on the filesystem containing the conflict information, lets call it conflict_report.txt
then emitting a diagnostic which links to file://.../conflict_report.txt
via relatedDocuments
.
I hestitate to do it for a few reasons:
Anyhow I just don't realistically see all the conflict information fitting within the UI that diagnostics are currently limited to.
The writing a report directly to the filesystem and linking to that, does have the benefit of being something we can emit now without changing LSP and we don't actually work as a web/wasm based extension yet. So I may need to do that despite the fact that I find it terrible. Because it doesn't really seem like it will be a fast process to add a mechanism here to LSP.
Option 2:
Adding an lsp extension, I think we'd have to basically emit an entire replacement for Diagnostic
, and client side handlers for this extension. Doesn't seem like the typical extension, because it is an alternative to rather core lsp functionality and involves quite a bit on the editor side.
While there is probably a lot more that can be done here, I'm going to close as PR #10 and #18 have generally improved things, such that the conflict output is no longer gigantic
The gigantic conflicts diagnostic needs a lot of experimentation. In theory each state may be separated out into a 'related diagnostic', providing a jump location for each individual state.
But diagnostics are typically fairly short and editor UI's reflect that. vscode even with the, diagnostic output window maximized doesn't read easily, nvim
lsp.diagnostics.open_float()
doesn't scroll.I'm not certain diagnostics are actually going to be the right thing for this information, It may be that we want an LSP extension which provides a list of jump targets.