Skip to content

tame the gigantic conflicts diagnostic #7

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

Closed
ratmice opened this issue Apr 28, 2022 · 3 comments
Closed

tame the gigantic conflicts diagnostic #7

ratmice opened this issue Apr 28, 2022 · 3 comments

Comments

@ratmice
Copy link
Owner

ratmice commented Apr 28, 2022

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.

@ratmice
Copy link
Owner Author

ratmice commented May 2, 2022

FWIW, I filed microsoft/language-server-protocol#1458 and microsoft/language-server-protocol#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:

  1. I don't think this will work with wasm based extension,
  2. How would we invalidate it?
    • Delete the file (It may still be open in the editor but shown as deleted)
    • Truncate it and add some message to the file (assuming we open it as read-only, it should notice and reflect current state)
  3. Writing random files to potentially version controlled sources is just not nice, I'd rather keep this within the editor.

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.

@ratmice
Copy link
Owner Author

ratmice commented Jan 19, 2023

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

@ratmice ratmice closed this as completed Jan 19, 2023
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

No branches or pull requests

1 participant