Skip to content

Set js/ts.experimental.useTsgo on first run#3279

Open
jakebailey wants to merge 5 commits intomainfrom
jabaile/enable-on-first-run
Open

Set js/ts.experimental.useTsgo on first run#3279
jakebailey wants to merge 5 commits intomainfrom
jabaile/enable-on-first-run

Conversation

@jakebailey
Copy link
Copy Markdown
Member

Fixes #3278

On first activate, if the useTsgo setting is unset, enable it.

Copilot AI review requested due to automatic review settings March 27, 2026 22:42
output.appendLine("TypeScript Native Preview is disabled. Select 'Enable TypeScript Native Preview (Experimental)' in the command palette to enable it.");
return;
}
else if (useTsgo === undefined) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure if this isn't aggressive enough, or is too aggressive.

return;
}
else if (useTsgo === undefined) {
if (!context.globalState.get<boolean>(hasActivatedKey)) {
Copy link
Copy Markdown
Member Author

@jakebailey jakebailey Mar 27, 2026

Choose a reason for hiding this comment

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

All users who do not have it enabled right now will not have this set, and therefore will be onboarded on update. However, if you had it installed, tried it, then disabled it by commenting out the option, we won't know that's the case and will flip it on again. Not sure how to handle that.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the VS Code extension activation flow to automatically enable the native preview language server on the first activation when the useTsgo setting hasn’t been explicitly configured, addressing “installed but not enabled” cases (Fixes #3278).

Changes:

  • Distinguish between useTsgo === false (explicitly disabled) vs useTsgo === undefined (unset) during activation.
  • On first activation with an unset setting, persist a “has activated” flag and invoke the enable command to turn on the preview.
  • Record activation in global state to avoid repeating the one-time behavior.

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.

Add one-time prompt to enable extension

3 participants