Skip to content

Commit cbdd9bd

Browse files
committed
Strict null work on extensions
1 parent 0f89a21 commit cbdd9bd

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ interface IRuntimeExtension {
9090
description: IExtensionDescription;
9191
marketplaceInfo: IExtension;
9292
status: IExtensionsStatus;
93-
profileInfo: IExtensionProfileInformation;
93+
profileInfo?: IExtensionProfileInformation;
9494
unresponsiveProfile?: IExtensionHostProfile;
9595
}
9696

@@ -214,7 +214,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
214214
description: extensionDescription,
215215
marketplaceInfo: marketplaceMap[ExtensionIdentifier.toKey(extensionDescription.identifier)],
216216
status: statusMap[extensionDescription.identifier.value],
217-
profileInfo: profileInfo,
217+
profileInfo: profileInfo || undefined,
218218
unresponsiveProfile: this._extensionHostProfileService.getUnresponsiveProfile(extensionDescription.identifier)
219219
};
220220
}
@@ -402,7 +402,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
402402
horizontalScrolling: false
403403
}) as WorkbenchList<IRuntimeExtension>;
404404

405-
this._list.splice(0, this._list.length, this._elements);
405+
this._list.splice(0, this._list.length, this._elements || undefined);
406406

407407
this._list.onContextMenu((e) => {
408408
if (!e.element) {
@@ -579,7 +579,7 @@ export class DebugExtensionHostAction extends Action {
579579
}
580580
}
581581

582-
return this._debugService.startDebugging(null, {
582+
return this._debugService.startDebugging(undefined, {
583583
type: 'node',
584584
name: nls.localize('debugExtensionHost.launch.name', "Attach Extension Host"),
585585
request: 'attach',

src/vs/workbench/services/extensions/common/extensions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export interface IExtensionHostProfile {
8989
/**
9090
* Extension id or one of the four known program states.
9191
*/
92-
export type ProfileSegmentId = string | 'idle' | 'program' | 'gc' | 'self' | null;
92+
export type ProfileSegmentId = string | 'idle' | 'program' | 'gc' | 'self';
9393

9494
export class ActivationTimes {
9595
constructor(

src/vs/workbench/services/extensions/electron-browser/extensionHostProfiler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ export class ExtensionHostProfiler {
3333

3434
let nodes = profile.nodes;
3535
let idsToNodes = new Map<number, ProfileNode>();
36-
let idsToSegmentId = new Map<number, ProfileSegmentId>();
36+
let idsToSegmentId = new Map<number, ProfileSegmentId | null>();
3737
for (let node of nodes) {
3838
idsToNodes.set(node.id, node);
3939
}
4040

41-
function visit(node: ProfileNode, segmentId: ProfileSegmentId) {
41+
function visit(node: ProfileNode, segmentId: ProfileSegmentId | null) {
4242
if (!segmentId) {
4343
switch (node.callFrame.functionName) {
4444
case '(root)':

0 commit comments

Comments
 (0)