Skip to content

fix: surface status bar warning when TS plugin bootstrap fails on read-only extension installs (fixes #637)#720

Merged
tnaum-ms merged 3 commits into
microsoft:mainfrom
hanhan761:fix-637-readonly-ts-plugin-status-bar
Jun 22, 2026
Merged

fix: surface status bar warning when TS plugin bootstrap fails on read-only extension installs (fixes #637)#720
tnaum-ms merged 3 commits into
microsoft:mainfrom
hanhan761:fix-637-readonly-ts-plugin-status-bar

Conversation

@hanhan761

@hanhan761 hanhan761 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

When the extension is installed in a read-only environment (Snap, system package manager, locked enterprise, network share), the TS plugin stub creation fails with EACCES or EROFS. Currently this fails silently -- telemetry and debug logs capture the error, but users get no visible signal that TypeScript-powered completions are unavailable.

Changes

  • Detect EACCES / EROFS in the ensureTsRestart catch block
  • On read-only failures, set a tsPluginUnavailable flag to skip automatic future retries (avoiding repeated silent failures)
  • Surface a status bar item with warning icon ($(warning) DocumentDB TS Plugin) and a tooltip explaining the limitation
  • Register a vscode-documentdb.command.retryTsPluginBootstrap command wired to the status bar item's click, so users can manually retry after fixing the underlying permission issue
  • Non-filesystem failures continue to retry as before (transient TS server readiness, timing issues)

Issue

Fixes #637

Verification

  • npm run build -- no new errors in src/documentdb/ClustersExtension.ts
  • Existing TS6305 errors in packages/ subdirectories are pre-existing (monorepo packages not yet built)

Copilot AI review requested due to automatic review settings June 2, 2026 13:15
@hanhan761 hanhan761 requested a review from a team as a code owner June 2, 2026 13:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds clearer behavior when the TypeScript plugin stub can’t be installed due to read-only extension installs, preventing repeated bootstrap attempts and surfacing a persistent warning to the user.

Changes:

  • Introduces a tsPluginUnavailable flag to stop future TS bootstrap retries after specific failures.
  • Detects EACCES/EROFS and shows a status bar warning describing the limitation.
  • Keeps transient failures retryable by resetting tsRestarted only for non-permission errors.

Comment thread src/documentdb/ClustersExtension.ts
Comment thread src/documentdb/ClustersExtension.ts Outdated
Comment thread src/documentdb/ClustersExtension.ts Outdated
@tnaum-ms tnaum-ms added the in-triage-queue We've seen your input and will triage it label Jun 4, 2026
hanhan761 and others added 3 commits June 19, 2026 12:24
- Replace dead-end status bar button (opened playground) with 'Retry TS Plugin Setup' command
  that resets the unavailable flag and re-attempts bootstrap
- Extract magic number 100 to named TS_PLUGIN_WARNING_PRIORITY constant
- Guard command registration to prevent duplicate handlers on repeated failures
@tnaum-ms tnaum-ms force-pushed the fix-637-readonly-ts-plugin-status-bar branch from a8f8ced to 23200e9 Compare June 19, 2026 12:28
@tnaum-ms tnaum-ms removed the in-triage-queue We've seen your input and will triage it label Jun 19, 2026
@tnaum-ms tnaum-ms added this to the 0.9.1 milestone Jun 19, 2026
@tnaum-ms

Copy link
Copy Markdown
Collaborator

Maintainer note (review-driven changes)

Beyond the items Copilot flagged, this branch received a few review-driven fixes that were not part of the original review comments:

  1. The warning status bar item is now created once and reused through a shared reference. Previously a failed retry could create a second status bar item while the retry command still referenced the original (disposed) one, leaving a stale warning.
  2. The retry command's disposable is now registered in context.subscriptions.
  3. The status bar text, tooltip, and command title are now localized via vscode.l10n.t().

Heads-up for reviewers: the read-only (EACCES/EROFS) path still needs a manual test on an actual read-only extension install (Snap, system package, locked/enterprise share) since it cannot be exercised by the unit suite.

@tnaum-ms tnaum-ms merged commit e3b7345 into microsoft:main Jun 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playground TS plugin bootstrap can fail silently on read-only extension installs

4 participants