You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is implemented in src/documentdb/ClustersExtension.ts inside ensureTsRestart. The stub is a workaround because @vscode/vsce hardcodes ignore: 'node_modules/**' and the plugin cannot ship inside the VSIX. The long-term fix is tracked in #548 (publish the plugin as a standalone npm package).
The runtime stub install assumes that the extension install directory is writable, which is not always the case:
VS Code installed via Snap or a system package manager (for example /usr/share/code/... on Linux).
VS Code Server inside hardened containers or air-gapped enterprise deployments.
Codespaces or dev container images where the extensions layer is read only.
Roaming or managed installs where the extension files live on a network share.
In these environments fs.mkdirSync / fs.writeFileSync throw EACCES or EROFS. The current implementation now reports the failure through telemetry (playground.tsPluginBootstrap event with stage, stubCreated, error name and message) and resets the retry flag so a subsequent playground open will try again. That gives us observability and best effort recovery, but the underlying root cause remains: we cannot rely on writing into the extension install directory.
Why this matters
Playground IntelliSense (method completions, parameter help, signatures backed by the TS server plugin) becomes unavailable. Other custom completions (collection names, operators, BSON constructors) keep working because they are provided by the in-process CompletionItemProvider. So the failure mode is "everything still works, but TypeScript-aware completions are quietly missing", which is hard for users to self-diagnose.
Write the stub into the extension's global storage path (ext.context.globalStorageUri.fsPath) and have the plugin loader resolve from there. Global storage is always writable. Trade off: the TS server resolves plugins relative to the extension root, so we may need to publish a thin shim package whose only job is to redirect to the global-storage location.
Ship the stub via the build pipeline instead of at runtime. Investigate whether vsce package --no-dependencies plus a custom files glob allows a single node_modules/<plugin>/index.js shim to be included. Recent vsce versions accept --packagePath and --baseImagesUrl, but the node_modules/** ignore is still hardcoded; verify against the current version.
Detect read-only state up front and surface a status bar hint when the bootstrap fails, with a link to a documentation page that explains the limitation and offers a workaround (for example installing VS Code from the standalone tarball instead of Snap).
Fall back to a degraded but functional experience: even without the TS plugin, surface a one-time notification telling the user that method completions are unavailable for this install, with a "Don't show again" toggle.
Problem statement
To make the Query Playground TS server plugin discoverable, the extension creates a stub at runtime inside its own install directory:
This is implemented in
src/documentdb/ClustersExtension.tsinsideensureTsRestart. The stub is a workaround because@vscode/vscehardcodesignore: 'node_modules/**'and the plugin cannot ship inside the VSIX. The long-term fix is tracked in #548 (publish the plugin as a standalone npm package).The runtime stub install assumes that the extension install directory is writable, which is not always the case:
/usr/share/code/...on Linux).In these environments
fs.mkdirSync/fs.writeFileSyncthrowEACCESorEROFS. The current implementation now reports the failure through telemetry (playground.tsPluginBootstrapevent withstage,stubCreated, error name and message) and resets the retry flag so a subsequent playground open will try again. That gives us observability and best effort recovery, but the underlying root cause remains: we cannot rely on writing into the extension install directory.Why this matters
Playground IntelliSense (method completions, parameter help, signatures backed by the TS server plugin) becomes unavailable. Other custom completions (collection names, operators, BSON constructors) keep working because they are provided by the in-process
CompletionItemProvider. So the failure mode is "everything still works, but TypeScript-aware completions are quietly missing", which is hard for users to self-diagnose.Suggested solutions
In rough order of preference.
typescriptServerPluginscontract.ext.context.globalStorageUri.fsPath) and have the plugin loader resolve from there. Global storage is always writable. Trade off: the TS server resolves plugins relative to the extension root, so we may need to publish a thin shim package whose only job is to redirect to the global-storage location.vsce package --no-dependenciesplus a customfilesglob allows a singlenode_modules/<plugin>/index.jsshim to be included. Recent vsce versions accept--packagePathand--baseImagesUrl, but thenode_modules/**ignore is still hardcoded; verify against the current version.References
src/documentdb/ClustersExtension.ts(ensureTsRestart).playground.tsPluginBootstrapwith propertiesstage,stubCreated,tsExtensionFound.docs/ai-and-plans/interactive-shell/7-playground-completion-provider.md.Definition of done
extension.../node_modules/is removed or made resilient on read-only installs.