Switch remaining settings to use js/ts prefix#297076
Conversation
For microsoft#292934 Also renames some of the server settings to have a more consistent naming scheme. This is going to be annoying but is the best time to do this since we are already changing the full setting id
There was a problem hiding this comment.
Pull request overview
This PR continues the TypeScript/JavaScript settings migration by introducing/using unified js/ts.* setting IDs (with legacy fallbacks) and updating related UX (messages, deprecations, and setting contributions) in the built-in typescript-language-features extension.
Changes:
- Switch additional codepaths to read/write unified
js/ts.*settings viareadUnifiedConfig/UnifiedConfigValue, with fallbacks to legacytypescript.*/javascript.*. - Add new
js/ts.*settings contributions and mark legacy settings as deprecated in the extension’spackage.json/package.nls.json. - Update user-facing messaging and a few command/config flows to reference the new unified setting IDs.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/typescript-language-features/src/ui/typingsStatus.ts | Switch ATA failure flow to unified config + update message to new setting id |
| extensions/typescript-language-features/src/typescriptServiceClient.ts | Update TS Server logging prompt to reference js/ts.tsserver.log |
| extensions/typescript-language-features/src/tsServer/versionManager.ts | Write/read TypeScript version selection and tsgo flag via unified config |
| extensions/typescript-language-features/src/task/taskProvider.ts | Read tsc.autoDetect via unified config fallback |
| extensions/typescript-language-features/src/logging/logLevelMonitor.ts | Monitor log level via UnifiedConfigValue and update unified setting when disabling |
| extensions/typescript-language-features/src/languageProvider.ts | Simplify diagnostics handling (removes per-setting filtering in this path) |
| extensions/typescript-language-features/src/languageFeatures/util/dependentRegistration.ts | Remove legacy global-config condition helper; add unified-config condition helper |
| extensions/typescript-language-features/src/languageFeatures/updatePathsOnRename.ts | Write update-imports setting under unified config section |
| extensions/typescript-language-features/src/languageFeatures/fileConfigurationManager.ts | Keep reading unstable prefs from legacy per-language config as fallback |
| extensions/typescript-language-features/src/languageFeatures/completions.ts | Read import-statement suggestion setting via unified config fallback |
| extensions/typescript-language-features/src/filesystems/ata.ts | Gate ATA support using unified config condition |
| extensions/typescript-language-features/src/extension.ts | Use unified config condition for tsgo feature gating |
| extensions/typescript-language-features/src/configuration/configuration.ts | Move more service configuration reads to readUnifiedConfig |
| extensions/typescript-language-features/src/configuration/configuration.electron.ts | Prefer unified tsdk.path/tsserver.node.path during inspect-based reads |
| extensions/typescript-language-features/src/commands/useTsgo.ts | Toggle tsgo setting using unified config section + legacy-aware scope selection |
| extensions/typescript-language-features/package.nls.json | Add unified deprecation messages and new unified-setting strings |
| extensions/typescript-language-features/package.json | Contribute new js/ts.* settings and deprecate legacy setting IDs |
Comments suppressed due to low confidence (2)
extensions/typescript-language-features/src/configuration/configuration.electron.ts:81
- Same issue as above for the global case: the truthiness check on
unifiedInspect?.globalValuewill ignore an explicitly configured empty-string value and fall back to the legacy setting. Use an undefined check /typeof ... === 'string'without relying on truthiness.
const unifiedInspect = configuration.inspect('js/ts.tsserver.node.path');
const inspect = (unifiedInspect?.globalValue && typeof unifiedInspect.globalValue === 'string')
? unifiedInspect
: configuration.inspect('typescript.tsserver.nodePath');
extensions/typescript-language-features/package.json:200
tagshas special semantics for settings (e.g. showing the “experimental” badge). These settings previously usedtags: ["experimental"], but the PR changes them tokeywords, which likely drops the experimental tagging in the Settings UI. Consider keepingtags: ["experimental"](and optionally also addkeywordsfor search).
"js/ts.experimental.useTsgo": {
"type": "boolean",
"default": false,
"markdownDescription": "%typescript.useTsgo%",
"scope": "window",
"order": 2,
"keywords": [
"TypeScript",
"experimental"
]
},
"typescript.experimental.useTsgo": {
"type": "boolean",
"default": false,
"markdownDescription": "%typescript.useTsgo%",
"markdownDeprecationMessage": "%typescript.useTsgo.unifiedDeprecationMessage%",
"scope": "window",
"order": 2,
"keywords": [
"experimental"
]
},
| "js/ts.tsserver.automaticTypeAcquisition.enabled": { | ||
| "type": "boolean", | ||
| "default": true, | ||
| "markdownDescription": "%configuration.automaticTypeAcquisition.enabled%", | ||
| "scope": "window", | ||
| "keywords": [ | ||
| "TypeScript", | ||
| "usesOnlineServices" | ||
| ] | ||
| }, | ||
| "typescript.disableAutomaticTypeAcquisition": { | ||
| "type": "boolean", | ||
| "default": false, | ||
| "markdownDescription": "%typescript.disableAutomaticTypeAcquisition%", | ||
| "markdownDeprecationMessage": "%typescript.disableAutomaticTypeAcquisition.unifiedDeprecationMessage%", | ||
| "scope": "window", | ||
| "tags": [ | ||
| "keywords": [ | ||
| "usesOnlineServices" | ||
| ] |
There was a problem hiding this comment.
tags is used for special classifications such as usesOnlineServices. Switching this to keywords likely removes the usesOnlineServices tag from the Settings UI and related policy/visibility behavior. Keep tags: ["usesOnlineServices"] for these settings (you can still add keywords separately if needed).
This issue also appears on line 179 of the same file.
| "js/ts.tsdk.path": { | ||
| "type": "string", | ||
| "markdownDescription": "%typescript.tsdk.desc%", | ||
| "scope": "window", | ||
| "order": 1, | ||
| "keywords": [ | ||
| "TypeScript" | ||
| ] | ||
| }, |
There was a problem hiding this comment.
js/ts.tsdk.path reuses %typescript.tsdk.desc%, but that description text explicitly refers to typescript.tsdk. This will be confusing/misleading when shown for the new unified setting. Consider adding a new description string (or updating the existing one) that refers to js/ts.tsdk.path (and optionally mentions the legacy key as deprecated).
| import { getPackageInfo } from './utils/packageInfo'; | ||
| import * as temp from './utils/temp.electron'; | ||
| import { conditionalRegistration, requireGlobalConfiguration, requireHasVsCodeExtension } from './languageFeatures/util/dependentRegistration'; | ||
| import { conditionalRegistration, requireGlobalUnifiedConfig, requireHasVsCodeExtension } from './languageFeatures/util/dependentRegistration'; |
There was a problem hiding this comment.
requireGlobalConfiguration is imported here but is no longer exported from languageFeatures/util/dependentRegistration (it was removed in this PR). This will cause a compile error. Remove the unused import or reintroduce the export if it’s still needed.
| import { conditionalRegistration, requireGlobalUnifiedConfig, requireHasVsCodeExtension } from './languageFeatures/util/dependentRegistration'; | |
| import { conditionalRegistration } from './languageFeatures/util/dependentRegistration'; |
| const unifiedInspect = configuration.inspect('js/ts.tsserver.node.path'); | ||
| const inspect = (unifiedInspect?.workspaceValue && typeof unifiedInspect.workspaceValue === 'string') | ||
| ? unifiedInspect | ||
| : configuration.inspect('typescript.tsserver.nodePath'); |
There was a problem hiding this comment.
The unified config selection uses a truthiness check (unifiedInspect?.workspaceValue && ...). If the user explicitly sets the unified value to an empty string, this will incorrectly fall back to the legacy setting. Prefer checking for typeof unifiedInspect?.workspaceValue === 'string' (or !== undefined) instead of truthiness when deciding which inspect result to use.
This issue also appears on line 78 of the same file.
| "configuration.tsserver.watchOptions.fallbackPolling.fixedPollingInterval", | ||
| "configuration.tsserver.watchOptions.fallbackPolling.priorityPollingInterval", | ||
| "configuration.tsserver.watchOptions.fallbackPolling.dynamicPriorityPolling" |
There was a problem hiding this comment.
enumDescriptions entries here are not localized placeholders (they’re missing the surrounding %...%). As-is, the settings UI will show the raw key strings instead of the translated descriptions. Update these to reference the existing NLS keys (and ensure the dynamicPriorityPolling key name matches the one in package.nls.json).
| "configuration.tsserver.watchOptions.fallbackPolling.fixedPollingInterval", | |
| "configuration.tsserver.watchOptions.fallbackPolling.priorityPollingInterval", | |
| "configuration.tsserver.watchOptions.fallbackPolling.dynamicPriorityPolling" | |
| "%configuration.tsserver.watchOptions.fallbackPolling.fixedPollingInterval%", | |
| "%configuration.tsserver.watchOptions.fallbackPolling.priorityPollingInterval%", | |
| "%configuration.tsserver.watchOptions.fallbackPolling.dynamicPriorityPolling%" |
Fixes #292934
Also renames some of the server settings to have a more consistent naming scheme. This is going to be annoying but is the best time to do this since we are already changing the full setting id