From 8ebceef6265468f8c0201379433d322d4018b184 Mon Sep 17 00:00:00 2001 From: LoongzF <1244098393@qq.com> Date: Mon, 20 Jul 2026 20:41:09 +0800 Subject: [PATCH] fix(sdks): update deprecated VSCode TypeScript settings to new keys Replace deprecated VSCode settings in generated TypeScript SDK: - `typescript.tsdk` -> `js/ts.tsdk.path` - `typescript.enablePromptUseWorkspaceTsdk` -> `js/ts.tsdk.promptToUseWorkspaceVersion` Also update help text and project's own .vscode/settings.json accordingly. Closes #7107 --- .vscode/settings.json | 4 ++-- packages/yarnpkg-sdks/sources/commands/SdkCommand.ts | 2 +- packages/yarnpkg-sdks/sources/sdks/vscode.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b121ffc14efa..b67ebeba9434 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "editor.tabSize": 2, "files.eol": "\n", - "typescript.tsdk": ".yarn/sdks/typescript/lib", + "js/ts.tsdk.path": ".yarn/sdks/typescript/lib", "typescript.tsserver.watchOptions": { "watchFile": "useFsEventsOnParentDirectory", "watchDirectory": "useFsEvents" @@ -21,7 +21,7 @@ "pasteImage.basePath": "${projectRoot}/packages/gatsby/static", "pasteImage.forceUnixStyleSeparator": true, "pasteImage.prefix": "/", - "typescript.enablePromptUseWorkspaceTsdk": true, + "js/ts.tsdk.promptToUseWorkspaceVersion": true, "search.exclude": { "**/.pnp.*": true, "**/.yarn": true, diff --git a/packages/yarnpkg-sdks/sources/commands/SdkCommand.ts b/packages/yarnpkg-sdks/sources/commands/SdkCommand.ts index 0492f1f4620f..d880509a6f5e 100644 --- a/packages/yarnpkg-sdks/sources/commands/SdkCommand.ts +++ b/packages/yarnpkg-sdks/sources/commands/SdkCommand.ts @@ -27,7 +27,7 @@ export default class SdkCommand extends Command { - When \`base\` is used, only the base SDKs will be generated. This is useful for when an editor is not yet supported and you plan to manage the settings yourself. - - When a set of integrations is used (e.g. \`vscode\`, \`vim\`, ...), the base SDKs will be installed plus all the settings relevant to the corresponding environments (for example on VSCode it would set \`typescript.tsdk\`). + - When a set of integrations is used (e.g. \`vscode\`, \`vim\`, ...), the base SDKs will be installed plus all the settings relevant to the corresponding environments (for example on VSCode it would set \`js/ts.tsdk.path\`). The supported integrations at this time are: ${[...SUPPORTED_INTEGRATIONS.keys()].map(integration => `\`${integration}\``).join(`, `)}. diff --git a/packages/yarnpkg-sdks/sources/sdks/vscode.ts b/packages/yarnpkg-sdks/sources/sdks/vscode.ts index a4776a4b0c03..73b72c5d4e27 100644 --- a/packages/yarnpkg-sdks/sources/sdks/vscode.ts +++ b/packages/yarnpkg-sdks/sources/sdks/vscode.ts @@ -95,14 +95,14 @@ export const generateRelayCompilerWrapper: GenerateIntegrationWrapper = async (p export const generateTypescriptWrapper: GenerateIntegrationWrapper = async (pnpApi: PnpApi, target: PortablePath, wrapper: Wrapper) => { await addVSCodeWorkspaceConfiguration(pnpApi, VSCodeConfiguration.settings, { - [`typescript.tsdk`]: npath.fromPortablePath( + [`js/ts.tsdk.path`]: npath.fromPortablePath( ppath.dirname( wrapper.getProjectPathTo( `lib/tsserver.js` as PortablePath, ), ), ), - [`typescript.enablePromptUseWorkspaceTsdk`]: true, + [`js/ts.tsdk.promptToUseWorkspaceVersion`]: true, }); };