-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Closed
Closed
Copy link
Labels
custom-editorsCustom editor API (webview based editors)Custom editor API (webview based editors)debtCode quality issuesCode quality issuesworkbench-editorsManaging of editor widgets in workbench windowManaging of editor widgets in workbench window
Description
Today our editor override works very late as part of the openEditor
. This has a couple of issues:
- we end up calling each contributed override whenever an editor opens, even when you just click on a tab
- you end up with re-entrant
openEditor
calls from within the override - the input that was originally used for the
openEditor
call is never disposed - the caller of
openEditor
might get a very unexpected result from what was originally passed in
If we had a way to override the editor at the level of where the input is created things would be cleaner.
Proposal:
- we remove the override event and override handling from
editorGroupView#openEditor
altogether, instead the rule is that theEditorInput
that is passed into a group for opening is the correct one - we enrich the
IEditorService
with support for converting aURI
into aEditorInput
including custom editors, this can easily be added to the existingIEditorService#createEditorInput
method - we leverage the custom editor input factories for this purpose that are already registered to convert a
URI
into theEditorInput
- we allow to pass in a special
override
option that will bring up a picker to pick a custom editor (this essentially moves the picker logic fromopenEditorWith
intoIEditorService
- for the case of "Reopen with..." we can use the same concepts: by calling
IEditorService.replaceEditors(activeEditor, { resource: activeEditor.resource, options: { override: <show picker> })
everything should just work - we adopt this concept for all editors that are not standard: notebooks, custom editors, search editors, settings editor
- bonus: we can think about merging the
fileInputFactory
andcustomInputFactory
into one so that we just have 1 way of resolving an editor input from a resource and not 2
Metadata
Metadata
Labels
custom-editorsCustom editor API (webview based editors)Custom editor API (webview based editors)debtCode quality issuesCode quality issuesworkbench-editorsManaging of editor widgets in workbench windowManaging of editor widgets in workbench window