diff --git a/package-lock.json b/package-lock.json index 0549935d88a5c..2150cf7f8c6d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -154,7 +154,7 @@ "ts-node": "^10.9.1", "tsec": "0.2.7", "tslib": "^2.6.3", - "typescript": "^5.7.0-dev.20241104", + "typescript": "^5.8.0-dev.20241107", "typescript-eslint": "^8.8.0", "util": "^0.12.4", "webpack": "^5.94.0", @@ -17321,10 +17321,11 @@ "dev": true }, "node_modules/typescript": { - "version": "5.7.0-dev.20241104", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.0-dev.20241104.tgz", - "integrity": "sha512-cz5/yx6iInIMoiEsKTQm/4iZ0PbTMPUtSOUrVc8jvdAg9k5qDiSkq4+TOqZvqKnEMK+5TM1yM983dwABaaeudg==", + "version": "5.8.0-dev.20241107", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.0-dev.20241107.tgz", + "integrity": "sha512-AYCebTVMNbwq0Ec2P+mkALuJjg01l/dPtSOqTjovvcqqCrmqvXCgI13z4bb1pf9AuuEm8bnLQhpG9uAdCfIjqg==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index 70f94a079db6b..7b67bee6d1020 100644 --- a/package.json +++ b/package.json @@ -212,7 +212,7 @@ "ts-node": "^10.9.1", "tsec": "0.2.7", "tslib": "^2.6.3", - "typescript": "^5.7.0-dev.20241104", + "typescript": "^5.8.0-dev.20241107", "typescript-eslint": "^8.8.0", "util": "^0.12.4", "webpack": "^5.94.0", @@ -240,4 +240,4 @@ "optionalDependencies": { "windows-foreground-love": "0.5.0" } -} \ No newline at end of file +} diff --git a/src/vs/platform/configuration/common/configuration.ts b/src/vs/platform/configuration/common/configuration.ts index 770ce0f6426b2..a93872f4cd77e 100644 --- a/src/vs/platform/configuration/common/configuration.ts +++ b/src/vs/platform/configuration/common/configuration.ts @@ -279,7 +279,9 @@ function doRemoveFromValueTree(valueTree: any, segments: string[]): void { /** * A helper function to get the configuration value with a specific settings path (e.g. config.some.setting) */ -export function getConfigurationValue(config: any, settingPath: string, defaultValue?: T): T { +export function getConfigurationValue(config: any, settingPath: string): T | undefined; +export function getConfigurationValue(config: any, settingPath: string, defaultValue: T): T; +export function getConfigurationValue(config: any, settingPath: string, defaultValue?: T): T | undefined { function accessSetting(config: any, path: string[]): any { let current = config; for (const component of path) { diff --git a/src/vs/platform/contextkey/browser/contextKeyService.ts b/src/vs/platform/contextkey/browser/contextKeyService.ts index f125af404f29b..bb3c267c0bcf1 100644 --- a/src/vs/platform/contextkey/browser/contextKeyService.ts +++ b/src/vs/platform/contextkey/browser/contextKeyService.ts @@ -518,8 +518,8 @@ class OverlayContext implements IContext { constructor(private parent: IContext, private overlay: ReadonlyMap) { } - getValue(key: string): T | undefined { - return this.overlay.has(key) ? this.overlay.get(key) : this.parent.getValue(key); + getValue(key: string): T | undefined { + return this.overlay.has(key) ? this.overlay.get(key) : this.parent.getValue(key); } } diff --git a/src/vs/platform/observable/common/wrapInHotClass.ts b/src/vs/platform/observable/common/wrapInHotClass.ts index 75e706ed1b08f..73c071efe9257 100644 --- a/src/vs/platform/observable/common/wrapInHotClass.ts +++ b/src/vs/platform/observable/common/wrapInHotClass.ts @@ -5,7 +5,7 @@ import { isHotReloadEnabled } from '../../../base/common/hotReload.js'; import { IDisposable } from '../../../base/common/lifecycle.js'; import { autorunWithStore, IObservable } from '../../../base/common/observable.js'; -import { BrandedService, GetLeadingNonServiceArgs, IInstantiationService } from '../../instantiation/common/instantiation.js'; +import { BrandedService, IInstantiationService } from '../../instantiation/common/instantiation.js'; export function hotClassGetOriginalInstance(value: T): T { if (value instanceof BaseClass) { @@ -19,7 +19,7 @@ export function hotClassGetOriginalInstance(value: T): T { * When the wrapper is created, the original class is created. * When the original class changes, the instance is re-created. */ -export function wrapInHotClass0(clazz: IObservable>): Result> { +export function wrapInHotClass0(clazz: IObservable>): Result { return !isHotReloadEnabled() ? clazz.get() : createWrapper(clazz, BaseClass0); } @@ -61,7 +61,7 @@ class BaseClass0 extends BaseClass { * When the wrapper is created, the original class is created. * When the original class changes, the instance is re-created. */ -export function wrapInHotClass1(clazz: IObservable>): Result> { +export function wrapInHotClass1(clazz: IObservable>): Result { return !isHotReloadEnabled() ? clazz.get() : createWrapper(clazz, BaseClass1); } diff --git a/src/vs/platform/observable/common/wrapInReloadableClass.ts b/src/vs/platform/observable/common/wrapInReloadableClass.ts index 2bb37d1f40151..c7dff91d50bb4 100644 --- a/src/vs/platform/observable/common/wrapInReloadableClass.ts +++ b/src/vs/platform/observable/common/wrapInReloadableClass.ts @@ -13,7 +13,7 @@ import { BrandedService, GetLeadingNonServiceArgs, IInstantiationService } from * When the wrapper is created, the original class is created. * When the original class changes, the instance is re-created. */ -export function wrapInReloadableClass0(getClass: () => Result): Result> { +export function wrapInReloadableClass0(getClass: () => Result): Result { return !isHotReloadEnabled() ? getClass() : createWrapper(getClass, BaseClass0); } diff --git a/src/vs/workbench/services/preferences/common/preferencesModels.ts b/src/vs/workbench/services/preferences/common/preferencesModels.ts index c43b666ad0926..6209d182d4eae 100644 --- a/src/vs/workbench/services/preferences/common/preferencesModels.ts +++ b/src/vs/workbench/services/preferences/common/preferencesModels.ts @@ -95,7 +95,7 @@ abstract class AbstractSettingsModel extends EditorModel { return undefined; } - protected collectMetadata(groups: ISearchResultGroup[]): IStringDictionary { + protected collectMetadata(groups: ISearchResultGroup[]): IStringDictionary | null { const metadata = Object.create(null); let hasMetadata = false; groups.forEach(g => { @@ -208,7 +208,7 @@ export class SettingsEditorModel extends AbstractSettingsModel implements ISetti allGroups: this.settingsGroups, filteredGroups: filteredGroup ? [filteredGroup] : [], matches, - metadata + metadata: metadata ?? undefined }; } } @@ -849,7 +849,7 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements allGroups: this.settingsGroups, filteredGroups, matches, - metadata + metadata: metadata ?? undefined } : undefined; } diff --git a/src/vs/workbench/services/search/common/queryBuilder.ts b/src/vs/workbench/services/search/common/queryBuilder.ts index 4b712c6be50e4..feaaf16c7f4a3 100644 --- a/src/vs/workbench/services/search/common/queryBuilder.ts +++ b/src/vs/workbench/services/search/common/queryBuilder.ts @@ -646,7 +646,7 @@ function splitGlobFromPath(searchPath: string): { pathPortion: string; globPorti }; } -function patternListToIExpression(...patterns: string[]): glob.IExpression { +function patternListToIExpression(...patterns: string[]): glob.IExpression | undefined { return patterns.length ? patterns.reduce((glob, cur) => { glob[cur] = true; return glob; }, Object.create(null)) : undefined;