mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-06 23:06:20 +01:00
Marking most private emitters as readonly
Emitters should generally not be reassigned as their corresponding event would also be lost. Marking these as readonly just to enforce this
This commit is contained in:
@@ -188,12 +188,12 @@ class BranchNode implements ISplitView, IDisposable {
|
||||
return this.orientation === Orientation.HORIZONTAL ? this.maximumSize : this.maximumOrthogonalSize;
|
||||
}
|
||||
|
||||
private _onDidChange = new Emitter<number | undefined>();
|
||||
private readonly _onDidChange = new Emitter<number | undefined>();
|
||||
readonly onDidChange: Event<number | undefined> = this._onDidChange.event;
|
||||
|
||||
private childrenChangeDisposable: IDisposable = Disposable.None;
|
||||
|
||||
private _onDidSashReset = new Emitter<number[]>();
|
||||
private readonly _onDidSashReset = new Emitter<number[]>();
|
||||
readonly onDidSashReset: Event<number[]> = this._onDidSashReset.event;
|
||||
private splitviewSashResetDisposable: IDisposable = Disposable.None;
|
||||
private childrenSashResetDisposable: IDisposable = Disposable.None;
|
||||
@@ -539,7 +539,7 @@ class LeafNode implements ISplitView, IDisposable {
|
||||
this._onDidSetLinkedNode.fire(undefined);
|
||||
}
|
||||
|
||||
private _onDidSetLinkedNode = new Emitter<number | undefined>();
|
||||
private readonly _onDidSetLinkedNode = new Emitter<number | undefined>();
|
||||
private _onDidViewChange: Event<number | undefined>;
|
||||
readonly onDidChange: Event<number | undefined>;
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
|
||||
|
||||
private readonly disposables: DisposableStore = new DisposableStore();
|
||||
|
||||
private _onDidChangeContentHeight = new Emitter<number>();
|
||||
private readonly _onDidChangeContentHeight = new Emitter<number>();
|
||||
readonly onDidChangeContentHeight: Event<number> = Event.latch(this._onDidChangeContentHeight.event);
|
||||
get contentHeight(): number { return this.rangeMap.size; }
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ class Trait<T> implements ISpliceable<boolean>, IDisposable {
|
||||
private indexes: number[] = [];
|
||||
private sortedIndexes: number[] = [];
|
||||
|
||||
private _onChange = new Emitter<ITraitChangeEvent>();
|
||||
private readonly _onChange = new Emitter<ITraitChangeEvent>();
|
||||
readonly onChange: Event<ITraitChangeEvent> = this._onChange.event;
|
||||
|
||||
get trait(): string { return this._trait; }
|
||||
@@ -176,7 +176,7 @@ class Trait<T> implements ISpliceable<boolean>, IDisposable {
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this._onChange = dispose(this._onChange);
|
||||
dispose(this._onChange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1111,10 +1111,10 @@ export class List<T> implements ISpliceable<T>, IDisposable {
|
||||
return Event.map(this.eventBufferer.wrapEvent(this.selection.onChange), e => this.toListEvent(e));
|
||||
}
|
||||
|
||||
private _onDidOpen = new Emitter<IListEvent<T>>();
|
||||
private readonly _onDidOpen = new Emitter<IListEvent<T>>();
|
||||
readonly onDidOpen: Event<IListEvent<T>> = this._onDidOpen.event;
|
||||
|
||||
private _onDidPin = new Emitter<IListEvent<T>>();
|
||||
private readonly _onDidPin = new Emitter<IListEvent<T>>();
|
||||
readonly onDidPin: Event<IListEvent<T>> = this._onDidPin.event;
|
||||
|
||||
get domId(): string { return this.view.domId; }
|
||||
@@ -1168,7 +1168,7 @@ export class List<T> implements ISpliceable<T>, IDisposable {
|
||||
readonly onDidFocus: Event<void>;
|
||||
readonly onDidBlur: Event<void>;
|
||||
|
||||
private _onDidDispose = new Emitter<void>();
|
||||
private readonly _onDidDispose = new Emitter<void>();
|
||||
readonly onDidDispose: Event<void> = this._onDidDispose.event;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -567,7 +567,7 @@ class TypeFilterController<T, TFilterData> implements IDisposable {
|
||||
private _empty: boolean = false;
|
||||
get empty(): boolean { return this._empty; }
|
||||
|
||||
private _onDidChangeEmptyState = new Emitter<boolean>();
|
||||
private readonly _onDidChangeEmptyState = new Emitter<boolean>();
|
||||
readonly onDidChangeEmptyState: Event<boolean> = Event.latch(this._onDidChangeEmptyState.event);
|
||||
|
||||
private positionClassName = 'ne';
|
||||
@@ -581,7 +581,7 @@ class TypeFilterController<T, TFilterData> implements IDisposable {
|
||||
private automaticKeyboardNavigation = true;
|
||||
private triggered = false;
|
||||
|
||||
private _onDidChangePattern = new Emitter<string>();
|
||||
private readonly _onDidChangePattern = new Emitter<string>();
|
||||
readonly onDidChangePattern = this._onDidChangePattern.event;
|
||||
|
||||
private enabledDisposables: IDisposable[] = [];
|
||||
@@ -934,7 +934,7 @@ class Trait<T> {
|
||||
private nodes: ITreeNode<T, any>[] = [];
|
||||
private elements: T[] | undefined;
|
||||
|
||||
private _onDidChange = new Emitter<ITreeEvent<T>>();
|
||||
private readonly _onDidChange = new Emitter<ITreeEvent<T>>();
|
||||
readonly onDidChange = this._onDidChange.event;
|
||||
|
||||
private _nodeSet: Set<ITreeNode<T, any>> | undefined;
|
||||
@@ -1204,7 +1204,7 @@ export abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable
|
||||
get onDidChangeCollapseState(): Event<ICollapseStateChangeEvent<T, TFilterData>> { return this.model.onDidChangeCollapseState; }
|
||||
get onDidChangeRenderNodeCount(): Event<ITreeNode<T, TFilterData>> { return this.model.onDidChangeRenderNodeCount; }
|
||||
|
||||
private _onWillRefilter = new Emitter<void>();
|
||||
private readonly _onWillRefilter = new Emitter<void>();
|
||||
readonly onWillRefilter: Event<void> = this._onWillRefilter.event;
|
||||
|
||||
get filterOnType(): boolean { return !!this._options.filterOnType; }
|
||||
@@ -1213,7 +1213,7 @@ export abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable
|
||||
get openOnSingleClick(): boolean { return typeof this._options.openOnSingleClick === 'undefined' ? true : this._options.openOnSingleClick; }
|
||||
get expandOnlyOnTwistieClick(): boolean | ((e: T) => boolean) { return typeof this._options.expandOnlyOnTwistieClick === 'undefined' ? false : this._options.expandOnlyOnTwistieClick; }
|
||||
|
||||
private _onDidUpdateOptions = new Emitter<IAbstractTreeOptions<T, TFilterData>>();
|
||||
private readonly _onDidUpdateOptions = new Emitter<IAbstractTreeOptions<T, TFilterData>>();
|
||||
readonly onDidUpdateOptions: Event<IAbstractTreeOptions<T, TFilterData>> = this._onDidUpdateOptions.event;
|
||||
|
||||
get onDidDispose(): Event<void> { return this.view.onDidDispose; }
|
||||
|
||||
@@ -62,17 +62,17 @@ export class IndexTreeModel<T extends Exclude<any, undefined>, TFilterData = voi
|
||||
private root: IIndexTreeNode<T, TFilterData>;
|
||||
private eventBufferer = new EventBufferer();
|
||||
|
||||
private _onDidChangeCollapseState = new Emitter<ICollapseStateChangeEvent<T, TFilterData>>();
|
||||
private readonly _onDidChangeCollapseState = new Emitter<ICollapseStateChangeEvent<T, TFilterData>>();
|
||||
readonly onDidChangeCollapseState: Event<ICollapseStateChangeEvent<T, TFilterData>> = this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event);
|
||||
|
||||
private _onDidChangeRenderNodeCount = new Emitter<ITreeNode<T, TFilterData>>();
|
||||
private readonly _onDidChangeRenderNodeCount = new Emitter<ITreeNode<T, TFilterData>>();
|
||||
readonly onDidChangeRenderNodeCount: Event<ITreeNode<T, TFilterData>> = this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event);
|
||||
|
||||
private collapseByDefault: boolean;
|
||||
private filter?: ITreeFilter<T, TFilterData>;
|
||||
private autoExpandSingleChildren: boolean;
|
||||
|
||||
private _onDidSplice = new Emitter<ITreeModelSpliceEvent<T, TFilterData>>();
|
||||
private readonly _onDidSplice = new Emitter<ITreeModelSpliceEvent<T, TFilterData>>();
|
||||
readonly onDidSplice = this._onDidSplice.event;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -451,7 +451,7 @@ class LeakageMonitor {
|
||||
* Sample:
|
||||
class Document {
|
||||
|
||||
private _onDidChange = new Emitter<(value:string)=>any>();
|
||||
private readonly _onDidChange = new Emitter<(value:string)=>any>();
|
||||
|
||||
public onDidChange = this._onDidChange.event;
|
||||
|
||||
@@ -808,7 +808,7 @@ export class Relay<T> implements IDisposable {
|
||||
private inputEvent: Event<T> = Event.None;
|
||||
private inputEventListener: IDisposable = Disposable.None;
|
||||
|
||||
private emitter = new Emitter<T>({
|
||||
private readonly emitter = new Emitter<T>({
|
||||
onFirstListenerDidAdd: () => {
|
||||
this.listening = true;
|
||||
this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);
|
||||
|
||||
@@ -24,11 +24,11 @@ export class Sequence<T> implements ISequence<T>, ISpliceable<T> {
|
||||
|
||||
readonly elements: T[] = [];
|
||||
|
||||
private _onDidSplice = new Emitter<ISplice<T>>();
|
||||
private readonly _onDidSplice = new Emitter<ISplice<T>>();
|
||||
readonly onDidSplice: Event<ISplice<T>> = this._onDidSplice.event;
|
||||
|
||||
splice(start: number, deleteCount: number, toInsert: T[] = []): void {
|
||||
this.elements.splice(start, deleteCount, ...toInsert);
|
||||
this._onDidSplice.fire({ start, deleteCount, toInsert });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,10 +351,10 @@ export class Protocol extends Disposable implements IMessagePassingProtocol {
|
||||
private _socketWriter: ProtocolWriter;
|
||||
private _socketReader: ProtocolReader;
|
||||
|
||||
private _onMessage = new Emitter<VSBuffer>();
|
||||
private readonly _onMessage = new Emitter<VSBuffer>();
|
||||
readonly onMessage: Event<VSBuffer> = this._onMessage.event;
|
||||
|
||||
private _onClose = new Emitter<void>();
|
||||
private readonly _onClose = new Emitter<void>();
|
||||
readonly onClose: Event<void> = this._onClose.event;
|
||||
|
||||
constructor(socket: ISocket) {
|
||||
|
||||
@@ -442,7 +442,7 @@ export class ChannelClient implements IChannelClient, IDisposable {
|
||||
private lastRequestId: number = 0;
|
||||
private protocolListener: IDisposable | null;
|
||||
|
||||
private _onDidInitialize = new Emitter<void>();
|
||||
private readonly _onDidInitialize = new Emitter<void>();
|
||||
readonly onDidInitialize = this._onDidInitialize.event;
|
||||
|
||||
constructor(private protocol: IMessagePassingProtocol) {
|
||||
@@ -660,7 +660,7 @@ export class IPCServer<TContext = string> implements IChannelServer<TContext>, I
|
||||
private channels = new Map<string, IServerChannel<TContext>>();
|
||||
private _connections = new Set<Connection<TContext>>();
|
||||
|
||||
private _onDidChangeConnections = new Emitter<Connection<TContext>>();
|
||||
private readonly _onDidChangeConnections = new Emitter<Connection<TContext>>();
|
||||
readonly onDidChangeConnections: Event<Connection<TContext>> = this._onDidChangeConnections.event;
|
||||
|
||||
get connections(): Connection<TContext>[] {
|
||||
|
||||
@@ -92,7 +92,7 @@ export class Client implements IChannelClient, IDisposable {
|
||||
private _client: IPCClient | null;
|
||||
private channels = new Map<string, IChannel>();
|
||||
|
||||
private _onDidProcessExit = new Emitter<{ code: number, signal: string }>();
|
||||
private readonly _onDidProcessExit = new Emitter<{ code: number, signal: string }>();
|
||||
readonly onDidProcessExit = this._onDidProcessExit.event;
|
||||
|
||||
constructor(private modulePath: string, private options: IIPCOptions) {
|
||||
|
||||
@@ -16,7 +16,7 @@ class QueueProtocol implements IMessagePassingProtocol {
|
||||
private buffering = true;
|
||||
private buffers: VSBuffer[] = [];
|
||||
|
||||
private _onMessage = new Emitter<VSBuffer>({
|
||||
private readonly _onMessage = new Emitter<VSBuffer>({
|
||||
onFirstListenerDidAdd: () => {
|
||||
for (const buffer of this.buffers) {
|
||||
this._onMessage.fire(buffer);
|
||||
@@ -57,7 +57,7 @@ function createProtocolPair(): [IMessagePassingProtocol, IMessagePassingProtocol
|
||||
|
||||
class TestIPCClient extends IPCClient<string> {
|
||||
|
||||
private _onDidDisconnect = new Emitter<void>();
|
||||
private readonly _onDidDisconnect = new Emitter<void>();
|
||||
readonly onDidDisconnect = this._onDidDisconnect.event;
|
||||
|
||||
constructor(protocol: IMessagePassingProtocol, id: string) {
|
||||
@@ -107,7 +107,7 @@ interface ITestService {
|
||||
|
||||
class TestService implements ITestService {
|
||||
|
||||
private _pong = new Emitter<string>();
|
||||
private readonly _pong = new Emitter<string>();
|
||||
readonly pong = this._pong.event;
|
||||
|
||||
marco(): Promise<string> {
|
||||
|
||||
@@ -20,7 +20,7 @@ export interface ITestService {
|
||||
|
||||
export class TestService implements ITestService {
|
||||
|
||||
private _onMarco = new Emitter<IMarcoPoloEvent>();
|
||||
private readonly _onMarco = new Emitter<IMarcoPoloEvent>();
|
||||
onMarco: Event<IMarcoPoloEvent> = this._onMarco.event;
|
||||
|
||||
marco(): Promise<string> {
|
||||
@@ -76,4 +76,4 @@ export class TestServiceClient implements ITestService {
|
||||
cancelMe(): Promise<boolean> {
|
||||
return this.channel.call('cancelMe');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ suite('Storage Library', () => {
|
||||
await mkdirp(storageDir);
|
||||
|
||||
class TestSQLiteStorageDatabase extends SQLiteStorageDatabase {
|
||||
private _onDidChangeItemsExternal = new Emitter<IStorageItemsChangeEvent>();
|
||||
private readonly _onDidChangeItemsExternal = new Emitter<IStorageItemsChangeEvent>();
|
||||
get onDidChangeItemsExternal(): Event<IStorageItemsChangeEvent> { return this._onDidChangeItemsExternal.event; }
|
||||
|
||||
fireDidChangeItemsExternal(event: IStorageItemsChangeEvent): void {
|
||||
|
||||
@@ -77,7 +77,7 @@ export class Tree implements _.ITree {
|
||||
readonly onDidExpandItem: Event<Model.IItemExpandEvent> = this._onDidExpandItem.event;
|
||||
private _onDidCollapseItem = new Relay<Model.IItemCollapseEvent>();
|
||||
readonly onDidCollapseItem: Event<Model.IItemCollapseEvent> = this._onDidCollapseItem.event;
|
||||
private _onDispose = new Emitter<void>();
|
||||
private readonly _onDispose = new Emitter<void>();
|
||||
readonly onDidDispose: Event<void> = this._onDispose.event;
|
||||
|
||||
constructor(container: HTMLElement, configuration: _.ITreeConfiguration, options: _.ITreeOptions = {}) {
|
||||
|
||||
@@ -259,29 +259,29 @@ export class Item {
|
||||
|
||||
private traits: { [trait: string]: boolean; };
|
||||
|
||||
private _onDidCreate = new Emitter<Item>();
|
||||
private readonly _onDidCreate = new Emitter<Item>();
|
||||
readonly onDidCreate: Event<Item> = this._onDidCreate.event;
|
||||
private _onDidReveal = new Emitter<IItemRevealEvent>();
|
||||
private readonly _onDidReveal = new Emitter<IItemRevealEvent>();
|
||||
readonly onDidReveal: Event<IItemRevealEvent> = this._onDidReveal.event;
|
||||
private _onExpand = new Emitter<IItemExpandEvent>();
|
||||
private readonly _onExpand = new Emitter<IItemExpandEvent>();
|
||||
readonly onExpand: Event<IItemExpandEvent> = this._onExpand.event;
|
||||
private _onDidExpand = new Emitter<IItemExpandEvent>();
|
||||
private readonly _onDidExpand = new Emitter<IItemExpandEvent>();
|
||||
readonly onDidExpand: Event<IItemExpandEvent> = this._onDidExpand.event;
|
||||
private _onCollapse = new Emitter<IItemCollapseEvent>();
|
||||
private readonly _onCollapse = new Emitter<IItemCollapseEvent>();
|
||||
readonly onCollapse: Event<IItemCollapseEvent> = this._onCollapse.event;
|
||||
private _onDidCollapse = new Emitter<IItemCollapseEvent>();
|
||||
private readonly _onDidCollapse = new Emitter<IItemCollapseEvent>();
|
||||
readonly onDidCollapse: Event<IItemCollapseEvent> = this._onDidCollapse.event;
|
||||
private _onDidAddTrait = new Emitter<IItemTraitEvent>();
|
||||
private readonly _onDidAddTrait = new Emitter<IItemTraitEvent>();
|
||||
readonly onDidAddTrait: Event<IItemTraitEvent> = this._onDidAddTrait.event;
|
||||
private _onDidRemoveTrait = new Emitter<IItemCollapseEvent>();
|
||||
private readonly _onDidRemoveTrait = new Emitter<IItemCollapseEvent>();
|
||||
readonly onDidRemoveTrait: Event<IItemCollapseEvent> = this._onDidRemoveTrait.event;
|
||||
private _onDidRefresh = new Emitter<Item>();
|
||||
private readonly _onDidRefresh = new Emitter<Item>();
|
||||
readonly onDidRefresh: Event<Item> = this._onDidRefresh.event;
|
||||
private _onRefreshChildren = new Emitter<IItemChildrenRefreshEvent>();
|
||||
private readonly _onRefreshChildren = new Emitter<IItemChildrenRefreshEvent>();
|
||||
readonly onRefreshChildren: Event<IItemChildrenRefreshEvent> = this._onRefreshChildren.event;
|
||||
private _onDidRefreshChildren = new Emitter<IItemChildrenRefreshEvent>();
|
||||
private readonly _onDidRefreshChildren = new Emitter<IItemChildrenRefreshEvent>();
|
||||
readonly onDidRefreshChildren: Event<IItemChildrenRefreshEvent> = this._onDidRefreshChildren.event;
|
||||
private _onDidDispose = new Emitter<Item>();
|
||||
private readonly _onDidDispose = new Emitter<Item>();
|
||||
readonly onDidDispose: Event<Item> = this._onDidDispose.event;
|
||||
|
||||
private _isDisposed: boolean;
|
||||
@@ -868,19 +868,19 @@ export class TreeModel {
|
||||
private registryDisposable: IDisposable = Disposable.None;
|
||||
private traitsToItems: ITraitMap;
|
||||
|
||||
private _onSetInput = new Emitter<IInputEvent>();
|
||||
private readonly _onSetInput = new Emitter<IInputEvent>();
|
||||
readonly onSetInput: Event<IInputEvent> = this._onSetInput.event;
|
||||
private _onDidSetInput = new Emitter<IInputEvent>();
|
||||
private readonly _onDidSetInput = new Emitter<IInputEvent>();
|
||||
readonly onDidSetInput: Event<IInputEvent> = this._onDidSetInput.event;
|
||||
private _onRefresh = new Emitter<IRefreshEvent>();
|
||||
private readonly _onRefresh = new Emitter<IRefreshEvent>();
|
||||
readonly onRefresh: Event<IRefreshEvent> = this._onRefresh.event;
|
||||
private _onDidRefresh = new Emitter<IRefreshEvent>();
|
||||
private readonly _onDidRefresh = new Emitter<IRefreshEvent>();
|
||||
readonly onDidRefresh: Event<IRefreshEvent> = this._onDidRefresh.event;
|
||||
private _onDidHighlight = new Emitter<_.IHighlightEvent>();
|
||||
private readonly _onDidHighlight = new Emitter<_.IHighlightEvent>();
|
||||
readonly onDidHighlight: Event<_.IHighlightEvent> = this._onDidHighlight.event;
|
||||
private _onDidSelect = new Emitter<_.ISelectionEvent>();
|
||||
private readonly _onDidSelect = new Emitter<_.ISelectionEvent>();
|
||||
readonly onDidSelect: Event<_.ISelectionEvent> = this._onDidSelect.event;
|
||||
private _onDidFocus = new Emitter<_.IFocusEvent>();
|
||||
private readonly _onDidFocus = new Emitter<_.IFocusEvent>();
|
||||
readonly onDidFocus: Event<_.IFocusEvent> = this._onDidFocus.event;
|
||||
|
||||
private _onDidRevealItem = new Relay<IItemRevealEvent>();
|
||||
|
||||
@@ -1081,10 +1081,10 @@ class DynamicModel implements _.IDataSource {
|
||||
private data: any;
|
||||
public promiseFactory: { (): Promise<any>; } | null;
|
||||
|
||||
private _onGetChildren = new Emitter<any>();
|
||||
private readonly _onGetChildren = new Emitter<any>();
|
||||
readonly onGetChildren: Event<any> = this._onGetChildren.event;
|
||||
|
||||
private _onDidGetChildren = new Emitter<any>();
|
||||
private readonly _onDidGetChildren = new Emitter<any>();
|
||||
readonly onDidGetChildren: Event<any> = this._onDidGetChildren.event;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { IView } from 'vs/base/browser/ui/grid/grid';
|
||||
|
||||
export class TestView implements IView {
|
||||
|
||||
private _onDidChange = new Emitter<{ width: number; height: number; } | undefined>();
|
||||
private readonly _onDidChange = new Emitter<{ width: number; height: number; } | undefined>();
|
||||
readonly onDidChange = this._onDidChange.event;
|
||||
|
||||
get minimumWidth(): number { return this._minimumWidth; }
|
||||
@@ -28,7 +28,7 @@ export class TestView implements IView {
|
||||
private _element: HTMLElement = document.createElement('div');
|
||||
get element(): HTMLElement { this._onDidGetElement.fire(); return this._element; }
|
||||
|
||||
private _onDidGetElement = new Emitter<void>();
|
||||
private readonly _onDidGetElement = new Emitter<void>();
|
||||
readonly onDidGetElement = this._onDidGetElement.event;
|
||||
|
||||
private _width = 0;
|
||||
@@ -39,10 +39,10 @@ export class TestView implements IView {
|
||||
|
||||
get size(): [number, number] { return [this.width, this.height]; }
|
||||
|
||||
private _onDidLayout = new Emitter<{ width: number; height: number; }>();
|
||||
private readonly _onDidLayout = new Emitter<{ width: number; height: number; }>();
|
||||
readonly onDidLayout: Event<{ width: number; height: number; }> = this._onDidLayout.event;
|
||||
|
||||
private _onDidFocus = new Emitter<void>();
|
||||
private readonly _onDidFocus = new Emitter<void>();
|
||||
readonly onDidFocus: Event<void> = this._onDidFocus.event;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Sash, SashState } from 'vs/base/browser/ui/sash/sash';
|
||||
|
||||
class TestView implements IView {
|
||||
|
||||
private _onDidChange = new Emitter<number | undefined>();
|
||||
private readonly _onDidChange = new Emitter<number | undefined>();
|
||||
readonly onDidChange = this._onDidChange.event;
|
||||
|
||||
get minimumSize(): number { return this._minimumSize; }
|
||||
@@ -22,17 +22,17 @@ class TestView implements IView {
|
||||
private _element: HTMLElement = document.createElement('div');
|
||||
get element(): HTMLElement { this._onDidGetElement.fire(); return this._element; }
|
||||
|
||||
private _onDidGetElement = new Emitter<void>();
|
||||
private readonly _onDidGetElement = new Emitter<void>();
|
||||
readonly onDidGetElement = this._onDidGetElement.event;
|
||||
|
||||
private _size = 0;
|
||||
get size(): number { return this._size; }
|
||||
private _orthogonalSize: number | undefined = 0;
|
||||
get orthogonalSize(): number | undefined { return this._orthogonalSize; }
|
||||
private _onDidLayout = new Emitter<{ size: number; orthogonalSize: number | undefined }>();
|
||||
private readonly _onDidLayout = new Emitter<{ size: number; orthogonalSize: number | undefined }>();
|
||||
readonly onDidLayout = this._onDidLayout.event;
|
||||
|
||||
private _onDidFocus = new Emitter<void>();
|
||||
private readonly _onDidFocus = new Emitter<void>();
|
||||
readonly onDidFocus = this._onDidFocus.event;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Samples {
|
||||
|
||||
export class Document3 {
|
||||
|
||||
private _onDidChange = new Emitter<string>();
|
||||
private readonly _onDidChange = new Emitter<string>();
|
||||
|
||||
onDidChange: Event<string> = this._onDidChange.event;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ export class MinimapTokensColorTracker {
|
||||
private _colors!: RGBA8[];
|
||||
private _backgroundIsLight!: boolean;
|
||||
|
||||
private _onDidChange = new Emitter<void>();
|
||||
private readonly _onDidChange = new Emitter<void>();
|
||||
public readonly onDidChange: Event<void> = this._onDidChange.event;
|
||||
|
||||
private constructor() {
|
||||
|
||||
@@ -41,13 +41,13 @@ export class ColorPickerModel {
|
||||
this._onDidChangePresentation.fire(this.presentation);
|
||||
}
|
||||
|
||||
private _onColorFlushed = new Emitter<Color>();
|
||||
private readonly _onColorFlushed = new Emitter<Color>();
|
||||
readonly onColorFlushed: Event<Color> = this._onColorFlushed.event;
|
||||
|
||||
private _onDidChangeColor = new Emitter<Color>();
|
||||
private readonly _onDidChangeColor = new Emitter<Color>();
|
||||
readonly onDidChangeColor: Event<Color> = this._onDidChangeColor.event;
|
||||
|
||||
private _onDidChangePresentation = new Emitter<IColorPresentation>();
|
||||
private readonly _onDidChangePresentation = new Emitter<IColorPresentation>();
|
||||
readonly onDidChangePresentation: Event<IColorPresentation> = this._onDidChangePresentation.event;
|
||||
|
||||
constructor(color: Color, availableColorPresentations: IColorPresentation[], private presentationIndex: number) {
|
||||
|
||||
@@ -127,10 +127,10 @@ class SaturationBox extends Disposable {
|
||||
private height!: number;
|
||||
|
||||
private monitor: GlobalMouseMoveMonitor<IStandardMouseMoveEventData> | null;
|
||||
private _onDidChange = new Emitter<{ s: number, v: number }>();
|
||||
private readonly _onDidChange = new Emitter<{ s: number, v: number }>();
|
||||
readonly onDidChange: Event<{ s: number, v: number }> = this._onDidChange.event;
|
||||
|
||||
private _onColorFlushed = new Emitter<void>();
|
||||
private readonly _onColorFlushed = new Emitter<void>();
|
||||
readonly onColorFlushed: Event<void> = this._onColorFlushed.event;
|
||||
|
||||
constructor(container: HTMLElement, private readonly model: ColorPickerModel, private pixelRatio: number) {
|
||||
@@ -237,10 +237,10 @@ abstract class Strip extends Disposable {
|
||||
protected slider: HTMLElement;
|
||||
private height!: number;
|
||||
|
||||
private _onDidChange = new Emitter<number>();
|
||||
private readonly _onDidChange = new Emitter<number>();
|
||||
readonly onDidChange: Event<number> = this._onDidChange.event;
|
||||
|
||||
private _onColorFlushed = new Emitter<void>();
|
||||
private readonly _onColorFlushed = new Emitter<void>();
|
||||
readonly onColorFlushed: Event<void> = this._onColorFlushed.event;
|
||||
|
||||
constructor(container: HTMLElement, protected model: ColorPickerModel) {
|
||||
|
||||
@@ -28,7 +28,7 @@ export class FoldingModel {
|
||||
private _editorDecorationIds: string[];
|
||||
private _isInitialized: boolean;
|
||||
|
||||
private _updateEventEmitter = new Emitter<FoldingModelChangeEvent>();
|
||||
private readonly _updateEventEmitter = new Emitter<FoldingModelChangeEvent>();
|
||||
public readonly onDidChange: Event<FoldingModelChangeEvent> = this._updateEventEmitter.event;
|
||||
|
||||
public get regions(): FoldingRegions { return this._regions; }
|
||||
|
||||
@@ -14,7 +14,7 @@ export class HiddenRangeModel {
|
||||
private readonly _foldingModel: FoldingModel;
|
||||
private _hiddenRanges: IRange[];
|
||||
private _foldingModelListener: IDisposable | null;
|
||||
private _updateEventEmitter = new Emitter<IRange[]>();
|
||||
private readonly _updateEventEmitter = new Emitter<IRange[]>();
|
||||
|
||||
public get onDidChange(): Event<IRange[]> { return this._updateEventEmitter.event; }
|
||||
public get hiddenRanges() { return this._hiddenRanges; }
|
||||
@@ -154,4 +154,4 @@ function findRange(ranges: IRange[], line: number): IRange | null {
|
||||
return ranges[i];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ export class MarkerNavigationWidget extends PeekViewWidget {
|
||||
private readonly _callOnDispose = new DisposableStore();
|
||||
private _severity: MarkerSeverity;
|
||||
private _backgroundColor?: Color;
|
||||
private _onDidSelectRelatedInformation = new Emitter<IRelatedInformation>();
|
||||
private readonly _onDidSelectRelatedInformation = new Emitter<IRelatedInformation>();
|
||||
private _heightInPixel!: number;
|
||||
|
||||
readonly onDidSelectRelatedInformation: Event<IRelatedInformation> = this._onDidSelectRelatedInformation.event;
|
||||
|
||||
@@ -83,7 +83,7 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private _onDidClose = new Emitter<PeekViewWidget>();
|
||||
private readonly _onDidClose = new Emitter<PeekViewWidget>();
|
||||
|
||||
protected _headElement?: HTMLDivElement;
|
||||
protected _primaryHeading?: HTMLElement;
|
||||
|
||||
@@ -196,7 +196,7 @@ export class ReferenceWidget extends PeekViewWidget {
|
||||
|
||||
private readonly _disposeOnNewModel = new DisposableStore();
|
||||
private readonly _callOnDispose = new DisposableStore();
|
||||
private _onDidSelectReference = new Emitter<SelectionEvent>();
|
||||
private readonly _onDidSelectReference = new Emitter<SelectionEvent>();
|
||||
|
||||
private _tree!: WorkbenchAsyncDataTree<ReferencesModel | FileReferences, TreeElement, FuzzyScore>;
|
||||
private _treeContainer!: HTMLElement;
|
||||
|
||||
@@ -450,10 +450,10 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
|
||||
private readonly showTimeout = new TimeoutTimer();
|
||||
private readonly toDispose = new DisposableStore();
|
||||
|
||||
private onDidSelectEmitter = new Emitter<ISelectedSuggestion>();
|
||||
private onDidFocusEmitter = new Emitter<ISelectedSuggestion>();
|
||||
private onDidHideEmitter = new Emitter<this>();
|
||||
private onDidShowEmitter = new Emitter<this>();
|
||||
private readonly onDidSelectEmitter = new Emitter<ISelectedSuggestion>();
|
||||
private readonly onDidFocusEmitter = new Emitter<ISelectedSuggestion>();
|
||||
private readonly onDidHideEmitter = new Emitter<this>();
|
||||
private readonly onDidShowEmitter = new Emitter<this>();
|
||||
|
||||
readonly onDidSelect: Event<ISelectedSuggestion> = this.onDidSelectEmitter.event;
|
||||
readonly onDidFocus: Event<ISelectedSuggestion> = this.onDidFocusEmitter.event;
|
||||
|
||||
@@ -420,7 +420,7 @@ export class SimpleConfigurationService implements IConfigurationService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>();
|
||||
private readonly _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>();
|
||||
public readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event;
|
||||
|
||||
private readonly _configuration: Configuration;
|
||||
|
||||
@@ -15,11 +15,11 @@ export class ExtensionHostDebugBroadcastChannel<TContext> implements IServerChan
|
||||
|
||||
static readonly ChannelName = 'extensionhostdebugservice';
|
||||
|
||||
private _onCloseEmitter = new Emitter<ICloseSessionEvent>();
|
||||
private _onReloadEmitter = new Emitter<IReloadSessionEvent>();
|
||||
private _onTerminateEmitter = new Emitter<ITerminateSessionEvent>();
|
||||
private _onLogToEmitter = new Emitter<ILogToSessionEvent>();
|
||||
private _onAttachEmitter = new Emitter<IAttachSessionEvent>();
|
||||
private readonly _onCloseEmitter = new Emitter<ICloseSessionEvent>();
|
||||
private readonly _onReloadEmitter = new Emitter<IReloadSessionEvent>();
|
||||
private readonly _onTerminateEmitter = new Emitter<ITerminateSessionEvent>();
|
||||
private readonly _onLogToEmitter = new Emitter<ILogToSessionEvent>();
|
||||
private readonly _onAttachEmitter = new Emitter<IAttachSessionEvent>();
|
||||
|
||||
call(ctx: TContext, command: string, arg?: any): Promise<any> {
|
||||
switch (command) {
|
||||
|
||||
@@ -30,7 +30,7 @@ export class Driver implements IDriver, IWindowDriverRegistry {
|
||||
|
||||
private registeredWindowIds = new Set<number>();
|
||||
private reloadingWindowIds = new Set<number>();
|
||||
private onDidReloadingChange = new Emitter<void>();
|
||||
private readonly onDidReloadingChange = new Emitter<void>();
|
||||
|
||||
constructor(
|
||||
private windowServer: IPCServer,
|
||||
|
||||
@@ -39,10 +39,10 @@ export class NsfwWatcherService implements IWatcherService {
|
||||
private _verboseLogging: boolean | undefined;
|
||||
private enospcErrorLogged: boolean | undefined;
|
||||
|
||||
private _onWatchEvent = new Emitter<IDiskFileChange[]>();
|
||||
private readonly _onWatchEvent = new Emitter<IDiskFileChange[]>();
|
||||
readonly onWatchEvent = this._onWatchEvent.event;
|
||||
|
||||
private _onLogMessage = new Emitter<ILogMessage>();
|
||||
private readonly _onLogMessage = new Emitter<ILogMessage>();
|
||||
readonly onLogMessage: Event<ILogMessage> = this._onLogMessage.event;
|
||||
|
||||
watch(options: IWatcherOptions): Event<IDiskFileChange[]> {
|
||||
|
||||
@@ -43,10 +43,10 @@ export class ChokidarWatcherService implements IWatcherService {
|
||||
private spamWarningLogged: boolean | undefined;
|
||||
private enospcErrorLogged: boolean | undefined;
|
||||
|
||||
private _onWatchEvent = new Emitter<IDiskFileChange[]>();
|
||||
private readonly _onWatchEvent = new Emitter<IDiskFileChange[]>();
|
||||
readonly onWatchEvent = this._onWatchEvent.event;
|
||||
|
||||
private _onLogMessage = new Emitter<ILogMessage>();
|
||||
private readonly _onLogMessage = new Emitter<ILogMessage>();
|
||||
readonly onLogMessage: Event<ILogMessage> = this._onLogMessage.event;
|
||||
|
||||
public watch(options: IWatcherOptions): Event<IDiskFileChange[]> {
|
||||
|
||||
@@ -59,7 +59,7 @@ export class HistoryMainService implements IHistoryMainService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onRecentlyOpenedChange = new Emitter<void>();
|
||||
private readonly _onRecentlyOpenedChange = new Emitter<void>();
|
||||
readonly onRecentlyOpenedChange: CommonEvent<void> = this._onRecentlyOpenedChange.event;
|
||||
|
||||
private macOSRecentDocumentsUpdater: ThrottledDelayer<void>;
|
||||
|
||||
@@ -123,7 +123,7 @@ export class MarkerService implements IMarkerService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onMarkerChanged = new Emitter<URI[]>();
|
||||
private readonly _onMarkerChanged = new Emitter<URI[]>();
|
||||
private _onMarkerChangedEvent: Event<URI[]> = Event.debounce(this._onMarkerChanged.event, MarkerService._debouncer, 0);
|
||||
private _byResource: MapMap<IMarker[]> = Object.create(null);
|
||||
private _byOwner: MapMap<IMarker[]> = Object.create(null);
|
||||
|
||||
@@ -12,7 +12,7 @@ export class UpdateService implements IUpdateService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onStateChange = new Emitter<State>();
|
||||
private readonly _onStateChange = new Emitter<State>();
|
||||
readonly onStateChange: Event<State> = this._onStateChange.event;
|
||||
|
||||
private _state: State = State.Uninitialized;
|
||||
|
||||
@@ -30,7 +30,7 @@ export abstract class AbstractUpdateService implements IUpdateService {
|
||||
|
||||
private _state: State = State.Uninitialized;
|
||||
|
||||
private _onStateChange = new Emitter<State>();
|
||||
private readonly _onStateChange = new Emitter<State>();
|
||||
readonly onStateChange: Event<State> = this._onStateChange.event;
|
||||
|
||||
get state(): State {
|
||||
|
||||
@@ -21,7 +21,7 @@ abstract class AbstractUpdateService2 implements IUpdateService {
|
||||
|
||||
private _state: State = State.Uninitialized;
|
||||
|
||||
private _onStateChange = new Emitter<State>();
|
||||
private readonly _onStateChange = new Emitter<State>();
|
||||
readonly onStateChange: Event<State> = this._onStateChange.event;
|
||||
|
||||
get state(): State {
|
||||
|
||||
@@ -33,7 +33,7 @@ export class MainThreadCommentThread implements modes.CommentThread {
|
||||
this._onDidChangeInput.fire(value);
|
||||
}
|
||||
|
||||
private _onDidChangeInput = new Emitter<modes.CommentInput | undefined>();
|
||||
private readonly _onDidChangeInput = new Emitter<modes.CommentInput | undefined>();
|
||||
get onDidChangeInput(): Event<modes.CommentInput | undefined> { return this._onDidChangeInput.event; }
|
||||
|
||||
private _label: string | undefined;
|
||||
@@ -57,7 +57,7 @@ export class MainThreadCommentThread implements modes.CommentThread {
|
||||
this._contextValue = context;
|
||||
}
|
||||
|
||||
private _onDidChangeLabel = new Emitter<string | undefined>();
|
||||
private readonly _onDidChangeLabel = new Emitter<string | undefined>();
|
||||
readonly onDidChangeLabel: Event<string | undefined> = this._onDidChangeLabel.event;
|
||||
|
||||
private _comments: modes.Comment[] | undefined;
|
||||
@@ -71,7 +71,7 @@ export class MainThreadCommentThread implements modes.CommentThread {
|
||||
this._onDidChangeComments.fire(this._comments);
|
||||
}
|
||||
|
||||
private _onDidChangeComments = new Emitter<modes.Comment[] | undefined>();
|
||||
private readonly _onDidChangeComments = new Emitter<modes.Comment[] | undefined>();
|
||||
get onDidChangeComments(): Event<modes.Comment[] | undefined> { return this._onDidChangeComments.event; }
|
||||
|
||||
set range(range: IRange) {
|
||||
@@ -83,7 +83,7 @@ export class MainThreadCommentThread implements modes.CommentThread {
|
||||
return this._range;
|
||||
}
|
||||
|
||||
private _onDidChangeRange = new Emitter<IRange>();
|
||||
private readonly _onDidChangeRange = new Emitter<IRange>();
|
||||
public onDidChangeRange = this._onDidChangeRange.event;
|
||||
|
||||
private _collapsibleState: modes.CommentThreadCollapsibleState | undefined;
|
||||
@@ -96,7 +96,7 @@ export class MainThreadCommentThread implements modes.CommentThread {
|
||||
this._onDidChangeCollasibleState.fire(this._collapsibleState);
|
||||
}
|
||||
|
||||
private _onDidChangeCollasibleState = new Emitter<modes.CommentThreadCollapsibleState | undefined>();
|
||||
private readonly _onDidChangeCollasibleState = new Emitter<modes.CommentThreadCollapsibleState | undefined>();
|
||||
public onDidChangeCollasibleState = this._onDidChangeCollasibleState.event;
|
||||
|
||||
private _isDisposed: boolean;
|
||||
|
||||
@@ -308,10 +308,10 @@ export class MainThreadDocumentsAndEditors {
|
||||
private readonly _proxy: ExtHostDocumentsAndEditorsShape;
|
||||
private readonly _textEditors = new Map<string, MainThreadTextEditor>();
|
||||
|
||||
private _onTextEditorAdd = new Emitter<MainThreadTextEditor[]>();
|
||||
private _onTextEditorRemove = new Emitter<string[]>();
|
||||
private _onDocumentAdd = new Emitter<ITextModel[]>();
|
||||
private _onDocumentRemove = new Emitter<URI[]>();
|
||||
private readonly _onTextEditorAdd = new Emitter<MainThreadTextEditor[]>();
|
||||
private readonly _onTextEditorRemove = new Emitter<string[]>();
|
||||
private readonly _onDocumentAdd = new Emitter<ITextModel[]>();
|
||||
private readonly _onDocumentRemove = new Emitter<URI[]>();
|
||||
|
||||
readonly onTextEditorAdd: Event<MainThreadTextEditor[]> = this._onTextEditorAdd.event;
|
||||
readonly onTextEditorRemove: Event<string[]> = this._onTextEditorRemove.event;
|
||||
|
||||
@@ -18,12 +18,12 @@ class MainThreadSCMResourceGroup implements ISCMResourceGroup {
|
||||
|
||||
readonly elements: ISCMResource[] = [];
|
||||
|
||||
private _onDidSplice = new Emitter<ISplice<ISCMResource>>();
|
||||
private readonly _onDidSplice = new Emitter<ISplice<ISCMResource>>();
|
||||
readonly onDidSplice = this._onDidSplice.event;
|
||||
|
||||
get hideWhenEmpty(): boolean { return !!this.features.hideWhenEmpty; }
|
||||
|
||||
private _onDidChange = new Emitter<void>();
|
||||
private readonly _onDidChange = new Emitter<void>();
|
||||
readonly onDidChange: Event<void> = this._onDidChange.event;
|
||||
|
||||
constructor(
|
||||
@@ -104,7 +104,7 @@ class MainThreadSCMProvider implements ISCMProvider {
|
||||
// // .filter(g => g.resources.elements.length > 0 || !g.features.hideWhenEmpty);
|
||||
// }
|
||||
|
||||
private _onDidChangeResources = new Emitter<void>();
|
||||
private readonly _onDidChangeResources = new Emitter<void>();
|
||||
readonly onDidChangeResources: Event<void> = this._onDidChangeResources.event;
|
||||
|
||||
private features: SCMProviderFeatures = {};
|
||||
@@ -119,13 +119,13 @@ class MainThreadSCMProvider implements ISCMProvider {
|
||||
get statusBarCommands(): Command[] | undefined { return this.features.statusBarCommands; }
|
||||
get count(): number | undefined { return this.features.count; }
|
||||
|
||||
private _onDidChangeCommitTemplate = new Emitter<string>();
|
||||
private readonly _onDidChangeCommitTemplate = new Emitter<string>();
|
||||
readonly onDidChangeCommitTemplate: Event<string> = this._onDidChangeCommitTemplate.event;
|
||||
|
||||
private _onDidChangeStatusBarCommands = new Emitter<Command[]>();
|
||||
private readonly _onDidChangeStatusBarCommands = new Emitter<Command[]>();
|
||||
get onDidChangeStatusBarCommands(): Event<Command[]> { return this._onDidChangeStatusBarCommands.event; }
|
||||
|
||||
private _onDidChange = new Emitter<void>();
|
||||
private readonly _onDidChange = new Emitter<void>();
|
||||
readonly onDidChange: Event<void> = this._onDidChange.event;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -239,7 +239,7 @@ export class ExtHostCommentThread implements vscode.CommentThread {
|
||||
return this._uri;
|
||||
}
|
||||
|
||||
private _onDidUpdateCommentThread = new Emitter<void>();
|
||||
private readonly _onDidUpdateCommentThread = new Emitter<void>();
|
||||
readonly onDidUpdateCommentThread = this._onDidUpdateCommentThread.event;
|
||||
|
||||
set range(range: vscode.Range) {
|
||||
|
||||
@@ -15,10 +15,10 @@ import * as vscode from 'vscode';
|
||||
|
||||
export class ExtHostDocuments implements ExtHostDocumentsShape {
|
||||
|
||||
private _onDidAddDocument = new Emitter<vscode.TextDocument>();
|
||||
private _onDidRemoveDocument = new Emitter<vscode.TextDocument>();
|
||||
private _onDidChangeDocument = new Emitter<vscode.TextDocumentChangeEvent>();
|
||||
private _onDidSaveDocument = new Emitter<vscode.TextDocument>();
|
||||
private readonly _onDidAddDocument = new Emitter<vscode.TextDocument>();
|
||||
private readonly _onDidRemoveDocument = new Emitter<vscode.TextDocument>();
|
||||
private readonly _onDidChangeDocument = new Emitter<vscode.TextDocumentChangeEvent>();
|
||||
private readonly _onDidSaveDocument = new Emitter<vscode.TextDocument>();
|
||||
|
||||
readonly onDidAddDocument: Event<vscode.TextDocument> = this._onDidAddDocument.event;
|
||||
readonly onDidRemoveDocument: Event<vscode.TextDocument> = this._onDidRemoveDocument.event;
|
||||
|
||||
@@ -16,9 +16,9 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'
|
||||
|
||||
class FileSystemWatcher implements vscode.FileSystemWatcher {
|
||||
|
||||
private _onDidCreate = new Emitter<vscode.Uri>();
|
||||
private _onDidChange = new Emitter<vscode.Uri>();
|
||||
private _onDidDelete = new Emitter<vscode.Uri>();
|
||||
private readonly _onDidCreate = new Emitter<vscode.Uri>();
|
||||
private readonly _onDidChange = new Emitter<vscode.Uri>();
|
||||
private readonly _onDidDelete = new Emitter<vscode.Uri>();
|
||||
private _disposable: Disposable;
|
||||
private _config: number;
|
||||
|
||||
|
||||
@@ -246,10 +246,10 @@ class ExtHostQuickInput implements QuickInput {
|
||||
private _placeholder: string;
|
||||
private _buttons: QuickInputButton[] = [];
|
||||
private _handlesToButtons = new Map<number, QuickInputButton>();
|
||||
private _onDidAcceptEmitter = new Emitter<void>();
|
||||
private _onDidChangeValueEmitter = new Emitter<string>();
|
||||
private _onDidTriggerButtonEmitter = new Emitter<QuickInputButton>();
|
||||
private _onDidHideEmitter = new Emitter<void>();
|
||||
private readonly _onDidAcceptEmitter = new Emitter<void>();
|
||||
private readonly _onDidChangeValueEmitter = new Emitter<string>();
|
||||
private readonly _onDidTriggerButtonEmitter = new Emitter<QuickInputButton>();
|
||||
private readonly _onDidHideEmitter = new Emitter<void>();
|
||||
private _updateTimeout: any;
|
||||
private _pendingUpdate: TransferQuickInput = { id: this._id };
|
||||
|
||||
@@ -486,9 +486,9 @@ class ExtHostQuickPick<T extends QuickPickItem> extends ExtHostQuickInput implem
|
||||
private _matchOnDescription = true;
|
||||
private _matchOnDetail = true;
|
||||
private _activeItems: T[] = [];
|
||||
private _onDidChangeActiveEmitter = new Emitter<T[]>();
|
||||
private readonly _onDidChangeActiveEmitter = new Emitter<T[]>();
|
||||
private _selectedItems: T[] = [];
|
||||
private _onDidChangeSelectionEmitter = new Emitter<T[]>();
|
||||
private readonly _onDidChangeSelectionEmitter = new Emitter<T[]>();
|
||||
|
||||
constructor(proxy: MainThreadQuickOpenShape, extensionId: ExtensionIdentifier, enableProposedApi: boolean, onDispose: () => void) {
|
||||
super(proxy, extensionId, onDispose);
|
||||
|
||||
@@ -157,7 +157,7 @@ export class ExtHostSCMInputBox implements vscode.SourceControlInputBox {
|
||||
this.updateValue(value);
|
||||
}
|
||||
|
||||
private _onDidChange = new Emitter<string>();
|
||||
private readonly _onDidChange = new Emitter<string>();
|
||||
|
||||
get onDidChange(): Event<string> {
|
||||
return this._onDidChange.event;
|
||||
@@ -233,9 +233,9 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG
|
||||
private _resourceStatesMap: Map<ResourceStateHandle, vscode.SourceControlResourceState> = new Map<ResourceStateHandle, vscode.SourceControlResourceState>();
|
||||
private _resourceStatesCommandsMap: Map<ResourceStateHandle, vscode.Command> = new Map<ResourceStateHandle, vscode.Command>();
|
||||
|
||||
private _onDidUpdateResourceStates = new Emitter<void>();
|
||||
private readonly _onDidUpdateResourceStates = new Emitter<void>();
|
||||
readonly onDidUpdateResourceStates = this._onDidUpdateResourceStates.event;
|
||||
private _onDidDispose = new Emitter<void>();
|
||||
private readonly _onDidDispose = new Emitter<void>();
|
||||
readonly onDidDispose = this._onDidDispose.event;
|
||||
|
||||
private _handlesSnapshot: number[] = [];
|
||||
@@ -451,7 +451,7 @@ class ExtHostSourceControl implements vscode.SourceControl {
|
||||
return this._selected;
|
||||
}
|
||||
|
||||
private _onDidChangeSelection = new Emitter<boolean>();
|
||||
private readonly _onDidChangeSelection = new Emitter<boolean>();
|
||||
readonly onDidChangeSelection = this._onDidChangeSelection.event;
|
||||
|
||||
private handle: number = ExtHostSourceControl._handlePool++;
|
||||
@@ -535,7 +535,7 @@ export class ExtHostSCM implements ExtHostSCMShape {
|
||||
private _sourceControls: Map<ProviderHandle, ExtHostSourceControl> = new Map<ProviderHandle, ExtHostSourceControl>();
|
||||
private _sourceControlsByExtension: Map<string, ExtHostSourceControl[]> = new Map<string, ExtHostSourceControl[]>();
|
||||
|
||||
private _onDidChangeActiveProvider = new Emitter<vscode.SourceControl>();
|
||||
private readonly _onDidChangeActiveProvider = new Emitter<vscode.SourceControl>();
|
||||
get onDidChangeActiveProvider(): Event<vscode.SourceControl> { return this._onDidChangeActiveProvider.event; }
|
||||
|
||||
private _selectedSourceControlHandles = new Set<number>();
|
||||
|
||||
@@ -20,7 +20,7 @@ export class ExtHostStorage implements ExtHostStorageShape {
|
||||
|
||||
private _proxy: MainThreadStorageShape;
|
||||
|
||||
private _onDidChangeStorage = new Emitter<IStorageChangeEvent>();
|
||||
private readonly _onDidChangeStorage = new Emitter<IStorageChangeEvent>();
|
||||
readonly onDidChangeStorage = this._onDidChangeStorage.event;
|
||||
|
||||
constructor(mainContext: IExtHostRpcService) {
|
||||
|
||||
@@ -18,7 +18,7 @@ export class ExtHostWindow implements ExtHostWindowShape {
|
||||
|
||||
private _proxy: MainThreadWindowShape;
|
||||
|
||||
private _onDidChangeWindowState = new Emitter<WindowState>();
|
||||
private readonly _onDidChangeWindowState = new Emitter<WindowState>();
|
||||
readonly onDidChangeWindowState: Event<WindowState> = this._onDidChangeWindowState.event;
|
||||
|
||||
private _state = ExtHostWindow.InitialState;
|
||||
|
||||
@@ -51,10 +51,10 @@ export interface ICompositeBar {
|
||||
|
||||
export class ActivityAction extends Action {
|
||||
|
||||
private _onDidChangeActivity = new Emitter<this>();
|
||||
private readonly _onDidChangeActivity = new Emitter<this>();
|
||||
readonly onDidChangeActivity: Event<this> = this._onDidChangeActivity.event;
|
||||
|
||||
private _onDidChangeBadge = new Emitter<this>();
|
||||
private readonly _onDidChangeBadge = new Emitter<this>();
|
||||
readonly onDidChangeBadge: Event<this> = this._onDidChangeBadge.event;
|
||||
|
||||
private badge?: IBadge;
|
||||
|
||||
@@ -45,7 +45,7 @@ export class EditorBreadcrumbsModel {
|
||||
private _outlineElements: Array<OutlineModel | OutlineGroup | OutlineElement> = [];
|
||||
private _outlineDisposables = new DisposableStore();
|
||||
|
||||
private _onDidUpdate = new Emitter<this>();
|
||||
private readonly _onDidUpdate = new Emitter<this>();
|
||||
readonly onDidUpdate: Event<this> = this._onDidUpdate.event;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -50,7 +50,7 @@ class ListElement implements IListElement {
|
||||
saneDescription?: string;
|
||||
saneDetail?: string;
|
||||
hidden = false;
|
||||
private _onChecked = new Emitter<boolean>();
|
||||
private readonly _onChecked = new Emitter<boolean>();
|
||||
onChecked = this._onChecked.event;
|
||||
_checked?: boolean;
|
||||
get checked() {
|
||||
@@ -222,17 +222,17 @@ export class QuickInputList {
|
||||
matchOnDescription = false;
|
||||
matchOnDetail = false;
|
||||
matchOnLabel = true;
|
||||
private _onChangedAllVisibleChecked = new Emitter<boolean>();
|
||||
private readonly _onChangedAllVisibleChecked = new Emitter<boolean>();
|
||||
onChangedAllVisibleChecked: Event<boolean> = this._onChangedAllVisibleChecked.event;
|
||||
private _onChangedCheckedCount = new Emitter<number>();
|
||||
private readonly _onChangedCheckedCount = new Emitter<number>();
|
||||
onChangedCheckedCount: Event<number> = this._onChangedCheckedCount.event;
|
||||
private _onChangedVisibleCount = new Emitter<number>();
|
||||
private readonly _onChangedVisibleCount = new Emitter<number>();
|
||||
onChangedVisibleCount: Event<number> = this._onChangedVisibleCount.event;
|
||||
private _onChangedCheckedElements = new Emitter<IQuickPickItem[]>();
|
||||
private readonly _onChangedCheckedElements = new Emitter<IQuickPickItem[]>();
|
||||
onChangedCheckedElements: Event<IQuickPickItem[]> = this._onChangedCheckedElements.event;
|
||||
private _onButtonTriggered = new Emitter<IQuickPickItemButtonEvent<IQuickPickItem>>();
|
||||
private readonly _onButtonTriggered = new Emitter<IQuickPickItemButtonEvent<IQuickPickItem>>();
|
||||
onButtonTriggered = this._onButtonTriggered.event;
|
||||
private _onLeave = new Emitter<void>();
|
||||
private readonly _onLeave = new Emitter<void>();
|
||||
onLeave: Event<void> = this._onLeave.event;
|
||||
private _fireCheckedEvents = true;
|
||||
private elementDisposables: IDisposable[] = [];
|
||||
|
||||
+3
-3
@@ -94,13 +94,13 @@ export function attachSuggestEnabledInputBoxStyler(widget: IThemable, themeServi
|
||||
|
||||
export class SuggestEnabledInput extends Widget implements IThemable {
|
||||
|
||||
private _onShouldFocusResults = new Emitter<void>();
|
||||
private readonly _onShouldFocusResults = new Emitter<void>();
|
||||
readonly onShouldFocusResults: Event<void> = this._onShouldFocusResults.event;
|
||||
|
||||
private _onEnter = new Emitter<void>();
|
||||
private readonly _onEnter = new Emitter<void>();
|
||||
readonly onEnter: Event<void> = this._onEnter.event;
|
||||
|
||||
private _onInputDidChange = new Emitter<string | undefined>();
|
||||
private readonly _onInputDidChange = new Emitter<string | undefined>();
|
||||
readonly onInputDidChange: Event<string | undefined> = this._onInputDidChange.event;
|
||||
|
||||
private readonly inputWidget: CodeEditorWidget;
|
||||
|
||||
@@ -57,7 +57,7 @@ export class CommentNode extends Disposable {
|
||||
protected toolbar: ToolBar | undefined;
|
||||
private _commentFormActions: CommentFormActions | null = null;
|
||||
|
||||
private _onDidDelete = new Emitter<CommentNode>();
|
||||
private readonly _onDidDelete = new Emitter<CommentNode>();
|
||||
|
||||
public get domNode(): HTMLElement {
|
||||
return this._domNode;
|
||||
|
||||
@@ -65,8 +65,8 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
|
||||
private _commentForm: HTMLElement;
|
||||
private _reviewThreadReplyButton: HTMLElement;
|
||||
private _resizeObserver: any;
|
||||
private _onDidClose = new Emitter<ReviewZoneWidget | undefined>();
|
||||
private _onDidCreateThread = new Emitter<ReviewZoneWidget>();
|
||||
private readonly _onDidClose = new Emitter<ReviewZoneWidget | undefined>();
|
||||
private readonly _onDidCreateThread = new Emitter<ReviewZoneWidget>();
|
||||
private _isExpanded?: boolean;
|
||||
private _collapseAction: Action;
|
||||
private _commentGlyph?: CommentGlyphWidget;
|
||||
|
||||
@@ -50,7 +50,7 @@ export class ConfigurationManager implements IConfigurationManager {
|
||||
private selectedName: string | undefined;
|
||||
private selectedLaunch: ILaunch | undefined;
|
||||
private toDispose: IDisposable[];
|
||||
private _onDidSelectConfigurationName = new Emitter<void>();
|
||||
private readonly _onDidSelectConfigurationName = new Emitter<void>();
|
||||
private configProviders: IDebugConfigurationProvider[];
|
||||
private adapterDescriptorFactories: IDebugAdapterDescriptorFactory[];
|
||||
private debugAdapterFactories = new Map<string, IDebugAdapterFactory>();
|
||||
|
||||
@@ -15,7 +15,7 @@ import { explorerRootErrorEmitter } from 'vs/workbench/contrib/files/browser/vie
|
||||
|
||||
export class ExplorerDecorationsProvider implements IDecorationsProvider {
|
||||
readonly label: string = localize('label', "Explorer");
|
||||
private _onDidChange = new Emitter<URI[]>();
|
||||
private readonly _onDidChange = new Emitter<URI[]>();
|
||||
private readonly toDispose = new DisposableStore();
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -21,7 +21,7 @@ export class ExplorerModel implements IDisposable {
|
||||
|
||||
private _roots!: ExplorerItem[];
|
||||
private _listener: IDisposable;
|
||||
private _onDidChangeRoots = new Emitter<void>();
|
||||
private readonly _onDidChangeRoots = new Emitter<void>();
|
||||
|
||||
constructor(private readonly contextService: IWorkspaceContextService) {
|
||||
const setRoots = () => this._roots = this.contextService.getWorkspace().folders
|
||||
|
||||
@@ -31,11 +31,11 @@ export class ExplorerService implements IExplorerService {
|
||||
|
||||
private static readonly EXPLORER_FILE_CHANGES_REACT_DELAY = 500; // delay in ms to react to file changes to give our internal events a chance to react first
|
||||
|
||||
private _onDidChangeRoots = new Emitter<void>();
|
||||
private _onDidChangeItem = new Emitter<{ item?: ExplorerItem, recursive: boolean }>();
|
||||
private _onDidChangeEditable = new Emitter<ExplorerItem>();
|
||||
private _onDidSelectResource = new Emitter<{ resource?: URI, reveal?: boolean }>();
|
||||
private _onDidCopyItems = new Emitter<{ items: ExplorerItem[], cut: boolean, previouslyCutItems: ExplorerItem[] | undefined }>();
|
||||
private readonly _onDidChangeRoots = new Emitter<void>();
|
||||
private readonly _onDidChangeItem = new Emitter<{ item?: ExplorerItem, recursive: boolean }>();
|
||||
private readonly _onDidChangeEditable = new Emitter<ExplorerItem>();
|
||||
private readonly _onDidSelectResource = new Emitter<{ resource?: URI, reveal?: boolean }>();
|
||||
private readonly _onDidCopyItems = new Emitter<{ items: ExplorerItem[], cut: boolean, previouslyCutItems: ExplorerItem[] | undefined }>();
|
||||
private readonly disposables = new DisposableStore();
|
||||
private editable: { stat: ExplorerItem, data: IEditableData } | undefined;
|
||||
private _sortOrder: SortOrder;
|
||||
|
||||
@@ -169,7 +169,7 @@ class OutlineViewState {
|
||||
private _filterOnType = true;
|
||||
private _sortBy = OutlineSortOrder.ByKind;
|
||||
|
||||
private _onDidChange = new Emitter<{ followCursor?: boolean, sortBy?: boolean, filterOnType?: boolean }>();
|
||||
private readonly _onDidChange = new Emitter<{ followCursor?: boolean, sortBy?: boolean, filterOnType?: boolean }>();
|
||||
readonly onDidChange = this._onDidChange.event;
|
||||
|
||||
set followCursor(value: boolean) {
|
||||
|
||||
@@ -962,7 +962,7 @@ export class DirtyDiffModel extends Disposable {
|
||||
private repositoryDisposables = new Set<IDisposable>();
|
||||
private readonly originalModelDisposables = this._register(new DisposableStore());
|
||||
|
||||
private _onDidChange = new Emitter<ISplice<IChange>[]>();
|
||||
private readonly _onDidChange = new Emitter<ISplice<IChange>[]>();
|
||||
readonly onDidChange: Event<ISplice<IChange>[]> = this._onDidChange.event;
|
||||
|
||||
private _changes: IChange[] = [];
|
||||
|
||||
@@ -102,7 +102,7 @@ class ProviderRenderer implements IListRenderer<ISCMRepository, RepositoryTempla
|
||||
|
||||
readonly templateId = 'provider';
|
||||
|
||||
private _onDidRenderElement = new Emitter<ISCMRepository>();
|
||||
private readonly _onDidRenderElement = new Emitter<ISCMRepository>();
|
||||
readonly onDidRenderElement = this._onDidRenderElement.event;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -396,7 +396,7 @@ const enum ViewModelMode {
|
||||
class ViewModel {
|
||||
|
||||
private _mode = ViewModelMode.Tree;
|
||||
private _onDidChangeMode = new Emitter<ViewModelMode>();
|
||||
private readonly _onDidChangeMode = new Emitter<ViewModelMode>();
|
||||
readonly onDidChangeMode = this._onDidChangeMode.event;
|
||||
|
||||
get mode(): ViewModelMode { return this._mode; }
|
||||
|
||||
@@ -62,7 +62,7 @@ export class SCMViewlet extends ViewContainerViewlet implements IViewModel {
|
||||
private repositoryCountKey: IContextKey<number>;
|
||||
private viewDescriptors: RepositoryViewDescriptor[] = [];
|
||||
|
||||
private _onDidSplice = new Emitter<ISpliceEvent<ISCMRepository>>();
|
||||
private readonly _onDidSplice = new Emitter<ISpliceEvent<ISCMRepository>>();
|
||||
readonly onDidSplice: Event<ISpliceEvent<ISCMRepository>> = this._onDidSplice.event;
|
||||
|
||||
private _height: number | undefined = undefined;
|
||||
|
||||
@@ -22,7 +22,7 @@ class SCMInput implements ISCMInput {
|
||||
this._onDidChange.fire(value);
|
||||
}
|
||||
|
||||
private _onDidChange = new Emitter<string>();
|
||||
private readonly _onDidChange = new Emitter<string>();
|
||||
readonly onDidChange: Event<string> = this._onDidChange.event;
|
||||
|
||||
private _placeholder = '';
|
||||
@@ -36,7 +36,7 @@ class SCMInput implements ISCMInput {
|
||||
this._onDidChangePlaceholder.fire(placeholder);
|
||||
}
|
||||
|
||||
private _onDidChangePlaceholder = new Emitter<string>();
|
||||
private readonly _onDidChangePlaceholder = new Emitter<string>();
|
||||
readonly onDidChangePlaceholder: Event<string> = this._onDidChangePlaceholder.event;
|
||||
|
||||
private _visible = true;
|
||||
@@ -50,7 +50,7 @@ class SCMInput implements ISCMInput {
|
||||
this._onDidChangeVisibility.fire(visible);
|
||||
}
|
||||
|
||||
private _onDidChangeVisibility = new Emitter<boolean>();
|
||||
private readonly _onDidChangeVisibility = new Emitter<boolean>();
|
||||
readonly onDidChangeVisibility: Event<boolean> = this._onDidChangeVisibility.event;
|
||||
|
||||
private _validateInput: IInputValidator = () => Promise.resolve(undefined);
|
||||
@@ -64,13 +64,13 @@ class SCMInput implements ISCMInput {
|
||||
this._onDidChangeValidateInput.fire();
|
||||
}
|
||||
|
||||
private _onDidChangeValidateInput = new Emitter<void>();
|
||||
private readonly _onDidChangeValidateInput = new Emitter<void>();
|
||||
readonly onDidChangeValidateInput: Event<void> = this._onDidChangeValidateInput.event;
|
||||
}
|
||||
|
||||
class SCMRepository implements ISCMRepository {
|
||||
|
||||
private _onDidFocus = new Emitter<void>();
|
||||
private readonly _onDidFocus = new Emitter<void>();
|
||||
readonly onDidFocus: Event<void> = this._onDidFocus.event;
|
||||
|
||||
private _selected = false;
|
||||
@@ -78,7 +78,7 @@ class SCMRepository implements ISCMRepository {
|
||||
return this._selected;
|
||||
}
|
||||
|
||||
private _onDidChangeSelection = new Emitter<boolean>();
|
||||
private readonly _onDidChangeSelection = new Emitter<boolean>();
|
||||
readonly onDidChangeSelection: Event<boolean> = this._onDidChangeSelection.event;
|
||||
|
||||
readonly input: ISCMInput = new SCMInput();
|
||||
@@ -114,13 +114,13 @@ export class SCMService implements ISCMService {
|
||||
private _selectedRepositories: ISCMRepository[] = [];
|
||||
get selectedRepositories(): ISCMRepository[] { return [...this._selectedRepositories]; }
|
||||
|
||||
private _onDidChangeSelectedRepositories = new Emitter<ISCMRepository[]>();
|
||||
private readonly _onDidChangeSelectedRepositories = new Emitter<ISCMRepository[]>();
|
||||
readonly onDidChangeSelectedRepositories: Event<ISCMRepository[]> = this._onDidChangeSelectedRepositories.event;
|
||||
|
||||
private _onDidAddProvider = new Emitter<ISCMRepository>();
|
||||
private readonly _onDidAddProvider = new Emitter<ISCMRepository>();
|
||||
readonly onDidAddRepository: Event<ISCMRepository> = this._onDidAddProvider.event;
|
||||
|
||||
private _onDidRemoveProvider = new Emitter<ISCMRepository>();
|
||||
private readonly _onDidRemoveProvider = new Emitter<ISCMRepository>();
|
||||
readonly onDidRemoveRepository: Event<ISCMRepository> = this._onDidRemoveProvider.event;
|
||||
|
||||
constructor(@ILogService private readonly logService: ILogService) { }
|
||||
|
||||
@@ -117,7 +117,7 @@ export class SimpleFileDialog {
|
||||
private badPath: string | undefined;
|
||||
private remoteAgentEnvironment: IRemoteAgentEnvironment | null | undefined;
|
||||
private separator: string = '/';
|
||||
private onBusyChangeEmitter = new Emitter<boolean>();
|
||||
private readonly onBusyChangeEmitter = new Emitter<boolean>();
|
||||
private updatingPromise: CancelablePromise<void> | undefined;
|
||||
|
||||
protected disposables: IDisposable[] = [
|
||||
|
||||
@@ -26,7 +26,7 @@ export class ExtensionEnablementService extends Disposable implements IExtension
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onEnablementChanged = new Emitter<IExtension[]>();
|
||||
private readonly _onEnablementChanged = new Emitter<IExtension[]>();
|
||||
public readonly onEnablementChanged: Event<IExtension[]> = this._onEnablementChanged.event;
|
||||
|
||||
private readonly storageManger: StorageManager;
|
||||
|
||||
@@ -150,7 +150,7 @@ class TestTelemetryService implements ITelemetryService {
|
||||
|
||||
public events: any[] = [];
|
||||
|
||||
private emitter = new Emitter<any>();
|
||||
private readonly emitter = new Emitter<any>();
|
||||
|
||||
public get eventLogged(): Event<any> {
|
||||
return this.emitter.event;
|
||||
|
||||
@@ -460,8 +460,8 @@ export class TestLayoutService implements IWorkbenchLayoutService {
|
||||
onPanelPositionChange: Event<string> = Event.None;
|
||||
onLayout = Event.None;
|
||||
|
||||
private _onTitleBarVisibilityChange = new Emitter<void>();
|
||||
private _onMenubarVisibilityChange = new Emitter<Dimension>();
|
||||
private readonly _onTitleBarVisibilityChange = new Emitter<void>();
|
||||
private readonly _onMenubarVisibilityChange = new Emitter<Dimension>();
|
||||
|
||||
public get onTitleBarVisibilityChange(): Event<void> {
|
||||
return this._onTitleBarVisibilityChange.event;
|
||||
@@ -1259,9 +1259,9 @@ export class TestLifecycleService implements ILifecycleService {
|
||||
public phase: LifecyclePhase;
|
||||
public startupKind: StartupKind;
|
||||
|
||||
private _onBeforeShutdown = new Emitter<BeforeShutdownEvent>();
|
||||
private _onWillShutdown = new Emitter<WillShutdownEvent>();
|
||||
private _onShutdown = new Emitter<void>();
|
||||
private readonly _onBeforeShutdown = new Emitter<BeforeShutdownEvent>();
|
||||
private readonly _onWillShutdown = new Emitter<WillShutdownEvent>();
|
||||
private readonly _onShutdown = new Emitter<void>();
|
||||
|
||||
when(): Promise<void> {
|
||||
return Promise.resolve();
|
||||
|
||||
Reference in New Issue
Block a user