Always require an explicit argument for Emitter.fire
Calling `fire` with zero arguments results in the emitter firing with `undefined`. This is often not expected or desired. It should be explicit that the emitter is fired with undefinedpull/66115/head
parent
36c6c834a0
commit
af35040758
|
@ -21,7 +21,7 @@ export interface IView {
|
|||
readonly maximumWidth: number;
|
||||
readonly minimumHeight: number;
|
||||
readonly maximumHeight: number;
|
||||
readonly onDidChange: Event<{ width: number; height: number; }>;
|
||||
readonly onDidChange: Event<{ width: number; height: number; } | undefined>;
|
||||
readonly priority?: LayoutPriority;
|
||||
readonly snapSize?: number;
|
||||
layout(width: number, height: number): void;
|
||||
|
@ -308,7 +308,7 @@ class BranchNode implements ISplitView, IDisposable {
|
|||
this.childrenSashResetDisposable.dispose();
|
||||
this.childrenSashResetDisposable = onDidChildrenSashReset(this._onDidSashReset.fire, this._onDidSashReset);
|
||||
|
||||
this._onDidChange.fire();
|
||||
this._onDidChange.fire(undefined);
|
||||
}
|
||||
|
||||
trySet2x2(other: BranchNode): IDisposable {
|
||||
|
@ -348,8 +348,8 @@ class BranchNode implements ISplitView, IDisposable {
|
|||
mySash.linkedSash = otherSash;
|
||||
otherSash.linkedSash = mySash;
|
||||
|
||||
this._onDidChange.fire();
|
||||
other._onDidChange.fire();
|
||||
this._onDidChange.fire(undefined);
|
||||
other._onDidChange.fire(undefined);
|
||||
|
||||
return toDisposable(() => {
|
||||
mySash.linkedSash = otherSash.linkedSash = undefined;
|
||||
|
@ -391,7 +391,7 @@ class LeafNode implements ISplitView, IDisposable {
|
|||
set linkedWidthNode(node: LeafNode | undefined) {
|
||||
this._onDidLinkedWidthNodeChange.input = node ? node._onDidViewChange : Event.None;
|
||||
this._linkedWidthNode = node;
|
||||
this._onDidSetLinkedNode.fire();
|
||||
this._onDidSetLinkedNode.fire(undefined);
|
||||
}
|
||||
|
||||
private _onDidLinkedHeightNodeChange = new Relay<number | undefined>();
|
||||
|
@ -400,7 +400,7 @@ class LeafNode implements ISplitView, IDisposable {
|
|||
set linkedHeightNode(node: LeafNode | undefined) {
|
||||
this._onDidLinkedHeightNodeChange.input = node ? node._onDidViewChange : Event.None;
|
||||
this._linkedHeightNode = node;
|
||||
this._onDidSetLinkedNode.fire();
|
||||
this._onDidSetLinkedNode.fire(undefined);
|
||||
}
|
||||
|
||||
private _onDidSetLinkedNode = new Emitter<number | undefined>();
|
||||
|
|
|
@ -77,7 +77,7 @@ export abstract class Panel implements IView {
|
|||
|
||||
set minimumBodySize(size: number) {
|
||||
this._minimumBodySize = size;
|
||||
this._onDidChange.fire();
|
||||
this._onDidChange.fire(undefined);
|
||||
}
|
||||
|
||||
get maximumBodySize(): number {
|
||||
|
@ -86,7 +86,7 @@ export abstract class Panel implements IView {
|
|||
|
||||
set maximumBodySize(size: number) {
|
||||
this._maximumBodySize = size;
|
||||
this._onDidChange.fire();
|
||||
this._onDidChange.fire(undefined);
|
||||
}
|
||||
|
||||
private get headerSize(): number {
|
||||
|
@ -145,7 +145,7 @@ export abstract class Panel implements IView {
|
|||
|
||||
this._headerVisible = !!visible;
|
||||
this.updateHeader();
|
||||
this._onDidChange.fire();
|
||||
this._onDidChange.fire(undefined);
|
||||
}
|
||||
|
||||
render(): void {
|
||||
|
|
|
@ -137,7 +137,7 @@ export namespace Event {
|
|||
output = undefined;
|
||||
handle = undefined;
|
||||
if (!leading || numDebouncedCalls > 1) {
|
||||
emitter.fire(_output);
|
||||
emitter.fire(_output!);
|
||||
}
|
||||
|
||||
numDebouncedCalls = 0;
|
||||
|
@ -332,17 +332,17 @@ export namespace Event {
|
|||
return result.event;
|
||||
}
|
||||
|
||||
export function fromPromise<T =any>(promise: Promise<T>): Event<T> {
|
||||
const emitter = new Emitter<T>();
|
||||
export function fromPromise<T = any>(promise: Promise<T>): Event<undefined> {
|
||||
const emitter = new Emitter<undefined>();
|
||||
let shouldEmit = false;
|
||||
|
||||
promise
|
||||
.then(undefined, () => null)
|
||||
.then(() => {
|
||||
if (!shouldEmit) {
|
||||
setTimeout(() => emitter.fire(), 0);
|
||||
setTimeout(() => emitter.fire(undefined), 0);
|
||||
} else {
|
||||
emitter.fire();
|
||||
emitter.fire(undefined);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -466,7 +466,7 @@ export class Emitter<T> {
|
|||
private readonly _leakageMon: LeakageMonitor | undefined;
|
||||
private _disposed: boolean = false;
|
||||
private _event: Event<T> | undefined;
|
||||
private _deliveryQueue: [Listener, (T | undefined)][] | undefined;
|
||||
private _deliveryQueue: [Listener, T][] | undefined;
|
||||
protected _listeners: LinkedList<Listener> | undefined;
|
||||
|
||||
constructor(options?: EmitterOptions) {
|
||||
|
@ -541,7 +541,7 @@ export class Emitter<T> {
|
|||
* To be kept private to fire an event to
|
||||
* subscribers
|
||||
*/
|
||||
fire(event?: T): any {
|
||||
fire(event: T): any {
|
||||
if (this._listeners) {
|
||||
// put all [listener,event]-pairs into delivery queue
|
||||
// then emit all event. an inner/nested event might be
|
||||
|
|
|
@ -292,7 +292,7 @@ function createBufferedEvent<T>(source: Event<T>): Event<T> {
|
|||
}
|
||||
isDeliveringMessages = true;
|
||||
while (hasListeners && bufferedMessages.length > 0) {
|
||||
emitter.fire(bufferedMessages.shift());
|
||||
emitter.fire(bufferedMessages.shift()!);
|
||||
}
|
||||
isDeliveringMessages = false;
|
||||
};
|
||||
|
|
|
@ -9,20 +9,20 @@ import { IView, GridNode, isGridBranchNode, } from 'vs/base/browser/ui/grid/grid
|
|||
|
||||
export class TestView implements IView {
|
||||
|
||||
private _onDidChange = new Emitter<{ width: number; height: number; }>();
|
||||
private _onDidChange = new Emitter<{ width: number; height: number; } | undefined>();
|
||||
readonly onDidChange = this._onDidChange.event;
|
||||
|
||||
get minimumWidth(): number { return this._minimumWidth; }
|
||||
set minimumWidth(size: number) { this._minimumWidth = size; this._onDidChange.fire(); }
|
||||
set minimumWidth(size: number) { this._minimumWidth = size; this._onDidChange.fire(undefined); }
|
||||
|
||||
get maximumWidth(): number { return this._maximumWidth; }
|
||||
set maximumWidth(size: number) { this._maximumWidth = size; this._onDidChange.fire(); }
|
||||
set maximumWidth(size: number) { this._maximumWidth = size; this._onDidChange.fire(undefined); }
|
||||
|
||||
get minimumHeight(): number { return this._minimumHeight; }
|
||||
set minimumHeight(size: number) { this._minimumHeight = size; this._onDidChange.fire(); }
|
||||
set minimumHeight(size: number) { this._minimumHeight = size; this._onDidChange.fire(undefined); }
|
||||
|
||||
get maximumHeight(): number { return this._maximumHeight; }
|
||||
set maximumHeight(size: number) { this._maximumHeight = size; this._onDidChange.fire(); }
|
||||
set maximumHeight(size: number) { this._maximumHeight = size; this._onDidChange.fire(undefined); }
|
||||
|
||||
private _element: HTMLElement = document.createElement('div');
|
||||
get element(): HTMLElement { this._onDidGetElement.fire(); return this._element; }
|
||||
|
|
|
@ -14,10 +14,10 @@ class TestView implements IView {
|
|||
readonly onDidChange = this._onDidChange.event;
|
||||
|
||||
get minimumSize(): number { return this._minimumSize; }
|
||||
set minimumSize(size: number) { this._minimumSize = size; this._onDidChange.fire(); }
|
||||
set minimumSize(size: number) { this._minimumSize = size; this._onDidChange.fire(undefined); }
|
||||
|
||||
get maximumSize(): number { return this._maximumSize; }
|
||||
set maximumSize(size: number) { this._maximumSize = size; this._onDidChange.fire(); }
|
||||
set maximumSize(size: number) { this._maximumSize = size; this._onDidChange.fire(undefined); }
|
||||
|
||||
private _element: HTMLElement = document.createElement('div');
|
||||
get element(): HTMLElement { this._onDidGetElement.fire(); return this._element; }
|
||||
|
|
|
@ -111,7 +111,7 @@ suite('Event', function () {
|
|||
Errors.setUnexpectedErrorHandler(() => null);
|
||||
|
||||
try {
|
||||
let a = new Emitter();
|
||||
let a = new Emitter<undefined>();
|
||||
let hit = false;
|
||||
a.event(function () {
|
||||
throw 9;
|
||||
|
@ -134,19 +134,19 @@ suite('Event', function () {
|
|||
}
|
||||
const context = {};
|
||||
|
||||
let emitter = new Emitter();
|
||||
let emitter = new Emitter<undefined>();
|
||||
let reg1 = emitter.event(listener, context);
|
||||
let reg2 = emitter.event(listener, context);
|
||||
|
||||
emitter.fire();
|
||||
emitter.fire(undefined);
|
||||
assert.equal(counter, 2);
|
||||
|
||||
reg1.dispose();
|
||||
emitter.fire();
|
||||
emitter.fire(undefined);
|
||||
assert.equal(counter, 3);
|
||||
|
||||
reg2.dispose();
|
||||
emitter.fire();
|
||||
emitter.fire(undefined);
|
||||
assert.equal(counter, 3);
|
||||
});
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class MarkerModel {
|
|||
private _nextIdx: number;
|
||||
private _toUnbind: IDisposable[];
|
||||
private _ignoreSelectionChange: boolean;
|
||||
private readonly _onCurrentMarkerChanged: Emitter<IMarker>;
|
||||
private readonly _onCurrentMarkerChanged: Emitter<IMarker | undefined>;
|
||||
private readonly _onMarkerSetChanged: Emitter<MarkerModel>;
|
||||
|
||||
constructor(editor: ICodeEditor, markers: IMarker[]) {
|
||||
|
|
|
@ -21,7 +21,7 @@ declare namespace monaco {
|
|||
export class Emitter<T> {
|
||||
constructor();
|
||||
readonly event: IEvent<T>;
|
||||
fire(event?: T): void;
|
||||
fire(event: T): void;
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ export interface IMenuActionOptions {
|
|||
}
|
||||
|
||||
export interface IMenu extends IDisposable {
|
||||
onDidChange: Event<IMenu>;
|
||||
readonly onDidChange: Event<IMenu | undefined>;
|
||||
getActions(options?: IMenuActionOptions): [string, Array<MenuItemAction | SubmenuItemAction>][];
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ export interface IMenuRegistry {
|
|||
getCommands(): ICommandsMap;
|
||||
appendMenuItem(menu: MenuId, item: IMenuItem | ISubmenuItem): IDisposable;
|
||||
getMenuItems(loc: MenuId): Array<IMenuItem | ISubmenuItem>;
|
||||
onDidChangeMenu: Event<MenuId>;
|
||||
readonly onDidChangeMenu: Event<MenuId>;
|
||||
}
|
||||
|
||||
export interface ICommandsMap {
|
||||
|
|
|
@ -29,7 +29,7 @@ type MenuItemGroup = [string, Array<IMenuItem | ISubmenuItem>];
|
|||
|
||||
class Menu implements IMenu {
|
||||
|
||||
private readonly _onDidChange = new Emitter<IMenu>();
|
||||
private readonly _onDidChange = new Emitter<IMenu | undefined>();
|
||||
private readonly _disposables: IDisposable[] = [];
|
||||
|
||||
private _menuGroups: MenuItemGroup[];
|
||||
|
@ -56,7 +56,7 @@ class Menu implements IMenu {
|
|||
this._contextKeyService.onDidChangeContext,
|
||||
(last, event) => last || event.affectsSome(this._contextKeys),
|
||||
50
|
||||
)(e => e && this._onDidChange.fire(), this, this._disposables);
|
||||
)(e => e && this._onDidChange.fire(undefined), this, this._disposables);
|
||||
}
|
||||
|
||||
private _build(): void {
|
||||
|
@ -100,7 +100,7 @@ class Menu implements IMenu {
|
|||
this._onDidChange.dispose();
|
||||
}
|
||||
|
||||
get onDidChange(): Event<IMenu> {
|
||||
get onDidChange(): Event<IMenu | undefined> {
|
||||
return this._onDidChange.event;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ export function upload(uri: URI): Event<UploadResponse> {
|
|||
const readstream = fs.createReadStream(uri.fsPath);
|
||||
readstream.on('data', data => stream.fire(data));
|
||||
readstream.on('error', error => stream.fire(error.toString()));
|
||||
readstream.on('close', () => stream.fire());
|
||||
readstream.on('close', () => stream.fire(undefined));
|
||||
return stream.event;
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ export class EditorControl extends Disposable {
|
|||
}
|
||||
|
||||
// Indicate that size constraints could have changed due to new editor
|
||||
this._onDidSizeConstraintsChange.fire();
|
||||
this._onDidSizeConstraintsChange.fire(undefined);
|
||||
}
|
||||
|
||||
private doSetInput(control: BaseEditor, editor: EditorInput, options: EditorOptions): Promise<boolean> {
|
||||
|
|
|
@ -920,7 +920,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
|
|||
this._onDidSizeConstraintsChange.input = gridWidget.onDidChange;
|
||||
}
|
||||
|
||||
this.onDidSetGridWidget.fire();
|
||||
this.onDidSetGridWidget.fire(undefined);
|
||||
}
|
||||
|
||||
private updateContainer(): void {
|
||||
|
|
|
@ -198,7 +198,7 @@ export class SideBySideEditor extends BaseEditor {
|
|||
Event.map(master.onDidSizeConstraintsChange, () => undefined)
|
||||
);
|
||||
|
||||
this.onDidCreateEditors.fire();
|
||||
this.onDidCreateEditors.fire(undefined);
|
||||
|
||||
return Promise.all([this.detailsEditor.setInput(detailsInput, null, token), this.masterEditor.setInput(masterInput, options, token)]).then(() => this.focus());
|
||||
}
|
||||
|
|
|
@ -482,7 +482,7 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
|
|||
this._selectedItems = [this.activeItems[0]];
|
||||
this.onDidChangeSelectionEmitter.fire(this.selectedItems);
|
||||
}
|
||||
this.onDidAcceptEmitter.fire();
|
||||
this.onDidAcceptEmitter.fire(undefined);
|
||||
}),
|
||||
this.ui.list.onDidChangeFocus(focusedItems => {
|
||||
if (this.activeItemsUpdated) {
|
||||
|
@ -507,7 +507,7 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
|
|||
this._selectedItems = selectedItems as T[];
|
||||
this.onDidChangeSelectionEmitter.fire(selectedItems as T[]);
|
||||
if (selectedItems.length) {
|
||||
this.onDidAcceptEmitter.fire();
|
||||
this.onDidAcceptEmitter.fire(undefined);
|
||||
}
|
||||
}),
|
||||
this.ui.list.onChangedCheckedElements(checkedItems => {
|
||||
|
@ -570,7 +570,7 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
|
|||
if (wasTriggerKeyPressed && this.activeItems[0]) {
|
||||
this._selectedItems = [this.activeItems[0]];
|
||||
this.onDidChangeSelectionEmitter.fire(this.selectedItems);
|
||||
this.onDidAcceptEmitter.fire();
|
||||
this.onDidAcceptEmitter.fire(undefined);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -723,7 +723,7 @@ class InputBox extends QuickInput implements IInputBox {
|
|||
this._value = value;
|
||||
this.onDidValueChangeEmitter.fire(value);
|
||||
}),
|
||||
this.ui.onDidAccept(() => this.onDidAcceptEmitter.fire()),
|
||||
this.ui.onDidAccept(() => this.onDidAcceptEmitter.fire(undefined)),
|
||||
);
|
||||
this.valueSelectionUpdated = true;
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ export class SuggestEnabledInput extends Widget implements IThemable {
|
|||
let content = this.getValue();
|
||||
this.placeholderText.style.visibility = content ? 'hidden' : 'visible';
|
||||
if (preexistingContent.trim() === content.trim()) { return; }
|
||||
this._onInputDidChange.fire();
|
||||
this._onInputDidChange.fire(undefined);
|
||||
preexistingContent = content;
|
||||
}));
|
||||
|
||||
|
|
|
@ -798,6 +798,6 @@ export class ReviewZoneWidget extends ZoneWidget {
|
|||
|
||||
this._globalToDispose.forEach(global => global.dispose());
|
||||
this._localToDispose.forEach(local => local.dispose());
|
||||
this._onDidClose.fire();
|
||||
this._onDidClose.fire(undefined);
|
||||
}
|
||||
}
|
|
@ -786,7 +786,7 @@ export class DebugModel implements IDebugModel {
|
|||
return true;
|
||||
});
|
||||
this.sessions.push(session);
|
||||
this._onDidChangeCallStack.fire();
|
||||
this._onDidChangeCallStack.fire(undefined);
|
||||
}
|
||||
|
||||
get onDidChangeBreakpoints(): Event<IBreakpointsChangeEvent> {
|
||||
|
@ -805,7 +805,7 @@ export class DebugModel implements IDebugModel {
|
|||
let session = this.sessions.filter(p => p.getId() === data.sessionId).pop();
|
||||
if (session) {
|
||||
session.rawUpdate(data);
|
||||
this._onDidChangeCallStack.fire();
|
||||
this._onDidChangeCallStack.fire(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -816,7 +816,7 @@ export class DebugModel implements IDebugModel {
|
|||
|
||||
if (session) {
|
||||
session.clearThreads(removeThreads, reference);
|
||||
this._onDidChangeCallStack.fire();
|
||||
this._onDidChangeCallStack.fire(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -881,7 +881,7 @@ export class DebugModel implements IDebugModel {
|
|||
const ebp = this.exceptionBreakpoints.filter(ebp => ebp.filter === d.filter).pop();
|
||||
return new ExceptionBreakpoint(d.filter, d.label, ebp ? ebp.enabled : d.default);
|
||||
});
|
||||
this._onDidChangeBreakpoints.fire();
|
||||
this._onDidChangeBreakpoints.fire(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -891,7 +891,7 @@ export class DebugModel implements IDebugModel {
|
|||
|
||||
setBreakpointsActivated(activated: boolean): void {
|
||||
this.breakpointsActivated = activated;
|
||||
this._onDidChangeBreakpoints.fire();
|
||||
this._onDidChangeBreakpoints.fire(undefined);
|
||||
}
|
||||
|
||||
addBreakpoints(uri: uri, rawData: IBreakpointData[], fireEvent = true): IBreakpoint[] {
|
||||
|
@ -1052,7 +1052,7 @@ export class DebugModel implements IDebugModel {
|
|||
|
||||
removeWatchExpressions(id: string | null = null): void {
|
||||
this.watchExpressions = id ? this.watchExpressions.filter(we => we.getId() !== id) : [];
|
||||
this._onDidChangeWatchExpressions.fire();
|
||||
this._onDidChangeWatchExpressions.fire(undefined);
|
||||
}
|
||||
|
||||
moveWatchExpression(id: string, position: number): void {
|
||||
|
@ -1060,7 +1060,7 @@ export class DebugModel implements IDebugModel {
|
|||
this.watchExpressions = this.watchExpressions.filter(we => we.getId() !== id);
|
||||
this.watchExpressions = this.watchExpressions.slice(0, position).concat(we, this.watchExpressions.slice(position));
|
||||
|
||||
this._onDidChangeWatchExpressions.fire();
|
||||
this._onDidChangeWatchExpressions.fire(undefined);
|
||||
}
|
||||
|
||||
sourceIsNotAvailable(uri: uri): void {
|
||||
|
@ -1070,7 +1070,7 @@ export class DebugModel implements IDebugModel {
|
|||
source.available = false;
|
||||
}
|
||||
});
|
||||
this._onDidChangeCallStack.fire();
|
||||
this._onDidChangeCallStack.fire(undefined);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
|
|
|
@ -449,7 +449,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
|
|||
return extension;
|
||||
});
|
||||
|
||||
this._onChange.fire();
|
||||
this._onChange.fire(undefined);
|
||||
return this.local;
|
||||
}));
|
||||
}
|
||||
|
@ -971,7 +971,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
|
|||
const uninstalling = this.uninstalling.filter(e => e.local.identifier.id === id)[0] || extension;
|
||||
this.uninstalling = [uninstalling, ...this.uninstalling.filter(e => e.local.identifier.id !== id)];
|
||||
|
||||
this._onChange.fire();
|
||||
this._onChange.fire(undefined);
|
||||
}
|
||||
|
||||
private onDidUninstallExtension({ identifier, error }: DidUninstallExtensionEvent): void {
|
||||
|
@ -986,7 +986,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService,
|
|||
return;
|
||||
}
|
||||
|
||||
this._onChange.fire();
|
||||
this._onChange.fire(undefined);
|
||||
}
|
||||
|
||||
private onEnablementChanged(identifier: IExtensionIdentifier) {
|
||||
|
|
|
@ -549,7 +549,7 @@ export class MarkersViewState extends Disposable {
|
|||
});
|
||||
this.bulkUpdate = false;
|
||||
if (changed) {
|
||||
this._onDidChangeViewState.fire();
|
||||
this._onDidChangeViewState.fire(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ export class PreferencesEditor extends BaseEditor {
|
|||
|
||||
const editorsContainer = DOM.append(parent, DOM.$('.preferences-editors-container'));
|
||||
this.sideBySidePreferencesWidget = this._register(this.instantiationService.createInstance(SideBySidePreferencesWidget, editorsContainer));
|
||||
this._onDidCreateWidget.fire();
|
||||
this._onDidCreateWidget.fire(undefined);
|
||||
this._register(this.sideBySidePreferencesWidget.onFocus(() => this.lastFocusedWidget = this.sideBySidePreferencesWidget));
|
||||
this._register(this.sideBySidePreferencesWidget.onDidSettingsTargetChange(target => this.switchSettings(target)));
|
||||
|
||||
|
|
|
@ -154,10 +154,10 @@ export class PatternInputWidget extends Widget {
|
|||
private onInputKeyUp(keyboardEvent: IKeyboardEvent) {
|
||||
switch (keyboardEvent.keyCode) {
|
||||
case KeyCode.Enter:
|
||||
this._onSubmit.fire();
|
||||
this._onSubmit.fire(false);
|
||||
return;
|
||||
case KeyCode.Escape:
|
||||
this._onCancel.fire();
|
||||
this._onCancel.fire(false);
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
|
|
|
@ -733,7 +733,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
|
|||
this.tree.setFocus([next]);
|
||||
this.tree.setSelection([next]);
|
||||
this.tree.reveal(next);
|
||||
this.selectCurrentMatchEmitter.fire();
|
||||
this.selectCurrentMatchEmitter.fire(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -774,7 +774,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
|
|||
this.tree.setFocus([prev]);
|
||||
this.tree.setSelection([prev]);
|
||||
this.tree.reveal(prev);
|
||||
this.selectCurrentMatchEmitter.fire();
|
||||
this.selectCurrentMatchEmitter.fire(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ export class SearchWidget extends Widget {
|
|||
private _onReplaceStateChange = this._register(new Emitter<boolean>());
|
||||
readonly onReplaceStateChange: Event<boolean> = this._onReplaceStateChange.event;
|
||||
|
||||
private _onReplaceValueChanged = this._register(new Emitter<string>());
|
||||
private _onReplaceValueChanged = this._register(new Emitter<string | undefined>());
|
||||
readonly onReplaceValueChanged: Event<string> = this._onReplaceValueChanged.event;
|
||||
|
||||
private _onReplaceAll = this._register(new Emitter<void>());
|
||||
|
@ -343,7 +343,7 @@ export class SearchWidget extends Widget {
|
|||
this._register(attachInputBoxStyler(this.replaceInput, this.themeService));
|
||||
this.onkeydown(this.replaceInput.inputElement, (keyboardEvent) => this.onReplaceInputKeyDown(keyboardEvent));
|
||||
this.replaceInput.value = options.replaceValue || '';
|
||||
this._register(this.replaceInput.onDidChange(() => this._onReplaceValueChanged.fire()));
|
||||
this._register(this.replaceInput.onDidChange(() => this._onReplaceValueChanged.fire(undefined)));
|
||||
this._register(this.replaceInput.onDidHeightChange(() => this._onDidHeightChange.fire()));
|
||||
|
||||
this.replaceAllAction = ReplaceAllAction.INSTANCE;
|
||||
|
|
|
@ -197,7 +197,7 @@ export interface ITerminalService {
|
|||
onInstanceRequestExtHostProcess: Event<ITerminalProcessExtHostRequest>;
|
||||
onInstancesChanged: Event<void>;
|
||||
onInstanceTitleChanged: Event<ITerminalInstance>;
|
||||
onActiveInstanceChanged: Event<ITerminalInstance>;
|
||||
onActiveInstanceChanged: Event<ITerminalInstance | undefined>;
|
||||
terminalInstances: ITerminalInstance[];
|
||||
terminalTabs: ITerminalTab[];
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ export abstract class TerminalService implements ITerminalService {
|
|||
public get onInstancesChanged(): Event<void> { return this._onInstancesChanged.event; }
|
||||
protected readonly _onInstanceTitleChanged = new Emitter<ITerminalInstance>();
|
||||
public get onInstanceTitleChanged(): Event<ITerminalInstance> { return this._onInstanceTitleChanged.event; }
|
||||
protected readonly _onActiveInstanceChanged = new Emitter<ITerminalInstance>();
|
||||
public get onActiveInstanceChanged(): Event<ITerminalInstance> { return this._onActiveInstanceChanged.event; }
|
||||
protected readonly _onActiveInstanceChanged = new Emitter<ITerminalInstance | undefined>();
|
||||
public get onActiveInstanceChanged(): Event<ITerminalInstance | undefined> { return this._onActiveInstanceChanged.event; }
|
||||
protected readonly _onTabDisposed = new Emitter<ITerminalTab>();
|
||||
public get onTabDisposed(): Event<ITerminalTab> { return this._onTabDisposed.event; }
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ const SHELL_EXECUTABLES = [
|
|||
let windowsProcessTree: typeof WindowsProcessTreeType;
|
||||
|
||||
export class WindowsShellHelper {
|
||||
private _onCheckShell: Emitter<Promise<string>>;
|
||||
private _onCheckShell: Emitter<Promise<string> | undefined>;
|
||||
private _isDisposed: boolean;
|
||||
private _currentRequest: Promise<string> | null;
|
||||
private _newLineFeed: boolean;
|
||||
|
@ -64,12 +64,12 @@ export class WindowsShellHelper {
|
|||
this._xterm.on('linefeed', () => this._newLineFeed = true);
|
||||
this._xterm.on('cursormove', () => {
|
||||
if (this._newLineFeed) {
|
||||
this._onCheckShell.fire();
|
||||
this._onCheckShell.fire(undefined);
|
||||
}
|
||||
});
|
||||
|
||||
// Fire a new check for the shell when any key is pressed.
|
||||
this._xterm.on('keypress', () => this._onCheckShell.fire());
|
||||
this._xterm.on('keypress', () => this._onCheckShell.fire(undefined));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ suite('ExtHostTreeView', function () {
|
|||
|
||||
let testObject: ExtHostTreeViews;
|
||||
let target: RecordingShape;
|
||||
let onDidChangeTreeNode: Emitter<{ key: string }>;
|
||||
let onDidChangeTreeNode: Emitter<{ key: string } | undefined>;
|
||||
let onDidChangeTreeNodeWithId: Emitter<{ key: string }>;
|
||||
let tree, labels, nodes;
|
||||
|
||||
|
@ -199,7 +199,7 @@ suite('ExtHostTreeView', function () {
|
|||
.then(() => { assert.fail('Should fail with duplicate id'); done(); }, () => done());
|
||||
});
|
||||
});
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('refresh root', function (done) {
|
||||
|
@ -207,7 +207,7 @@ suite('ExtHostTreeView', function () {
|
|||
assert.equal(undefined, actuals);
|
||||
done();
|
||||
});
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('refresh a parent node', () => {
|
||||
|
@ -300,10 +300,10 @@ suite('ExtHostTreeView', function () {
|
|||
assert.equal(undefined, actuals);
|
||||
done();
|
||||
});
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('refresh calls are throttled on elements', function (done) {
|
||||
|
@ -339,7 +339,7 @@ suite('ExtHostTreeView', function () {
|
|||
onDidChangeTreeNode.fire(getNode('a'));
|
||||
onDidChangeTreeNode.fire(getNode('b'));
|
||||
onDidChangeTreeNode.fire(getNode('g'));
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('refresh calls are throttled on elements and root', function (done) {
|
||||
|
@ -350,7 +350,7 @@ suite('ExtHostTreeView', function () {
|
|||
|
||||
onDidChangeTreeNode.fire(getNode('a'));
|
||||
onDidChangeTreeNode.fire(getNode('b'));
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
onDidChangeTreeNode.fire(getNode('a'));
|
||||
});
|
||||
|
||||
|
@ -366,7 +366,7 @@ suite('ExtHostTreeView', function () {
|
|||
done();
|
||||
});
|
||||
});
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('tree with duplicate labels', (done) => {
|
||||
|
@ -415,7 +415,7 @@ suite('ExtHostTreeView', function () {
|
|||
});
|
||||
});
|
||||
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('getChildren is not returned from cache if refreshed', (done) => {
|
||||
|
@ -431,7 +431,7 @@ suite('ExtHostTreeView', function () {
|
|||
});
|
||||
});
|
||||
|
||||
onDidChangeTreeNode.fire();
|
||||
onDidChangeTreeNode.fire(undefined);
|
||||
});
|
||||
|
||||
test('getChildren is returned from cache if not refreshed', () => {
|
||||
|
|
Loading…
Reference in New Issue