Switch remaining settings to use js/ts prefix

For #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
This commit is contained in:
Matt Bierner
2026-02-23 11:20:52 -08:00
parent 62028559c1
commit 11a5279976
17 changed files with 527 additions and 196 deletions

View File

@@ -24,9 +24,13 @@
"description": "%workspaceTrust%",
"restrictedConfigurations": [
"typescript.tsdk",
"js/ts.tsdk.path",
"typescript.tsserver.pluginPaths",
"js/ts.tsserver.pluginPaths",
"typescript.npm",
"typescript.tsserver.nodePath"
"js/ts.tsserver.npm.path",
"typescript.tsserver.nodePath",
"js/ts.tsserver.node.path"
]
}
},
@@ -156,22 +160,80 @@
{
"type": "object",
"properties": {
"typescript.tsdk": {
"js/ts.tsdk.path": {
"type": "string",
"markdownDescription": "%typescript.tsdk.desc%",
"scope": "window",
"order": 1,
"keywords": [
"TypeScript"
]
},
"typescript.tsdk": {
"type": "string",
"markdownDescription": "%typescript.tsdk.desc%",
"markdownDeprecationMessage": "%typescript.tsdk.unifiedDeprecationMessage%",
"scope": "window",
"order": 1
},
"typescript.experimental.useTsgo": {
"js/ts.experimental.useTsgo": {
"type": "boolean",
"default": false,
"markdownDescription": "%typescript.useTsgo%",
"scope": "window",
"order": 2,
"tags": [
"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.locale": {
"type": "string",
"default": "auto",
"enum": [
"auto",
"de",
"es",
"en",
"fr",
"it",
"ja",
"ko",
"ru",
"zh-CN",
"zh-TW"
],
"enumDescriptions": [
"%typescript.locale.auto%",
"Deutsch",
"español",
"English",
"français",
"italiano",
"日本語",
"한국어",
"русский",
"中文(简体)",
"中文(繁體)"
],
"markdownDescription": "%typescript.locale%",
"scope": "window",
"order": 3,
"keywords": [
"TypeScript"
]
},
"typescript.locale": {
"type": "string",
"default": "auto",
@@ -202,9 +264,32 @@
"中文(繁體)"
],
"markdownDescription": "%typescript.locale%",
"markdownDeprecationMessage": "%typescript.locale.unifiedDeprecationMessage%",
"scope": "window",
"order": 3
},
"js/ts.tsc.autoDetect": {
"type": "string",
"default": "on",
"enum": [
"on",
"off",
"build",
"watch"
],
"markdownEnumDescriptions": [
"%typescript.tsc.autoDetect.on%",
"%typescript.tsc.autoDetect.off%",
"%typescript.tsc.autoDetect.build%",
"%typescript.tsc.autoDetect.watch%"
],
"description": "%typescript.tsc.autoDetect%",
"scope": "window",
"order": 4,
"keywords": [
"TypeScript"
]
},
"typescript.tsc.autoDetect": {
"type": "string",
"default": "on",
@@ -221,6 +306,7 @@
"%typescript.tsc.autoDetect.watch%"
],
"description": "%typescript.tsc.autoDetect%",
"markdownDeprecationMessage": "%typescript.tsc.autoDetect.unifiedDeprecationMessage%",
"scope": "window",
"order": 4
}
@@ -245,7 +331,7 @@
"%typescript.preferences.quoteStyle.double%"
],
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -301,7 +387,7 @@
"default": "shortest",
"description": "%typescript.preferences.importModuleSpecifier%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -367,7 +453,7 @@
"default": "auto",
"description": "%typescript.preferences.importModuleSpecifierEnding%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -437,7 +523,7 @@
"default": "auto",
"description": "%typescript.preferences.jsxAttributeCompletionStyle%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -491,7 +577,7 @@
"default": "auto",
"markdownDescription": "%typescript.preferences.includePackageJsonAutoImports%",
"scope": "window",
"tags": [
"keywords": [
"TypeScript"
]
},
@@ -519,7 +605,7 @@
},
"markdownDescription": "%typescript.preferences.autoImportFileExcludePatterns%",
"scope": "resource",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -549,7 +635,7 @@
},
"markdownDescription": "%typescript.preferences.autoImportSpecifierExcludeRegexes%",
"scope": "resource",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -577,7 +663,7 @@
"default": false,
"markdownDescription": "%typescript.preferences.preferTypeOnlyAutoImports%",
"scope": "resource",
"tags": [
"keywords": [
"TypeScript"
]
},
@@ -593,7 +679,7 @@
"default": true,
"description": "%typescript.preferences.useAliasesForRenames%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -617,7 +703,7 @@
"default": true,
"description": "%typescript.preferences.renameMatchingJsxTags%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -713,7 +799,7 @@
"default": "default"
}
},
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -887,7 +973,7 @@
"default": true,
"description": "%format.enable%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -911,7 +997,7 @@
"default": true,
"description": "%format.insertSpaceAfterCommaDelimiter%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -935,7 +1021,7 @@
"default": false,
"description": "%format.insertSpaceAfterConstructor%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -959,7 +1045,7 @@
"default": true,
"description": "%format.insertSpaceAfterSemicolonInForStatements%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -983,7 +1069,7 @@
"default": true,
"description": "%format.insertSpaceBeforeAndAfterBinaryOperators%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1007,7 +1093,7 @@
"default": true,
"description": "%format.insertSpaceAfterKeywordsInControlFlowStatements%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1031,7 +1117,7 @@
"default": true,
"description": "%format.insertSpaceAfterFunctionKeywordForAnonymousFunctions%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1055,7 +1141,7 @@
"default": false,
"description": "%format.insertSpaceBeforeFunctionParenthesis%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1079,7 +1165,7 @@
"default": false,
"description": "%format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1103,7 +1189,7 @@
"default": false,
"description": "%format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1127,7 +1213,7 @@
"default": true,
"description": "%format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1151,7 +1237,7 @@
"default": true,
"description": "%format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1175,7 +1261,7 @@
"default": false,
"description": "%format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1199,7 +1285,7 @@
"default": false,
"description": "%format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1223,7 +1309,7 @@
"default": false,
"description": "%format.insertSpaceAfterTypeAssertion%",
"scope": "language-overridable",
"tags": [
"keywords": [
"TypeScript"
]
},
@@ -1239,7 +1325,7 @@
"default": false,
"description": "%format.placeOpenBraceOnNewLineForFunctions%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1263,7 +1349,7 @@
"default": false,
"description": "%format.placeOpenBraceOnNewLineForControlBlocks%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1297,7 +1383,7 @@
"%format.semicolons.insert%",
"%format.semicolons.remove%"
],
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1341,7 +1427,7 @@
"default": true,
"description": "%format.indentSwitchCase%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1371,7 +1457,7 @@
"default": true,
"description": "%configuration.validate.enable%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1395,7 +1481,7 @@
"default": true,
"description": "%typescript.reportStyleChecksAsWarnings%",
"scope": "window",
"tags": [
"keywords": [
"TypeScript"
]
},
@@ -1411,7 +1497,7 @@
"default": true,
"description": "%configuration.suggestionActions.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1430,12 +1516,24 @@
"markdownDeprecationMessage": "%configuration.suggestionActions.enabled.unifiedDeprecationMessage%",
"scope": "resource"
},
"typescript.tsserver.experimental.enableProjectDiagnostics": {
"js/ts.tsserver.experimental.enableProjectDiagnostics": {
"type": "boolean",
"default": false,
"description": "%configuration.tsserver.experimental.enableProjectDiagnostics%",
"scope": "window",
"tags": [
"keywords": [
"JavaScript",
"TypeScript",
"experimental"
]
},
"typescript.tsserver.experimental.enableProjectDiagnostics": {
"type": "boolean",
"default": false,
"description": "%configuration.tsserver.experimental.enableProjectDiagnostics%",
"markdownDeprecationMessage": "%configuration.tsserver.experimental.enableProjectDiagnostics.unifiedDeprecationMessage%",
"scope": "window",
"keywords": [
"experimental"
]
}
@@ -1538,7 +1636,7 @@
"default": "prompt",
"description": "%typescript.updateImportsOnFileMove.enabled%",
"scope": "resource",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1582,7 +1680,7 @@
"default": true,
"description": "%typescript.autoClosingTags%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1614,7 +1712,7 @@
"default": "allOpenProjects",
"markdownDescription": "%typescript.workspaceSymbols.scope%",
"scope": "window",
"tags": [
"keywords": [
"TypeScript"
]
},
@@ -1638,7 +1736,7 @@
"default": false,
"description": "%configuration.preferGoToSourceDefinition%",
"scope": "window",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1662,7 +1760,7 @@
"default": true,
"markdownDescription": "%typescript.workspaceSymbols.excludeLibrarySymbols%",
"scope": "window",
"tags": [
"keywords": [
"TypeScript"
]
},
@@ -1678,7 +1776,7 @@
"type": "boolean",
"default": true,
"markdownDescription": "%configuration.updateImportsOnPaste%",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1714,7 +1812,7 @@
"default": true,
"description": "%typescript.suggest.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1738,7 +1836,7 @@
"default": true,
"description": "%configuration.suggest.autoImports%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1762,7 +1860,7 @@
"default": true,
"markdownDescription": "%configuration.suggest.names%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript"
]
},
@@ -1778,7 +1876,7 @@
"default": false,
"description": "%configuration.suggest.completeFunctionCalls%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1802,7 +1900,7 @@
"default": true,
"description": "%configuration.suggest.paths%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1826,7 +1924,7 @@
"default": true,
"description": "%configuration.suggest.completeJSDocs%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1850,7 +1948,7 @@
"default": true,
"markdownDescription": "%configuration.suggest.jsdoc.generateReturns%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1874,7 +1972,7 @@
"default": true,
"description": "%configuration.suggest.includeAutomaticOptionalChainCompletions%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1898,7 +1996,7 @@
"default": true,
"description": "%configuration.suggest.includeCompletionsForImportStatements%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1922,7 +2020,7 @@
"default": true,
"description": "%configuration.suggest.classMemberSnippets.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1946,7 +2044,7 @@
"default": true,
"description": "%configuration.suggest.objectLiteralMethodSnippets.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"TypeScript"
]
},
@@ -1968,7 +2066,7 @@
"default": false,
"description": "%configuration.referencesCodeLens.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -1992,7 +2090,7 @@
"default": false,
"markdownDescription": "%configuration.referencesCodeLens.showOnAllFunctions%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -2016,7 +2114,7 @@
"default": false,
"description": "%configuration.implementationsCodeLens.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"TypeScript"
]
},
@@ -2032,7 +2130,7 @@
"default": false,
"markdownDescription": "%configuration.implementationsCodeLens.showOnInterfaceMethods%",
"scope": "language-overridable",
"tags": [
"keywords": [
"TypeScript"
]
},
@@ -2048,7 +2146,7 @@
"default": false,
"markdownDescription": "%configuration.implementationsCodeLens.showOnAllClassMethods%",
"scope": "language-overridable",
"tags": [
"keywords": [
"TypeScript"
]
},
@@ -2080,7 +2178,7 @@
"default": "none",
"markdownDescription": "%configuration.inlayHints.parameterNames.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -2124,7 +2222,7 @@
"default": true,
"markdownDescription": "%configuration.inlayHints.parameterNames.suppressWhenArgumentMatchesName%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -2148,7 +2246,7 @@
"default": false,
"markdownDescription": "%configuration.inlayHints.parameterTypes.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -2172,7 +2270,7 @@
"default": false,
"markdownDescription": "%configuration.inlayHints.variableTypes.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -2196,7 +2294,7 @@
"default": true,
"markdownDescription": "%configuration.inlayHints.variableTypes.suppressWhenTypeMatchesName%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -2220,7 +2318,7 @@
"default": false,
"markdownDescription": "%configuration.inlayHints.propertyDeclarationTypes.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -2244,7 +2342,7 @@
"default": false,
"markdownDescription": "%configuration.inlayHints.functionLikeReturnTypes.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"JavaScript",
"TypeScript"
]
@@ -2268,7 +2366,7 @@
"default": false,
"markdownDescription": "%configuration.inlayHints.enumMemberValues.enabled%",
"scope": "language-overridable",
"tags": [
"keywords": [
"TypeScript"
]
},
@@ -2285,55 +2383,153 @@
"type": "object",
"title": "%configuration.serverAdvanced%",
"properties": {
"js/ts.tsdk.promptToUseWorkspaceVersion": {
"type": "boolean",
"default": false,
"description": "%typescript.enablePromptUseWorkspaceTsdk%",
"scope": "window",
"keywords": [
"TypeScript"
]
},
"typescript.enablePromptUseWorkspaceTsdk": {
"type": "boolean",
"default": false,
"description": "%typescript.enablePromptUseWorkspaceTsdk%",
"markdownDeprecationMessage": "%typescript.enablePromptUseWorkspaceTsdk.unifiedDeprecationMessage%",
"scope": "window"
},
"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"
]
},
"js/ts.tsserver.node.path": {
"type": "string",
"description": "%configuration.tsserver.nodePath%",
"scope": "window",
"keywords": [
"TypeScript"
]
},
"typescript.tsserver.nodePath": {
"type": "string",
"description": "%configuration.tsserver.nodePath%",
"markdownDeprecationMessage": "%configuration.tsserver.nodePath.unifiedDeprecationMessage%",
"scope": "window"
},
"js/ts.tsserver.npm.path": {
"type": "string",
"markdownDescription": "%typescript.npm%",
"scope": "machine",
"keywords": [
"TypeScript"
]
},
"typescript.npm": {
"type": "string",
"markdownDescription": "%typescript.npm%",
"markdownDeprecationMessage": "%typescript.npm.unifiedDeprecationMessage%",
"scope": "machine"
},
"js/ts.tsserver.checkNpmIsInstalled": {
"type": "boolean",
"default": true,
"markdownDescription": "%typescript.check.npmIsInstalled%",
"scope": "window",
"keywords": [
"TypeScript"
]
},
"typescript.check.npmIsInstalled": {
"type": "boolean",
"default": true,
"markdownDescription": "%typescript.check.npmIsInstalled%",
"markdownDeprecationMessage": "%typescript.check.npmIsInstalled.unifiedDeprecationMessage%",
"scope": "window"
},
"js/ts.tsserver.web.projectWideIntellisense.enabled": {
"type": "boolean",
"default": true,
"description": "%configuration.tsserver.web.projectWideIntellisense.enabled%",
"scope": "window",
"keywords": [
"TypeScript"
]
},
"typescript.tsserver.web.projectWideIntellisense.enabled": {
"type": "boolean",
"default": true,
"description": "%configuration.tsserver.web.projectWideIntellisense.enabled%",
"markdownDeprecationMessage": "%configuration.tsserver.web.projectWideIntellisense.enabled.unifiedDeprecationMessage%",
"scope": "window"
},
"js/ts.tsserver.web.projectWideIntellisense.suppressSemanticErrors": {
"type": "boolean",
"default": false,
"description": "%configuration.tsserver.web.projectWideIntellisense.suppressSemanticErrors%",
"scope": "window",
"keywords": [
"TypeScript"
]
},
"typescript.tsserver.web.projectWideIntellisense.suppressSemanticErrors": {
"type": "boolean",
"default": false,
"description": "%configuration.tsserver.web.projectWideIntellisense.suppressSemanticErrors%",
"markdownDeprecationMessage": "%configuration.tsserver.web.projectWideIntellisense.suppressSemanticErrors.unifiedDeprecationMessage%",
"scope": "window"
},
"js/ts.tsserver.web.typeAcquisition.enabled": {
"type": "boolean",
"default": true,
"description": "%configuration.tsserver.web.typeAcquisition.enabled%",
"scope": "window",
"keywords": [
"TypeScript"
]
},
"typescript.tsserver.web.typeAcquisition.enabled": {
"type": "boolean",
"default": true,
"description": "%configuration.tsserver.web.typeAcquisition.enabled%",
"markdownDeprecationMessage": "%configuration.tsserver.web.typeAcquisition.enabled.unifiedDeprecationMessage%",
"scope": "window"
},
"js/ts.tsserver.useSyntaxServer": {
"type": "string",
"scope": "window",
"description": "%configuration.tsserver.useSyntaxServer%",
"default": "auto",
"enum": [
"always",
"never",
"auto"
],
"enumDescriptions": [
"%configuration.tsserver.useSyntaxServer.always%",
"%configuration.tsserver.useSyntaxServer.never%",
"%configuration.tsserver.useSyntaxServer.auto%"
],
"keywords": [
"TypeScript"
]
},
"typescript.tsserver.useSyntaxServer": {
"type": "string",
"scope": "window",
@@ -2348,15 +2544,26 @@
"%configuration.tsserver.useSyntaxServer.always%",
"%configuration.tsserver.useSyntaxServer.never%",
"%configuration.tsserver.useSyntaxServer.auto%"
],
"markdownDeprecationMessage": "%configuration.tsserver.useSyntaxServer.unifiedDeprecationMessage%"
},
"js/ts.tsserver.maxMemory": {
"type": "number",
"default": 3072,
"markdownDescription": "%configuration.tsserver.maxMemory%",
"scope": "window",
"keywords": [
"TypeScript"
]
},
"typescript.tsserver.maxTsServerMemory": {
"type": "number",
"default": 3072,
"markdownDescription": "%configuration.tsserver.maxTsServerMemory%",
"markdownDeprecationMessage": "%configuration.tsserver.maxTsServerMemory.unifiedDeprecationMessage%",
"scope": "window"
},
"typescript.tsserver.watchOptions": {
"js/ts.tsserver.watchOptions": {
"description": "%configuration.tsserver.watchOptions%",
"scope": "window",
"default": "vscode",
@@ -2427,14 +2634,117 @@
}
}
}
],
"keywords": [
"TypeScript"
]
},
"typescript.tsserver.watchOptions": {
"description": "%configuration.tsserver.watchOptions%",
"scope": "window",
"default": "vscode",
"markdownDeprecationMessage": "%configuration.tsserver.watchOptions.unifiedDeprecationMessage%",
"oneOf": [
{
"type": "string",
"const": "vscode",
"description": "%configuration.tsserver.watchOptions.vscode%"
},
{
"type": "object",
"properties": {
"watchFile": {
"type": "string",
"description": "%configuration.tsserver.watchOptions.watchFile%",
"enum": [
"fixedChunkSizePolling",
"fixedPollingInterval",
"priorityPollingInterval",
"dynamicPriorityPolling",
"useFsEvents",
"useFsEventsOnParentDirectory"
],
"enumDescriptions": [
"%configuration.tsserver.watchOptions.watchFile.fixedChunkSizePolling%",
"%configuration.tsserver.watchOptions.watchFile.fixedPollingInterval%",
"%configuration.tsserver.watchOptions.watchFile.priorityPollingInterval%",
"%configuration.tsserver.watchOptions.watchFile.dynamicPriorityPolling%",
"%configuration.tsserver.watchOptions.watchFile.useFsEvents%",
"%configuration.tsserver.watchOptions.watchFile.useFsEventsOnParentDirectory%"
],
"default": "useFsEvents"
},
"watchDirectory": {
"type": "string",
"description": "%configuration.tsserver.watchOptions.watchDirectory%",
"enum": [
"fixedChunkSizePolling",
"fixedPollingInterval",
"dynamicPriorityPolling",
"useFsEvents"
],
"enumDescriptions": [
"%configuration.tsserver.watchOptions.watchDirectory.fixedChunkSizePolling%",
"%configuration.tsserver.watchOptions.watchDirectory.fixedPollingInterval%",
"%configuration.tsserver.watchOptions.watchDirectory.dynamicPriorityPolling%",
"%configuration.tsserver.watchOptions.watchDirectory.useFsEvents%"
],
"default": "useFsEvents"
},
"fallbackPolling": {
"type": "string",
"description": "%configuration.tsserver.watchOptions.fallbackPolling%",
"enum": [
"fixedPollingInterval",
"priorityPollingInterval",
"dynamicPriorityPolling"
],
"enumDescriptions": [
"configuration.tsserver.watchOptions.fallbackPolling.fixedPollingInterval",
"configuration.tsserver.watchOptions.fallbackPolling.priorityPollingInterval",
"configuration.tsserver.watchOptions.fallbackPolling.dynamicPriorityPolling"
]
},
"synchronousWatchDirectory": {
"type": "boolean",
"description": "%configuration.tsserver.watchOptions.synchronousWatchDirectory%"
}
}
}
]
},
"js/ts.tsserver.tracing.enabled": {
"type": "boolean",
"default": false,
"description": "%typescript.tsserver.enableTracing%",
"scope": "window",
"keywords": [
"TypeScript"
]
},
"typescript.tsserver.enableTracing": {
"type": "boolean",
"default": false,
"description": "%typescript.tsserver.enableTracing%",
"markdownDeprecationMessage": "%typescript.tsserver.enableTracing.unifiedDeprecationMessage%",
"scope": "window"
},
"js/ts.tsserver.log": {
"type": "string",
"enum": [
"off",
"terse",
"normal",
"verbose",
"requestTime"
],
"default": "off",
"description": "%typescript.tsserver.log%",
"scope": "window",
"keywords": [
"TypeScript"
]
},
"typescript.tsserver.log": {
"type": "string",
"enum": [
@@ -2446,8 +2756,22 @@
],
"default": "off",
"description": "%typescript.tsserver.log%",
"markdownDeprecationMessage": "%typescript.tsserver.log.unifiedDeprecationMessage%",
"scope": "window"
},
"js/ts.tsserver.pluginPaths": {
"type": "array",
"items": {
"type": "string",
"description": "%typescript.tsserver.pluginPaths.item%"
},
"default": [],
"description": "%typescript.tsserver.pluginPaths%",
"scope": "machine",
"keywords": [
"TypeScript"
]
},
"typescript.tsserver.pluginPaths": {
"type": "array",
"items": {
@@ -2456,6 +2780,7 @@
},
"default": [],
"description": "%typescript.tsserver.pluginPaths%",
"markdownDeprecationMessage": "%typescript.tsserver.pluginPaths.unifiedDeprecationMessage%",
"scope": "machine"
}
}

View File

@@ -20,13 +20,21 @@
"configuration.suggest.includeCompletionsForImportStatements": "Enable/disable auto-import-style completions on partially-typed import statements.",
"configuration.suggest.includeCompletionsForImportStatements.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.suggest.includeCompletionsForImportStatements#` instead.",
"typescript.useTsgo": "Disables TypeScript and JavaScript language features to allow usage of the TypeScript Go experimental extension. Requires TypeScript Go to be installed and configured. Requires reloading extensions after changing this setting.",
"typescript.useTsgo.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.experimental.useTsgo#` instead.",
"typescript.tsdk.desc": "Specifies the folder path to the tsserver and `lib*.d.ts` files under a TypeScript install to use for IntelliSense, for example: `./node_modules/typescript/lib`.\n\n- When specified as a user setting, the TypeScript version from `typescript.tsdk` automatically replaces the built-in TypeScript version.\n- When specified as a workspace setting, `typescript.tsdk` allows you to switch to use that workspace version of TypeScript for IntelliSense with the `TypeScript: Select TypeScript version` command.\n\nSee the [TypeScript documentation](https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-newer-typescript-versions) for more detail about managing TypeScript versions.",
"typescript.tsdk.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsdk.path#` instead.",
"typescript.disableAutomaticTypeAcquisition": "Disables [automatic type acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition). Automatic type acquisition fetches `@types` packages from npm to improve IntelliSense for external libraries.",
"typescript.disableAutomaticTypeAcquisition.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.automaticTypeAcquisition.enabled#` instead.",
"configuration.automaticTypeAcquisition.enabled": "Enable [automatic type acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition). Automatic type acquisition fetches `@types` packages from npm to improve IntelliSense for external libraries.",
"typescript.enablePromptUseWorkspaceTsdk": "Enables prompting of users to use the TypeScript version configured in the workspace for Intellisense.",
"typescript.enablePromptUseWorkspaceTsdk.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsdk.promptToUseWorkspaceVersion#` instead.",
"typescript.tsserver.enableTracing": "Enables tracing TS server performance to a directory. These trace files can be used to diagnose TS Server performance issues. The log may contain file paths, source code, and other potentially sensitive information from your project.",
"typescript.tsserver.enableTracing.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.tracing.enabled#` instead.",
"typescript.tsserver.log": "Enables logging of the TS server to a file. This log can be used to diagnose TS Server issues. The log may contain file paths, source code, and other potentially sensitive information from your project.",
"typescript.tsserver.log.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.log#` instead.",
"typescript.tsserver.pluginPaths": "Additional paths to discover TypeScript Language Service plugins.",
"typescript.tsserver.pluginPaths.item": "Either an absolute or relative path. Relative path will be resolved against workspace folder(s).",
"typescript.tsserver.pluginPaths.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.pluginPaths#` instead.",
"typescript.tsserver.trace": "Enables tracing of messages sent to the TS server. This trace can be used to diagnose TS Server issues. The trace may contain file paths, source code, and other potentially sensitive information from your project.",
"typescript.validate.enable": "Enable/disable TypeScript validation.",
"javascript.validate.enable": "Enable/disable JavaScript validation.",
@@ -93,10 +101,13 @@
"typescript.reportStyleChecksAsWarnings": "Report style checks as warnings.",
"configuration.reportStyleChecksAsWarnings.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.reportStyleChecksAsWarnings#` instead.",
"typescript.npm": "Specifies the path to the npm executable used for [Automatic Type Acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition).",
"typescript.npm.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.npm.path#` instead.",
"typescript.check.npmIsInstalled": "Check if npm is installed for [Automatic Type Acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition).",
"typescript.check.npmIsInstalled.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.checkNpmIsInstalled#` instead.",
"configuration.suggest.names": "Enable/disable including unique names from the file in JavaScript suggestions. Note that name suggestions are always disabled in JavaScript code that is semantically checked using `@ts-check` or `checkJs`.",
"configuration.suggest.names.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.suggest.names#` instead.",
"typescript.tsc.autoDetect": "Controls auto detection of tsc tasks.",
"typescript.tsc.autoDetect.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsc.autoDetect#` instead.",
"typescript.tsc.autoDetect.off": "Disable this feature.",
"typescript.tsc.autoDetect.on": "Create both build and watch tasks.",
"typescript.tsc.autoDetect.build": "Only create single run compile tasks.",
@@ -108,12 +119,17 @@
"configuration.suggest.paths.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.suggest.paths#` instead.",
"configuration.tsserver.useSeparateSyntaxServer": "Enable/disable spawning a separate TypeScript server that can more quickly respond to syntax related operations, such as calculating folding or computing document symbols.",
"configuration.tsserver.useSyntaxServer": "Controls if TypeScript launches a dedicated server to more quickly handle syntax related operations, such as computing code folding.",
"configuration.tsserver.useSyntaxServer.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.useSyntaxServer#` instead.",
"configuration.tsserver.useSyntaxServer.always": "Use a lighter weight syntax server to handle all IntelliSense operations. This disables project-wide features including auto-imports, cross-file completions, and go to definition for symbols in other files. Only use this for very large projects where performance is critical.",
"configuration.tsserver.useSyntaxServer.never": "Don't use a dedicated syntax server. Use a single server to handle all IntelliSense operations.",
"configuration.tsserver.useSyntaxServer.auto": "Spawn both a full server and a lighter weight server dedicated to syntax operations. The syntax server is used to speed up syntax operations and provide IntelliSense while projects are loading.",
"configuration.tsserver.maxTsServerMemory": "The maximum amount of memory (in MB) to allocate to the TypeScript server process. To use a memory limit greater than 4 GB, use `#typescript.tsserver.nodePath#` to run TS Server with a custom Node installation.",
"configuration.tsserver.maxTsServerMemory": "The maximum amount of memory (in MB) to allocate to the TypeScript server process. To use a memory limit greater than 4 GB, use `#js/ts.tsserver.node.path#` to run TS Server with a custom Node installation.",
"configuration.tsserver.maxTsServerMemory.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.maxMemory#` instead.",
"configuration.tsserver.maxMemory": "The maximum amount of memory (in MB) to allocate to the TypeScript server process. To use a memory limit greater than 4 GB, use `#js/ts.tsserver.node.path#` to run TS Server with a custom Node installation.",
"configuration.tsserver.experimental.enableProjectDiagnostics": "Enables project wide error reporting.",
"configuration.tsserver.experimental.enableProjectDiagnostics.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.experimental.enableProjectDiagnostics#` instead.",
"typescript.locale": "Sets the locale used to report JavaScript and TypeScript errors. Defaults to use VS Code's locale.",
"typescript.locale.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.locale#` instead.",
"typescript.locale.auto": "Use VS Code's configured display language.",
"configuration.implicitProjectConfig.module": "Sets the module system for the program. See more: https://www.typescriptlang.org/tsconfig#module.",
"configuration.implicitProjectConfig.target": "Set target JavaScript language version for emitted JavaScript and include library declarations. See more: https://www.typescriptlang.org/tsconfig#target.",
@@ -290,9 +306,14 @@
"configuration.suggest.objectLiteralMethodSnippets.enabled": "Enable/disable snippet completions for methods in object literals.",
"configuration.suggest.objectLiteralMethodSnippets.enabled.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.suggest.objectLiteralMethodSnippets.enabled#` instead.",
"configuration.tsserver.web.projectWideIntellisense.enabled": "Enable/disable project-wide IntelliSense on web. Requires that VS Code is running in a trusted context.",
"configuration.tsserver.web.projectWideIntellisense.suppressSemanticErrors": "Suppresses semantic errors on web even when project wide IntelliSense is enabled. This is always on when project wide IntelliSense is not enabled or available. See `#typescript.tsserver.web.projectWideIntellisense.enabled#`",
"configuration.tsserver.web.typeAcquisition.enabled": "Enable/disable package acquisition on the web. This enables IntelliSense for imported packages. Requires `#typescript.tsserver.web.projectWideIntellisense.enabled#`. Currently not supported for Safari.",
"configuration.tsserver.web.projectWideIntellisense.enabled.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.web.projectWideIntellisense.enabled#` instead.",
"configuration.tsserver.web.projectWideIntellisense.suppressSemanticErrors": "Suppresses semantic errors on web even when project wide IntelliSense is enabled. This is always on when project wide IntelliSense is not enabled or available. See `#js/ts.tsserver.web.projectWideIntellisense.enabled#`",
"configuration.tsserver.web.projectWideIntellisense.suppressSemanticErrors.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.web.projectWideIntellisense.suppressSemanticErrors#` instead.",
"configuration.tsserver.web.typeAcquisition.enabled": "Enable/disable package acquisition on the web. This enables IntelliSense for imported packages. Requires `#js/ts.tsserver.web.projectWideIntellisense.enabled#`. Currently not supported for Safari.",
"configuration.tsserver.web.typeAcquisition.enabled.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.web.typeAcquisition.enabled#` instead.",
"configuration.tsserver.nodePath": "Run TS Server on a custom Node installation. This can be a path to a Node executable, or 'node' if you want VS Code to detect a Node installation.",
"configuration.tsserver.nodePath.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.node.path#` instead.",
"configuration.tsserver.watchOptions.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.tsserver.watchOptions#` instead.",
"configuration.updateImportsOnPaste": "Automatically update imports when pasting code. Requires TypeScript 5.6+.",
"configuration.updateImportsOnPaste.enabled.unifiedDeprecationMessage": "This setting is deprecated. Use `#js/ts.updateImportsOnPaste.enabled#` instead.",
"configuration.hover.maximumLength": "The maximum number of characters in a hover. If the hover is longer than this, it will be truncated. Requires TypeScript 5.9+.",

View File

@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { readUnifiedConfig, unifiedConfigSection } from '../utils/configuration';
import { Command } from './commandManager';
export const tsNativeExtensionId = 'typescriptteam.native-preview';
@@ -45,18 +46,19 @@ async function updateTsgoSetting(enable: boolean): Promise<void> {
}
}
const tsConfig = vscode.workspace.getConfiguration('typescript');
const currentValue = tsConfig.get<boolean>('experimental.useTsgo', false);
const currentValue = readUnifiedConfig<boolean>('experimental.useTsgo', false, { fallbackSection: 'typescript' });
if (currentValue === enable) {
return;
}
// Determine the target scope for the configuration update
let target = vscode.ConfigurationTarget.Global;
const inspect = tsConfig.inspect<boolean>('experimental.useTsgo');
if (inspect?.workspaceValue !== undefined) {
const unifiedConfig = vscode.workspace.getConfiguration(unifiedConfigSection);
const inspect = unifiedConfig.inspect<boolean>('experimental.useTsgo');
const legacyInspect = vscode.workspace.getConfiguration('typescript').inspect<boolean>('experimental.useTsgo');
if (inspect?.workspaceValue !== undefined || legacyInspect?.workspaceValue !== undefined) {
target = vscode.ConfigurationTarget.Workspace;
} else if (inspect?.workspaceFolderValue !== undefined) {
} else if (inspect?.workspaceFolderValue !== undefined || legacyInspect?.workspaceFolderValue !== undefined) {
target = vscode.ConfigurationTarget.WorkspaceFolder;
} else {
// If setting is not defined yet, use the same scope as typescript-go.executablePath
@@ -70,5 +72,5 @@ async function updateTsgoSetting(enable: boolean): Promise<void> {
}
}
await tsConfig.update('experimental.useTsgo', enable, target);
await unifiedConfig.update('experimental.useTsgo', enable, target);
}

View File

@@ -24,6 +24,10 @@ export class ElectronServiceConfigurationProvider extends BaseServiceConfigurati
}
protected readGlobalTsdk(configuration: vscode.WorkspaceConfiguration): string | null {
const unifiedInspect = configuration.inspect('js/ts.tsdk.path');
if (unifiedInspect && typeof unifiedInspect.globalValue === 'string') {
return this.fixPathPrefixes(unifiedInspect.globalValue);
}
const inspect = configuration.inspect('typescript.tsdk');
if (inspect && typeof inspect.globalValue === 'string') {
return this.fixPathPrefixes(inspect.globalValue);
@@ -32,6 +36,10 @@ export class ElectronServiceConfigurationProvider extends BaseServiceConfigurati
}
protected readLocalTsdk(configuration: vscode.WorkspaceConfiguration): string | null {
const unifiedInspect = configuration.inspect('js/ts.tsdk.path');
if (unifiedInspect && typeof unifiedInspect.workspaceValue === 'string') {
return this.fixPathPrefixes(unifiedInspect.workspaceValue);
}
const inspect = configuration.inspect('typescript.tsdk');
if (inspect && typeof inspect.workspaceValue === 'string') {
return this.fixPathPrefixes(inspect.workspaceValue);
@@ -44,7 +52,10 @@ export class ElectronServiceConfigurationProvider extends BaseServiceConfigurati
}
private readLocalNodePathWorker(configuration: vscode.WorkspaceConfiguration): string | null {
const inspect = configuration.inspect('typescript.tsserver.nodePath');
const unifiedInspect = configuration.inspect('js/ts.tsserver.node.path');
const inspect = (unifiedInspect?.workspaceValue && typeof unifiedInspect.workspaceValue === 'string')
? unifiedInspect
: configuration.inspect('typescript.tsserver.nodePath');
if (inspect?.workspaceValue && typeof inspect.workspaceValue === 'string') {
if (inspect.workspaceValue === 'node') {
return this.findNodePath();
@@ -64,7 +75,10 @@ export class ElectronServiceConfigurationProvider extends BaseServiceConfigurati
}
private readGlobalNodePathWorker(configuration: vscode.WorkspaceConfiguration): string | null {
const inspect = configuration.inspect('typescript.tsserver.nodePath');
const unifiedInspect = configuration.inspect('js/ts.tsserver.node.path');
const inspect = (unifiedInspect?.globalValue && typeof unifiedInspect.globalValue === 'string')
? unifiedInspect
: configuration.inspect('typescript.tsserver.nodePath');
if (inspect?.globalValue && typeof inspect.globalValue === 'string') {
if (inspect.globalValue === 'node') {
return this.findNodePath();

View File

@@ -153,29 +153,29 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
public loadFromWorkspace(): TypeScriptServiceConfiguration {
const configuration = vscode.workspace.getConfiguration();
return {
locale: this.readLocale(configuration),
locale: this.readLocale(),
globalTsdk: this.readGlobalTsdk(configuration),
localTsdk: this.readLocalTsdk(configuration),
npmLocation: this.readNpmLocation(configuration),
tsServerLogLevel: this.readTsServerLogLevel(configuration),
tsServerPluginPaths: this.readTsServerPluginPaths(configuration),
npmLocation: this.readNpmLocation(),
tsServerLogLevel: this.readTsServerLogLevel(),
tsServerPluginPaths: this.readTsServerPluginPaths(),
implicitProjectConfiguration: new ImplicitProjectConfiguration(configuration),
disableAutomaticTypeAcquisition: this.readDisableAutomaticTypeAcquisition(configuration),
useSyntaxServer: this.readUseSyntaxServer(configuration),
webProjectWideIntellisenseEnabled: this.readWebProjectWideIntellisenseEnable(configuration),
webProjectWideIntellisenseSuppressSemanticErrors: this.readWebProjectWideIntellisenseSuppressSemanticErrors(configuration),
webTypeAcquisitionEnabled: this.readWebTypeAcquisition(configuration),
enableDiagnosticsTelemetry: this.readEnableDiagnosticsTelemetry(configuration),
enableProjectDiagnostics: this.readEnableProjectDiagnostics(configuration),
maxTsServerMemory: this.readMaxTsServerMemory(configuration),
enablePromptUseWorkspaceTsdk: this.readEnablePromptUseWorkspaceTsdk(configuration),
webProjectWideIntellisenseEnabled: this.readWebProjectWideIntellisenseEnable(),
webProjectWideIntellisenseSuppressSemanticErrors: this.readWebProjectWideIntellisenseSuppressSemanticErrors(),
webTypeAcquisitionEnabled: this.readWebTypeAcquisition(),
enableDiagnosticsTelemetry: this.readEnableDiagnosticsTelemetry(),
enableProjectDiagnostics: this.readEnableProjectDiagnostics(),
maxTsServerMemory: this.readMaxTsServerMemory(),
enablePromptUseWorkspaceTsdk: this.readEnablePromptUseWorkspaceTsdk(),
useVsCodeWatcher: this.readUseVsCodeWatcher(configuration),
watchOptions: this.readWatchOptions(configuration),
includePackageJsonAutoImports: this.readIncludePackageJsonAutoImports(configuration),
enableTsServerTracing: this.readEnableTsServerTracing(configuration),
watchOptions: this.readWatchOptions(),
includePackageJsonAutoImports: this.readIncludePackageJsonAutoImports(),
enableTsServerTracing: this.readEnableTsServerTracing(),
localNodePath: this.readLocalNodePath(configuration),
globalNodePath: this.readGlobalNodePath(configuration),
workspaceSymbolsExcludeLibrarySymbols: this.readWorkspaceSymbolsExcludeLibrarySymbols(configuration),
workspaceSymbolsExcludeLibrarySymbols: this.readWorkspaceSymbolsExcludeLibrarySymbols(),
};
}
@@ -184,30 +184,35 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
protected abstract readLocalNodePath(configuration: vscode.WorkspaceConfiguration): string | null;
protected abstract readGlobalNodePath(configuration: vscode.WorkspaceConfiguration): string | null;
protected readTsServerLogLevel(configuration: vscode.WorkspaceConfiguration): TsServerLogLevel {
const setting = configuration.get<string>('typescript.tsserver.log', 'off');
protected readTsServerLogLevel(): TsServerLogLevel {
const setting = readUnifiedConfig<string>('tsserver.log', 'off', { fallbackSection: 'typescript' });
return TsServerLogLevel.fromString(setting);
}
protected readTsServerPluginPaths(configuration: vscode.WorkspaceConfiguration): string[] {
return configuration.get<string[]>('typescript.tsserver.pluginPaths', []);
protected readTsServerPluginPaths(): string[] {
return readUnifiedConfig<string[]>('tsserver.pluginPaths', [], { fallbackSection: 'typescript' });
}
protected readNpmLocation(configuration: vscode.WorkspaceConfiguration): string | null {
return configuration.get<string | null>('typescript.npm', null);
protected readNpmLocation(): string | null {
return readUnifiedConfig<string | null>('tsserver.npm.path', null, { fallbackSection: 'typescript', fallbackSubSectionNameOverride: 'npm' });
}
protected readDisableAutomaticTypeAcquisition(configuration: vscode.WorkspaceConfiguration): boolean {
const enabled = readUnifiedConfig<boolean | undefined>('tsserver.automaticTypeAcquisition.enabled', undefined, { fallbackSection: 'typescript' });
if (enabled !== undefined) {
return !enabled;
}
// Fall back to the old deprecated setting
return configuration.get<boolean>('typescript.disableAutomaticTypeAcquisition', false);
}
protected readLocale(configuration: vscode.WorkspaceConfiguration): string | null {
const value = configuration.get<string>('typescript.locale', 'auto');
protected readLocale(): string | null {
const value = readUnifiedConfig<string>('locale', 'auto', { fallbackSection: 'typescript' });
return !value || value === 'auto' ? null : value;
}
protected readUseSyntaxServer(configuration: vscode.WorkspaceConfiguration): SyntaxServerConfiguration {
const value = configuration.get<string>('typescript.tsserver.useSyntaxServer');
const value = readUnifiedConfig<string | undefined>('tsserver.useSyntaxServer', undefined, { fallbackSection: 'typescript' });
switch (value) {
case 'never': return SyntaxServerConfiguration.Never;
case 'always': return SyntaxServerConfiguration.Always;
@@ -225,13 +230,13 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
return SyntaxServerConfiguration.Never;
}
protected readEnableDiagnosticsTelemetry(configuration: vscode.WorkspaceConfiguration): boolean {
protected readEnableDiagnosticsTelemetry(): boolean {
// This setting does not appear in the settings view, as it is not to be enabled by users outside the team
return configuration.get<boolean>('typescript.enableDiagnosticsTelemetry', false);
return readUnifiedConfig<boolean>('enableDiagnosticsTelemetry', false, { fallbackSection: 'typescript' });
}
protected readEnableProjectDiagnostics(configuration: vscode.WorkspaceConfiguration): boolean {
return configuration.get<boolean>('typescript.tsserver.experimental.enableProjectDiagnostics', false);
protected readEnableProjectDiagnostics(): boolean {
return readUnifiedConfig<boolean>('tsserver.experimental.enableProjectDiagnostics', false, { fallbackSection: 'typescript' });
}
private readUseVsCodeWatcher(configuration: vscode.WorkspaceConfiguration): boolean {
@@ -256,12 +261,12 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
return experimentalConfig.workspaceFolderValue;
}
return configuration.get<Proto.WatchOptions | vscodeWatcherName>('typescript.tsserver.watchOptions', vscodeWatcherName) === vscodeWatcherName;
return readUnifiedConfig<Proto.WatchOptions | vscodeWatcherName>('tsserver.watchOptions', vscodeWatcherName, { fallbackSection: 'typescript' }) === vscodeWatcherName;
}
private readWatchOptions(configuration: vscode.WorkspaceConfiguration): Proto.WatchOptions | undefined {
const watchOptions = configuration.get<Proto.WatchOptions | vscodeWatcherName>('typescript.tsserver.watchOptions');
if (watchOptions === vscodeWatcherName) {
private readWatchOptions(): Proto.WatchOptions | undefined {
const watchOptions = readUnifiedConfig<Proto.WatchOptions | vscodeWatcherName | undefined>('tsserver.watchOptions', undefined, { fallbackSection: 'typescript' });
if (!watchOptions || watchOptions === vscodeWatcherName) {
return undefined;
}
@@ -269,41 +274,41 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
return { ...(watchOptions ?? {}) };
}
protected readIncludePackageJsonAutoImports(_configuration: vscode.WorkspaceConfiguration): 'auto' | 'on' | 'off' | undefined {
protected readIncludePackageJsonAutoImports(): 'auto' | 'on' | 'off' | undefined {
return readUnifiedConfig<'auto' | 'on' | 'off' | undefined>('preferences.includePackageJsonAutoImports', undefined, { fallbackSection: 'typescript' });
}
protected readMaxTsServerMemory(configuration: vscode.WorkspaceConfiguration): number {
protected readMaxTsServerMemory(): number {
const defaultMaxMemory = 3072;
const minimumMaxMemory = 128;
const memoryInMB = configuration.get<number>('typescript.tsserver.maxTsServerMemory', defaultMaxMemory);
const memoryInMB = readUnifiedConfig<number>('tsserver.maxMemory', defaultMaxMemory, { fallbackSection: 'typescript', fallbackSubSectionNameOverride: 'tsserver.maxTsServerMemory' });
if (!Number.isSafeInteger(memoryInMB)) {
return defaultMaxMemory;
}
return Math.max(memoryInMB, minimumMaxMemory);
}
protected readEnablePromptUseWorkspaceTsdk(configuration: vscode.WorkspaceConfiguration): boolean {
return configuration.get<boolean>('typescript.enablePromptUseWorkspaceTsdk', false);
protected readEnablePromptUseWorkspaceTsdk(): boolean {
return readUnifiedConfig<boolean>('tsdk.promptToUseWorkspaceVersion', false, { fallbackSection: 'typescript', fallbackSubSectionNameOverride: 'enablePromptUseWorkspaceTsdk' });
}
protected readEnableTsServerTracing(configuration: vscode.WorkspaceConfiguration): boolean {
return configuration.get<boolean>('typescript.tsserver.enableTracing', false);
protected readEnableTsServerTracing(): boolean {
return readUnifiedConfig<boolean>('tsserver.tracing.enabled', false, { fallbackSection: 'typescript', fallbackSubSectionNameOverride: 'tsserver.enableTracing' });
}
private readWorkspaceSymbolsExcludeLibrarySymbols(_configuration: vscode.WorkspaceConfiguration): boolean {
private readWorkspaceSymbolsExcludeLibrarySymbols(): boolean {
return readUnifiedConfig<boolean>('workspaceSymbols.excludeLibrarySymbols', true, { scope: null, fallbackSection: 'typescript' });
}
private readWebProjectWideIntellisenseEnable(configuration: vscode.WorkspaceConfiguration): boolean {
return configuration.get<boolean>('typescript.tsserver.web.projectWideIntellisense.enabled', true);
private readWebProjectWideIntellisenseEnable(): boolean {
return readUnifiedConfig<boolean>('tsserver.web.projectWideIntellisense.enabled', true, { fallbackSection: 'typescript' });
}
private readWebProjectWideIntellisenseSuppressSemanticErrors(configuration: vscode.WorkspaceConfiguration): boolean {
return this.readWebTypeAcquisition(configuration) && configuration.get<boolean>('typescript.tsserver.web.projectWideIntellisense.suppressSemanticErrors', false);
private readWebProjectWideIntellisenseSuppressSemanticErrors(): boolean {
return this.readWebTypeAcquisition() && readUnifiedConfig<boolean>('tsserver.web.projectWideIntellisense.suppressSemanticErrors', false, { fallbackSection: 'typescript' });
}
private readWebTypeAcquisition(configuration: vscode.WorkspaceConfiguration): boolean {
return configuration.get<boolean>('typescript.tsserver.web.typeAcquisition.enabled', true);
private readWebTypeAcquisition(): boolean {
return readUnifiedConfig<boolean>('tsserver.web.typeAcquisition.enabled', true, { fallbackSection: 'typescript' });
}
}

View File

@@ -25,7 +25,7 @@ import { onCaseInsensitiveFileSystem } from './utils/fs.electron';
import { Lazy } from './utils/lazy';
import { getPackageInfo } from './utils/packageInfo';
import * as temp from './utils/temp.electron';
import { conditionalRegistration, requireGlobalConfiguration, requireHasVsCodeExtension } from './languageFeatures/util/dependentRegistration';
import { conditionalRegistration, requireGlobalConfiguration, requireGlobalUnifiedConfig, requireHasVsCodeExtension } from './languageFeatures/util/dependentRegistration';
import { DisposableStore } from './utils/dispose';
export function activate(
@@ -60,7 +60,7 @@ export function activate(
// Conditionally register features based on whether TSGO is enabled
context.subscriptions.push(conditionalRegistration([
requireGlobalConfiguration('typescript', 'experimental.useTsgo'),
requireGlobalUnifiedConfig('experimental.useTsgo', { fallbackSection: 'typescript' }),
requireHasVsCodeExtension(tsNativeExtensionId),
], () => {
// TSGO. Only register a small set of features that don't use TS Server

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { conditionalRegistration, requireGlobalConfiguration } from '../languageFeatures/util/dependentRegistration';
import { conditionalRegistration, requireGlobalUnifiedConfig } from '../languageFeatures/util/dependentRegistration';
import { supportsReadableByteStreams } from '../utils/platform';
import { AutoInstallerFs } from './autoInstallerFs';
import { MemFs } from './memFs';
@@ -16,7 +16,7 @@ export function registerAtaSupport(logger: Logger): vscode.Disposable {
}
return conditionalRegistration([
requireGlobalConfiguration('typescript', 'tsserver.web.typeAcquisition.enabled'),
requireGlobalUnifiedConfig('tsserver.web.typeAcquisition.enabled', { fallbackSection: 'typescript' }),
], () => {
return vscode.Disposable.from(
// Ata

View File

@@ -669,13 +669,12 @@ namespace CompletionConfiguration {
modeId: string,
scope: UnifiedConfigurationScope
): CompletionConfiguration {
const config = vscode.workspace.getConfiguration(modeId, scope);
return {
completeFunctionCalls: readUnifiedConfig<boolean>(CompletionConfiguration.completeFunctionCalls, false, { scope: scope, fallbackSection: modeId }),
pathSuggestions: readUnifiedConfig<boolean>(CompletionConfiguration.pathSuggestions, true, { scope: scope, fallbackSection: modeId }),
autoImportSuggestions: readUnifiedConfig<boolean>(CompletionConfiguration.autoImportSuggestions, true, { scope: scope, fallbackSection: modeId }),
nameSuggestions: readUnifiedConfig<boolean>(CompletionConfiguration.nameSuggestions, true, { scope: scope, fallbackSection: modeId }),
importStatementSuggestions: config.get<boolean>(CompletionConfiguration.importStatementSuggestions, true),
importStatementSuggestions: readUnifiedConfig<boolean>(CompletionConfiguration.importStatementSuggestions, true, { scope: scope, fallbackSection: modeId }),
};
}
}

View File

@@ -172,14 +172,11 @@ export default class FileConfigurationManager extends Disposable {
}
private getPreferences(document: vscode.TextDocument): Proto.UserPreferences {
const config = vscode.workspace.getConfiguration(
isTypeScriptDocument(document) ? 'typescript' : 'javascript',
document);
const fallbackSection = isTypeScriptDocument(document) ? 'typescript' : 'javascript';
const oldConfig = vscode.workspace.getConfiguration(fallbackSection, document);
const preferences: Proto.UserPreferences = {
...config.get('unstable'),
...oldConfig.get('unstable'),
quotePreference: getQuoteStylePreference(document, fallbackSection),
importModuleSpecifierPreference: getImportModuleSpecifierPreference(document, fallbackSection),
importModuleSpecifierEnding: getImportModuleSpecifierEndingPreference(document, fallbackSection),

View File

@@ -12,7 +12,7 @@ import * as typeConverters from '../typeConverters';
import { ClientCapability, ITypeScriptServiceClient } from '../typescriptService';
import { Delayer } from '../utils/async';
import { nulToken } from '../utils/cancellation';
import { readUnifiedConfig } from '../utils/configuration';
import { readUnifiedConfig, unifiedConfigSection } from '../utils/configuration';
import { Disposable } from '../utils/dispose';
import FileConfigurationManager from './fileConfigurationManager';
import { conditionalRegistration, requireSomeCapability } from './util/dependentRegistration';
@@ -174,7 +174,7 @@ class UpdateImportsOnFileRenameHandler extends Disposable {
return false;
}
case alwaysItem: {
const config = vscode.workspace.getConfiguration('js/ts');
const config = vscode.workspace.getConfiguration(unifiedConfigSection);
config.update(
updateImportsOnFileMoveName,
UpdateImportsOnFileMoveSetting.Always,
@@ -182,7 +182,7 @@ class UpdateImportsOnFileRenameHandler extends Disposable {
return true;
}
case neverItem: {
const config = vscode.workspace.getConfiguration('js/ts');
const config = vscode.workspace.getConfiguration(unifiedConfigSection);
config.update(
updateImportsOnFileMoveName,
UpdateImportsOnFileMoveSetting.Never,

View File

@@ -90,19 +90,6 @@ export function requireMinVersion(
);
}
export function requireGlobalConfiguration(
section: string,
configValue: string,
) {
return new Condition(
() => {
const config = vscode.workspace.getConfiguration(section, null);
return !!config.get<boolean>(configValue);
},
vscode.workspace.onDidChangeConfiguration
);
}
/**
* Requires that a configuration value has been modified from its default value in either the global or workspace scope
*

View File

@@ -162,23 +162,7 @@ export default class LanguageProvider extends Disposable {
return;
}
const config = vscode.workspace.getConfiguration(this.id, file);
const reportUnnecessary = config.get<boolean>('showUnused', true);
const reportDeprecated = config.get<boolean>('showDeprecated', true);
this.client.diagnosticsManager.updateDiagnostics(file, this._diagnosticLanguage, diagnosticsKind, diagnostics.filter(diag => {
// Don't bother reporting diagnostics we know will not be rendered
if (!reportUnnecessary) {
if (diag.reportUnnecessary && diag.severity === vscode.DiagnosticSeverity.Hint) {
return false;
}
}
if (!reportDeprecated) {
if (diag.reportDeprecated && diag.severity === vscode.DiagnosticSeverity.Hint) {
return false;
}
}
return true;
}), ranges);
this.client.diagnosticsManager.updateDiagnostics(file, this._diagnosticLanguage, diagnosticsKind, diagnostics, ranges);
}
public configFileDiagnosticsReceived(file: vscode.Uri, diagnostics: vscode.Diagnostic[]): void {

View File

@@ -5,35 +5,33 @@
import * as vscode from 'vscode';
import { TsServerLogLevel } from '../configuration/configuration';
import { UnifiedConfigValue, unifiedConfigSection } from '../utils/configuration';
import { Disposable } from '../utils/dispose';
export class LogLevelMonitor extends Disposable {
private static readonly logLevelConfigKey = 'typescript.tsserver.log';
private static readonly logLevelChangedStorageKey = 'typescript.tsserver.logLevelChanged';
private static readonly doNotPromptLogLevelStorageKey = 'typescript.tsserver.doNotPromptLogLevel';
private readonly _logLevel: UnifiedConfigValue<string>;
constructor(private readonly context: vscode.ExtensionContext) {
super();
this._register(vscode.workspace.onDidChangeConfiguration(this.onConfigurationChange, this, this._disposables));
this._logLevel = this._register(new UnifiedConfigValue<string>('tsserver.log', 'off', { fallbackSection: 'typescript' }));
this._register(this._logLevel.onDidChange(() => {
this.context.globalState.update(LogLevelMonitor.logLevelChangedStorageKey, new Date());
}));
if (this.shouldNotifyExtendedLogging()) {
this.notifyExtendedLogging();
}
}
private onConfigurationChange(event: vscode.ConfigurationChangeEvent) {
const logLevelChanged = event.affectsConfiguration(LogLevelMonitor.logLevelConfigKey);
if (!logLevelChanged) {
return;
}
this.context.globalState.update(LogLevelMonitor.logLevelChangedStorageKey, new Date());
}
private get logLevel(): TsServerLogLevel {
return TsServerLogLevel.fromString(vscode.workspace.getConfiguration().get<string>(LogLevelMonitor.logLevelConfigKey, 'off'));
return TsServerLogLevel.fromString(this._logLevel.getValue());
}
/**
@@ -90,7 +88,7 @@ export class LogLevelMonitor extends Disposable {
return;
}
if (selection.choice === Choice.DisableLogging) {
return vscode.workspace.getConfiguration().update(LogLevelMonitor.logLevelConfigKey, 'off', true);
return vscode.workspace.getConfiguration().update(`${unifiedConfigSection}.tsserver.log`, 'off', true);
} else if (selection.choice === Choice.DoNotShowAgain) {
return this.context.globalState.update(LogLevelMonitor.doNotPromptLogLevelStorageKey, true);
}

View File

@@ -9,6 +9,7 @@ import * as vscode from 'vscode';
import { wait } from '../test/testUtils';
import { ITypeScriptServiceClient, ServerResponse } from '../typescriptService';
import { coalesce } from '../utils/arrays';
import { readUnifiedConfig } from '../utils/configuration';
import { Disposable } from '../utils/dispose';
import { exists } from '../utils/fs';
import { isTsConfigFileName } from '../configuration/languageDescription';
@@ -289,7 +290,7 @@ class TscTaskProvider extends Disposable implements vscode.TaskProvider {
}
private onConfigurationChanged(): void {
const type = vscode.workspace.getConfiguration('typescript.tsc').get<AutoDetect>('autoDetect');
const type = readUnifiedConfig<AutoDetect | undefined>('tsc.autoDetect', undefined, { fallbackSection: 'typescript' });
this.autoDetect = typeof type === 'undefined' ? AutoDetect.on : type;
}
}

View File

@@ -6,6 +6,7 @@
import * as vscode from 'vscode';
import { TypeScriptServiceConfiguration } from '../configuration/configuration';
import { tsNativeExtensionId } from '../commands/useTsgo';
import { readUnifiedConfig, unifiedConfigSection } from '../utils/configuration';
import { setImmediate } from '../utils/async';
import { Disposable } from '../utils/dispose';
import { ITypeScriptVersionProvider, TypeScriptVersion } from './versionProvider';
@@ -131,8 +132,7 @@ export class TypeScriptVersionManager extends Disposable {
const trusted = await vscode.workspace.requestWorkspaceTrust();
if (trusted) {
await this.workspaceState.update(useWorkspaceTsdkStorageKey, true);
const tsConfig = vscode.workspace.getConfiguration('typescript');
await tsConfig.update('tsdk', version.pathLabel, false);
await vscode.workspace.getConfiguration(unifiedConfigSection).update('tsdk.path', version.pathLabel, false);
this.updateActiveVersion(version);
}
},
@@ -146,8 +146,7 @@ export class TypeScriptVersionManager extends Disposable {
return undefined;
}
const tsConfig = vscode.workspace.getConfiguration('typescript');
const isUsingTsgo = tsConfig.get<boolean>('experimental.useTsgo', false);
const isUsingTsgo = readUnifiedConfig<boolean>('experimental.useTsgo', false, { fallbackSection: 'typescript' });
return {
label: (isUsingTsgo ? '• ' : '') + vscode.l10n.t("Use TypeScript Native Preview (Experimental)"),

View File

@@ -536,13 +536,13 @@ export default class TypeScriptServiceClient extends Disposable implements IType
public async openTsServerLogFile(): Promise<boolean> {
if (this._configuration.tsServerLogLevel === TsServerLogLevel.Off) {
vscode.window.showErrorMessage<vscode.MessageItem>(
vscode.l10n.t("TS Server logging is off. Please set 'typescript.tsserver.log' and restart the TS server to enable logging"),
vscode.l10n.t("TS Server logging is off. Please set 'js/ts.tsserver.log' and restart the TS server to enable logging"),
{
title: vscode.l10n.t("Enable logging and restart TS server"),
})
.then(selection => {
if (selection) {
return vscode.workspace.getConfiguration().update('typescript.tsserver.log', 'verbose', true).then(() => {
return vscode.workspace.getConfiguration().update('js/ts.tsserver.log', 'verbose', true).then(() => {
this.restartTsServer();
});
}

View File

@@ -5,6 +5,7 @@
import * as vscode from 'vscode';
import { ITypeScriptServiceClient } from '../typescriptService';
import { readUnifiedConfig } from '../utils/configuration';
import { Disposable } from '../utils/dispose';
@@ -95,21 +96,19 @@ export class AtaProgressReporter extends Disposable {
}
private async onTypesInstallerInitializationFailed() {
const config = vscode.workspace.getConfiguration('typescript');
if (config.get<boolean>('check.npmIsInstalled', true)) {
if (readUnifiedConfig<boolean>('tsserver.checkNpmIsInstalled', true, { fallbackSection: 'typescript', fallbackSubSectionNameOverride: 'check.npmIsInstalled' })) {
const dontShowAgain: vscode.MessageItem = {
title: vscode.l10n.t("Don't Show Again"),
};
const selected = await vscode.window.showWarningMessage(
vscode.l10n.t(
"Could not install typings files for JavaScript language features. Please ensure that NPM is installed, or configure 'typescript.npm' in your user settings. Alternatively, check the [documentation]({0}) to learn more.",
"Could not install typings files for JavaScript language features. Please ensure that NPM is installed, or configure 'js/ts.tsserver.npm.path' in your user settings. Alternatively, check the [documentation]({0}) to learn more.",
'https://go.microsoft.com/fwlink/?linkid=847635'
),
dontShowAgain);
if (selected === dontShowAgain) {
config.update('check.npmIsInstalled', false, true);
vscode.workspace.getConfiguration('js/ts').update('tsserver.checkNpmIsInstalled', false, true);
}
}
}