Multi-file web sandbox on a VS Code workbench - #244
Merged
Merged
Conversation
SpaceManiac
approved these changes
Oct 3, 2026
SpaceManiac
left a comment
Contributor
There was a problem hiding this comment.
UI is a little buggy in places:
- Top-right "Account" button doesn't do anything (should probably just hide it)
- Top-right gear button puts its menu out of view underneath the right side tabs
- Highlight under icon buttons is too small (doesn't cover the whole icon)
These are weird quirks and if there doesn't seem to be a non-hacky solution, we can let them ride for now.
Abstract filesystem access behind a synchronous `Vfs` trait so the
compiler and language server can run over in-memory files in the
browser, then use it to make the web sandbox a multi-file VS Code
workbench.
- starstream-types: `Vfs` trait with `NativeFs`, `MemoryFs` and
`OverlayFs`; `FileSystem` now wraps a `Vfs`.
- starstream-compiler: `ModuleGraph` reads, canonicalizes and scans
directories only through `FileSystem`. Add `ModuleId::ENTRY`,
`ModuleGraphError::import_site`; skip `node_modules/`.
- starstream-language-server:
- analyse through an overlay of open buffers > files pushed by the
client via `starstream/syncFiles` > disk, so unsaved edits in
imported files are seen;
- re-check open documents when a file they depend on changes;
- cross-file go-to-definition for path imports;
- report import errors on the import instead of silently falling
back to single-file mode.
- vscode-starstream: push workspace `.star`/`.wasm` files to the
server, since the Wasm server can't read the filesystem.
- starstream-sandbox-web: compile `{ files, entry }` through the
module graph.
- website: the sandbox editor is a VS Code workbench over an in-memory
workspace (explorer, search, problems, command center), replacing the
single editor and the Diagnostics tab.
Signed-off-by: rvcas <x@rvcas.dev>
- Hide the title bar's Accounts button (there's nothing to sign in to)
by setting VS Code's stored `workbench.activity.showAccounts`
preference.
- Let the editor panel overflow so menus VS Code opens near its right
edge (e.g. the gear) overlap the output panel instead of being
clipped.
- Restore `content-box` inside the workbench: Infima's global
`* { box-sizing: border-box }` shrank icon button highlights to the
icon.
Signed-off-by: rvcas <x@rvcas.dev>
rvcas
force-pushed
the
vfs-web-workbench
branch
from
October 5, 2026 02:57
0787d55 to
1c7d5b8
Compare
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.
Makes the web sandbox a multi-file VS Code workbench, by abstracting filesystem access so the compiler and language server can run over in-memory files in the browser.
Filesystem abstraction
starstream-types: a synchronousVfstrait withNativeFs(std::fs),MemoryFs(in-memory, lexical path normalization) andOverlayFs(aMemoryFsover anotherVfs). Synchronous on purpose: in the browser the compiler is Wasm and can't block on JS promises, so hosts populate memory up front.FileSystemwraps aVfs;FileSystem::new()still means the real filesystem, so CLI call sites are unchanged.starstream-compiler:ModuleGraphgoes throughFileSystemfor everything (it used to callstd::fs::canonicalize/read_dirdirectly). AddsModuleId::ENTRYandModuleGraphError::import_site. The workspace scan now also skipsnode_modules/.Language server
starstream/syncFilesnotification > disk. Unsaved edits in imported files are now seen (previously imports were read from disk).didChangeWatchedFileswatcher.VS Code extension
The extension's language server is Wasm in a worker (also on desktop VS Code), so it can't read the filesystem. The extension now pushes workspace
.star/.wasmfiles viastarstream/syncFilesand keeps them in sync with a file watcher.Web sandbox
/workspaceseeded with a two-file starter: explorer, search, problems panel, command center. It replaces the single editor and the Diagnostics tab (diagnostics are in the editor and the Problems panel).{ files, entry }and compiles through the module graph, likestarstream wasm -c, using the active.starfile (ormain.star) as the entry.Follow-ups
starstream buildinstead of the active file #242: compile the workspace likestarstream build(affects how Run should work).Testing
cargo testforstarstream-types,starstream-compiler,starstream-language-server,starstream-to-wasm,starstream-cli; clippy (native, and wasm32 for the web crates).MemoryFs/OverlayFs/NativeFs, in-memory module graphs, multi-file language-server analysis, and a server-level test drivinginitialize→syncFiles→didOpen/didChange/didCloseover JSON-RPC.