-
Notifications
You must be signed in to change notification settings - Fork 35.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
openEditorcalls from within the override - the input that was originally used for the
openEditorcall is never disposed - the caller of
openEditormight 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#openEditoraltogether, instead the rule is that theEditorInputthat is passed into a group for opening is the correct one - we enrich the
IEditorServicewith support for converting aURIinto aEditorInputincluding custom editors, this can easily be added to the existingIEditorService#createEditorInputmethod - we leverage the custom editor input factories for this purpose that are already registered to convert a
URIinto theEditorInput - we allow to pass in a special
overrideoption that will bring up a picker to pick a custom editor (this essentially moves the picker logic fromopenEditorWithintoIEditorService - 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
fileInputFactoryandcustomInputFactoryinto 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