Display the full (rust) compiler error #15032
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull requests adds the CTRL+ENTER and SHIFT+ENTER key bindings in preview that opens a scratch buffer showing the full compiler error.
This is an alternative to #13571
Motivation
When displaying the errors from the LSP, at least in the case of Rust, it is sometimes useful to see the full compiler error. This pull request modifies the Diagnostics Picker's by adding the CTRL+ENTER and SHIFT+ENTER key binding that opens a scratch buffer to display the actual compiler error (if available).
CTRL+ENTERSHIFT+ENTERFor now, the error is displayed without coloring. Using color requires more work.
I tested this PR only in the context of Rust, but I assume other LSPs might do the same.
New Buffer
New Horizontal Buffer
Still needs
Additional Notes
Editor API
I had to. modify the
EditorAPI and make theEditor::new_file_from_documentfunction public to open a scratch buffer with text. Without this, I can open a new empty scratch buffer and apply a transaction, but it will show up in the undo history and will not allow the user to close is without usingbuffer-close!orq!which are the second command when typing.The code doing this is now commented, it seems that
document.reset_modified();has no effect.Picker API
This pull request adds the ability to attach notes to pickers. It uses this to attach the full compiler error as a note. The picker does not really care about the note contents, it just display the notes when CTRL+ENTER or SHIFT+ENTER are pressed.
Another solution would have been to either:
ActionlikeNotesandHorizontalNotes