Repository navigation
feat(webview): open files in extensions' custom editors - #53
Merged
Merged
Conversation
Every host start copied every installed extension into its own storage, so a platform package an extension installs for itself (CodeLLDB does) could be unpacked without touching the extension store. rust-analyzer alone is 38MB, copied on each start. Hosts now run extensions from the store, as VS Code runs them from its extensions directory. A platform package is unpacked into the installed extension's own directory. Uninstalling or replacing a version only rewrites the registry; the old directory is deleted once no running host uses it.
Extensions built on custom editors (draw.io, the Hex Editor, image and SVG previewers) got no answer from MainThreadCustomEditors, so their files opened as text or were handed to the system. A file an enabled extension's contributes.customEditors claims by default now opens in the extension's page, in place of its other editors. Text editor providers and editable custom documents both work, with save, undo and redo from the page's keys, Save All, and saving on close. Editors that open a file only when asked for are under Open With, and a switcher beside the tabs reopens a file as text and writes Set Default to workbench.editorAssociations. In split mode the backend picks a project file's editors, so the client stands in a tab for the file, as for notebooks. A file of a type the IDE would hand to the system (PDFs, office documents) is given a non-native type and a placeholder editor so it reaches the client at all; see docs/platform-limitations.md. Webview resources now go through a service worker per webview origin that caches them by a version the backend gives, so a page as heavy as draw.io's loads quickly and again when reopened. Save As, backups, revert, diffs and moving an editor are not supported. Refs #52
This was referenced Nov 4, 2026
BartvHelvert
added a commit
that referenced
this pull request
Nov 5, 2026
All UI tests on one runner, each starting its own backend and client, outgrew the Windows step's 100 minutes once #53 added six more. -PuiTestShard=<index>/<count> runs one shard of the test classes, balanced by @test count, which is most of a test's time; a class stays whole. CI runs shards 1/2 and 2/2 on each OS. Without the property every test runs, as before. Refs #63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this changes
Adds custom editors (
contributes.customEditors,registerCustomEditorProvider). A file an enabledextension's custom editor claims by default opens in the extension's page, in place of its other
editors. This works for text editor providers and for editable custom documents, with save, undo
and redo from the page's keys, Save All, and saving on close. Editors with
"priority": "option"areunder Open With in the editor tab menu and the Project view. A switcher beside the tabs reopens a
file as text and writes Set Default to
workbench.editorAssociations.In split mode the backend picks a project file's editors, so the client shows a tab that stands in for
the file, as it does for notebooks. Files of a type the IDE would hand to the system, such as PDFs,
get a non-native type and a placeholder editor so that they reach the client at all. This is recorded
in
docs/platform-limitations.md. Webview resources now go through a service worker per webvieworigin, which caches them by version, so draw.io-sized pages load quickly, including when reopened.
Save As, backups, revert, diffs and moving an editor are not supported.
docs/status.mdanddocs/workbench-coverage.mdlist these.The first commit is a separate refactor. Hosts now run extensions from the extension store, as VS Code
does, instead of copying every installed extension on each host start. A platform package that an
extension installs for itself (CodeLLDB does) is unpacked into the installed extension's directory.
A replaced or uninstalled version is deleted once no running host uses it.
Fixes #52
How it was tested
SplitModeCustomEditorTest(6 tests, split mode, run in WSL under Xvfb): all pass. It covers atext editor provider's edit, undo and save; a custom document's undo, redo, save, and save on
close; Open With from the Project view; the editor switcher and Set Default; a
.pdf-named fileopening in its custom editor; and a draw.io-sized page loading its resources, including on reopen.
The workbench probe extension gained
custom-editor-probe.jsfor this.CustomEditorContributionsTest,CustomEditorsTest,CustomEditorTypesTest,Base64BytesTest, the webviewWebviewResourcesTest, and new cases inExtensionStoreTestandExtensionHostRouterTest.gradlew test: 1475 tests, 0 failures, 2 skipped. Most modules' results came from theup-to-date check or the build cache, so they are from earlier runs on the same inputs.
Draw.io Integration extension; it is not part of this verification.
Checklist
docs/is updated where behaviour changed,docs/status.mdespecially.NOTICE.md.