-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
How to show errors in the editor #9062
Comments
The current code is special for showing binary editors so it can not be reuesed nicely atm. |
Will wait for @bpasero to be back so we can discuss and not urgent -> August |
We discussed during our UX meeting and agreed that this seems like the right approach. |
This editor UI is used for files that are binary or have other limitations when opening, I am not sure we should reuse the same for your case. You are free to create your own editor input and editor and open it and you have DOM access to do whatever you want in there. There are some actions that target this editor that might expect it to be about a real file on disk and it does not sound like your scenario is about that. |
Is this an implementation issue or a UX issue? I'll add it to the agenda for tomorrow in case it is UX. |
@bpasero so I can create my own editor the same way you do for the binary resource editor. However I am not sure how to wire in my editor, since you just register it for certain mime types here. |
@isidorn you can bring in new editors to the workbench without having to register a mime. The way it works is that you register an editor and then make sure that you have at least one editor input support this editor. I suggest you add your own editor and input to show a message (or anything you need to show). The HTML preview editor is a good example: https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/html/browser/html.contribution.ts#L21 It connects an editor with an input. Everytime this input is opened via our APIs, this editor is being used and so you control the entire lifecycle end to end. |
@bpasero thanks a lot for the pointers! I remembered that we used this approach for the repl before it was a panel. We are now using a custom editor to render debug errors. |
@isidorn maybe at the minimum try to copy the styles from the binary editor 👍 |
Followup from #8836:
@isidorn we have already examples for how to show these kind of errors.
When trying to open a huge file, the error is shown like this:
We should align with that approach; ideally we should share the implementation.
The text was updated successfully, but these errors were encountered: