Skip to content

Commit

Permalink
Use undefined instead of null for IStatusbarEntryAccessor
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Jun 12, 2019
1 parent 1b95baa commit f291714
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/vs/workbench/browser/parts/editor/editorStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,14 @@ const nlsEOLLF = nls.localize('endOfLineLineFeed', "LF");
const nlsEOLCRLF = nls.localize('endOfLineCarriageReturnLineFeed', "CRLF");

export class EditorStatus extends Disposable implements IWorkbenchContribution {
private tabFocusModeElement: IStatusbarEntryAccessor | null = null;
private screenRedearModeElement: IStatusbarEntryAccessor | null = null;
private indentationElement: IStatusbarEntryAccessor | null = null;
private selectionElement: IStatusbarEntryAccessor | null = null;
private encodingElement: IStatusbarEntryAccessor | null = null;
private eolElement: IStatusbarEntryAccessor | null = null;
private modeElement: IStatusbarEntryAccessor | null = null;
private metadataElement: IStatusbarEntryAccessor | null = null;
private tabFocusModeElement?: IStatusbarEntryAccessor;
private screenRedearModeElement?: IStatusbarEntryAccessor;
private indentationElement?: IStatusbarEntryAccessor;
private selectionElement?: IStatusbarEntryAccessor;
private encodingElement?: IStatusbarEntryAccessor;
private eolElement?: IStatusbarEntryAccessor;
private modeElement?: IStatusbarEntryAccessor;
private metadataElement?: IStatusbarEntryAccessor;

private readonly state = new State();
private readonly activeEditorListeners: IDisposable[] = [];
Expand Down Expand Up @@ -392,7 +392,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
} else {
if (this.tabFocusModeElement) {
this.tabFocusModeElement.dispose();
this.tabFocusModeElement = null;
this.tabFocusModeElement = undefined;
}
}
}
Expand All @@ -409,7 +409,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
} else {
if (this.screenRedearModeElement) {
this.screenRedearModeElement.dispose();
this.screenRedearModeElement = null;
this.screenRedearModeElement = undefined;
}
}
}
Expand All @@ -418,7 +418,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
if (!text) {
if (this.selectionElement) {
dispose(this.selectionElement);
this.selectionElement = null;
this.selectionElement = undefined;
}

return;
Expand All @@ -437,7 +437,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
if (!text) {
if (this.indentationElement) {
dispose(this.indentationElement);
this.indentationElement = null;
this.indentationElement = undefined;
}

return;
Expand All @@ -456,7 +456,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
if (!text) {
if (this.encodingElement) {
dispose(this.encodingElement);
this.encodingElement = null;
this.encodingElement = undefined;
}

return;
Expand All @@ -475,7 +475,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
if (!text) {
if (this.eolElement) {
dispose(this.eolElement);
this.eolElement = null;
this.eolElement = undefined;
}

return;
Expand All @@ -494,7 +494,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
if (!text) {
if (this.modeElement) {
dispose(this.modeElement);
this.modeElement = null;
this.modeElement = undefined;
}

return;
Expand All @@ -513,7 +513,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
if (!text) {
if (this.metadataElement) {
dispose(this.metadataElement);
this.metadataElement = null;
this.metadataElement = undefined;
}

return;
Expand All @@ -527,7 +527,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
this.metadataElement = this.updateElement(this.metadataElement, props, 'status.editor.info', nls.localize('status.editor.info', "File Information"), StatusbarAlignment.RIGHT, 100);
}

private updateElement(element: IStatusbarEntryAccessor | null, props: IStatusbarEntry, id: string, name: string, alignment: StatusbarAlignment, priority: number): IStatusbarEntryAccessor | null {
private updateElement(element: IStatusbarEntryAccessor | undefined, props: IStatusbarEntry, id: string, name: string, alignment: StatusbarAlignment, priority: number): IStatusbarEntryAccessor | undefined {
if (!element) {
element = this.statusbarService.addEntry(props, id, name, alignment, priority);
} else {
Expand Down

0 comments on commit f291714

Please sign in to comment.