-
Notifications
You must be signed in to change notification settings - Fork 42.5k
Suggest TypeScript 7 for users with no plugins enabled #335369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Daniel Rosenwasser (DanielRosenwasser)
merged 5 commits into
main
from
suggestTs7IfNoPlugins2
Sep 16, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
67c6545
New experiment to roll out suggestions for TypeScript 7 when there ar…
DanielRosenwasser 8460252
Recognize TS7 nightly extension.
DanielRosenwasser fbf2f08
Actually don't prompt again.
DanielRosenwasser cc6aebc
Native Preview -> 7
DanielRosenwasser 3c7ec43
Don't prompt if `useTsgo` was set.
DanielRosenwasser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,35 +6,40 @@ | |
| import * as vscode from 'vscode'; | ||
| import { getTsNativeExtension, tsNativeExtensionOldId } from '../commands/useTsgo'; | ||
| import { ExperimentationService } from '../experimentationService'; | ||
| import type { PluginManager } from '../tsServer/plugins.js'; | ||
| import { copilotChatExtensionId } from '../typescriptServiceClient.js'; | ||
| import { hasModifiedUnifiedConfig } from '../utils/configuration'; | ||
|
|
||
| const suggestNativePreviewStorageKey = 'typescript.suggestNativePreview.dismissed'; | ||
| const suggestTS7NoPluginsStorageKey = 'typescript.suggestTS7NoPlugins.dismissed'; | ||
|
|
||
| export async function suggestNativePreview( | ||
| context: vscode.ExtensionContext, | ||
| experimentationService: ExperimentationService, | ||
| pluginManager: PluginManager | ||
| ): Promise<void> { | ||
| if (context.globalState.get<boolean>(suggestNativePreviewStorageKey)) { | ||
| return; | ||
| if (context.globalState.get<boolean>(suggestTS7NoPluginsStorageKey)) { | ||
| // return; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NO |
||
| } | ||
|
|
||
| // Only show when the window is active | ||
| if (!vscode.window.state.active) { | ||
| return; | ||
| } | ||
|
|
||
| // Only show when the nightly extension is installed | ||
| if (!vscode.extensions.getExtension('ms-vscode.vscode-typescript-next')) { | ||
| // Don't show if the TypeScript 7 extension is already installed, | ||
| // or if we have any settings indicating it was installed previously. | ||
| if (getTsNativeExtension() || hasModifiedUnifiedConfig('experimental.useTsgo', { fallbackSection: 'typescript' })) { | ||
| // Also don't prompt in the future. | ||
| await context.globalState.update(suggestTS7NoPluginsStorageKey, true); | ||
| return; | ||
| } | ||
|
|
||
| // Don't show if the native preview extension is already installed | ||
| if (getTsNativeExtension()) { | ||
| // Also don't prompt in the future | ||
| await context.globalState.update(suggestNativePreviewStorageKey, true); | ||
| // TSServer plugins are not supported by TypeScript 7 | ||
| if (pluginManager.plugins.some(plugin => plugin.extension.id.toLowerCase() !== copilotChatExtensionId)) { | ||
| return; | ||
| } | ||
|
|
||
| const inExperiment = await experimentationService.getTreatmentVariable('suggestNativePreview', false); | ||
| const inExperiment = await experimentationService.getTreatmentVariable('suggestTS7IfNoPlugins', false); | ||
| if (!inExperiment) { | ||
| return; | ||
| } | ||
|
|
@@ -44,18 +49,18 @@ export async function suggestNativePreview( | |
| const dismiss: vscode.MessageItem = { title: vscode.l10n.t("Don't Show Again") }; | ||
|
|
||
| const selection = await vscode.window.showInformationMessage( | ||
| vscode.l10n.t("Try TypeScript 7 Native Preview for significantly faster type checking and language features."), | ||
| vscode.l10n.t("Try TypeScript 7 for significantly faster type checking and language features."), | ||
| {}, | ||
| install, | ||
| learnMore, | ||
| dismiss, | ||
| ); | ||
| // Don't show again | ||
| await context.globalState.update(suggestNativePreviewStorageKey, true); | ||
| await context.globalState.update(suggestTS7NoPluginsStorageKey, true); | ||
|
|
||
| if (selection === install) { | ||
| await vscode.commands.executeCommand('workbench.extensions.installExtension', tsNativeExtensionOldId); | ||
| } else if (selection === learnMore) { | ||
| await vscode.env.openExternal(vscode.Uri.parse('https://aka.ms/vscode-try-ts-7-learn-more')); | ||
| await vscode.env.openExternal(vscode.Uri.parse('https://aka.ms/typescript7')); | ||
| } | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.