diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts index 36b76f71fcd62d4aab1366728bf69325274bb2fb..ed8e3872d2ec7f06eb894533ad7cafc3878c97d4 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts @@ -33,8 +33,8 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio public readonly onDidChangeLastProfile: Event = this._onDidChangeLastProfile.event; private readonly _unresponsiveProfiles = new Map(); - private _profile: IExtensionHostProfile; - private _profileSession: ProfileSession; + private _profile: IExtensionHostProfile | null; + private _profileSession: ProfileSession | null; private _state: ProfileSessionState; public get state() { return this._state; } @@ -71,7 +71,7 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio this._onDidChangeState.fire(undefined); } - public startProfiling(): Promise { + public startProfiling(): Promise | null { if (this._state !== ProfileSessionState.None) { return null; } @@ -102,7 +102,7 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio } public stopProfiling(): void { - if (this._state !== ProfileSessionState.Running) { + if (this._state !== ProfileSessionState.Running || !this._profileSession) { return; } @@ -142,7 +142,7 @@ export class ProfileExtHostStatusbarItem implements IStatusbarItem { private label: HTMLElement; private timeStarted: number; private labelUpdater: any; - private clickHandler: () => void; + private clickHandler: (() => void) | null; constructor() { ProfileExtHostStatusbarItem.instance = this; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts b/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts index 4303ca6cd1a1350a747a435cb37af519ce340e49..c192a29b6fd249f40bdca3c6497ccf69193b0c9b 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts @@ -62,12 +62,12 @@ export interface IExtensionHostProfileService { readonly onDidChangeLastProfile: Event; readonly state: ProfileSessionState; - readonly lastProfile: IExtensionHostProfile; + readonly lastProfile: IExtensionHostProfile | null; startProfiling(): void; stopProfiling(): void; - getUnresponsiveProfile(extensionId: ExtensionIdentifier): IExtensionHostProfile; + getUnresponsiveProfile(extensionId: ExtensionIdentifier): IExtensionHostProfile | undefined; setUnresponsiveProfile(extensionId: ExtensionIdentifier, profile: IExtensionHostProfile): void; }