提交 26ff5f8b 编写于 作者: M Matt Bierner

Strict null work in extensionProfileService

上级 4180c4f1
......@@ -33,8 +33,8 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio
public readonly onDidChangeLastProfile: Event<void> = this._onDidChangeLastProfile.event;
private readonly _unresponsiveProfiles = new Map<string, IExtensionHostProfile>();
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<any> {
public startProfiling(): Promise<any> | 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;
......
......@@ -62,12 +62,12 @@ export interface IExtensionHostProfileService {
readonly onDidChangeLastProfile: Event<void>;
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册