Set js/ts.experimental.useTsgo on first run#3279
Open
jakebailey wants to merge 5 commits intomainfrom
Open
Conversation
jakebailey
commented
Mar 27, 2026
| 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) { |
Member
Author
There was a problem hiding this comment.
I'm not sure if this isn't aggressive enough, or is too aggressive.
jakebailey
commented
Mar 27, 2026
_extension/src/extension.ts
Outdated
| return; | ||
| } | ||
| else if (useTsgo === undefined) { | ||
| if (!context.globalState.get<boolean>(hasActivatedKey)) { |
Member
Author
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
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) vsuseTsgo === 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.
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.
Fixes #3278
On first activate, if the useTsgo setting is unset, enable it.