Mark private emitters as readonly

This commit is contained in:
Matt Bierner
2018-03-14 13:57:38 -07:00
parent adcf6b2ddb
commit f94cea3742
93 changed files with 214 additions and 214 deletions
+3 -3
View File
@@ -15,7 +15,7 @@ class WindowManager {
// --- Zoom Level
private _zoomLevel: number = 0;
private _lastZoomLevelChangeTime: number = 0;
private _onDidChangeZoomLevel: Emitter<number> = new Emitter<number>();
private readonly _onDidChangeZoomLevel: Emitter<number> = new Emitter<number>();
public readonly onDidChangeZoomLevel: Event<number> = this._onDidChangeZoomLevel.event;
public getZoomLevel(): number {
@@ -61,7 +61,7 @@ class WindowManager {
// --- Fullscreen
private _fullscreen: boolean;
private _onDidChangeFullscreen: Emitter<void> = new Emitter<void>();
private readonly _onDidChangeFullscreen: Emitter<void> = new Emitter<void>();
public readonly onDidChangeFullscreen: Event<void> = this._onDidChangeFullscreen.event;
public setFullscreen(fullscreen: boolean): void {
@@ -78,7 +78,7 @@ class WindowManager {
// --- Accessibility
private _accessibilitySupport = Platform.AccessibilitySupport.Unknown;
private _onDidChangeAccessibilitySupport: Emitter<void> = new Emitter<void>();
private readonly _onDidChangeAccessibilitySupport: Emitter<void> = new Emitter<void>();
public readonly onDidChangeAccessibilitySupport: Event<void> = this._onDidChangeAccessibilitySupport.event;
public setAccessibilitySupport(accessibilitySupport: Platform.AccessibilitySupport): void {
+1 -1
View File
@@ -301,7 +301,7 @@ export class VSash extends Disposable implements IVerticalSashLayoutProvider {
private position: number;
private dimension: Dimension;
private _onPositionChange: Emitter<number> = new Emitter<number>();
private readonly _onPositionChange: Emitter<number> = new Emitter<number>();
public get onPositionChange(): Event<number> { return this._onPositionChange.event; }
constructor(container: HTMLElement, private minWidth: number) {
@@ -78,7 +78,7 @@ export class SelectBoxList implements ISelectBoxDelegate, IDelegate<ISelectOptio
private options: string[];
private selected: number;
private disabledOptionIndex: number;
private _onDidSelect: Emitter<ISelectData>;
private readonly _onDidSelect: Emitter<ISelectData>;
private toDispose: IDisposable[];
private styles: ISelectBoxStyles;
private listRenderer: SelectListRenderer;
@@ -16,7 +16,7 @@ export class SelectBoxNative implements ISelectBoxDelegate {
private selectElement: HTMLSelectElement;
private options: string[];
private selected: number;
private _onDidSelect: Emitter<ISelectData>;
private readonly _onDidSelect: Emitter<ISelectData>;
private toDispose: IDisposable[];
private styles: ISelectBoxStyles;
+1 -1
View File
@@ -424,7 +424,7 @@ export class Limiter<T> {
private runningPromises: number;
private maxDegreeOfParalellism: number;
private outstandingPromises: ILimitedTaskFactory[];
private _onFinished: Emitter<void>;
private readonly _onFinished: Emitter<void>;
constructor(maxDegreeOfParalellism: number) {
this.maxDegreeOfParalellism = maxDegreeOfParalellism;
+1 -1
View File
@@ -163,7 +163,7 @@ export class Emitter<T> {
export class EventMultiplexer<T> implements IDisposable {
private emitter: Emitter<T>;
private readonly emitter: Emitter<T>;
private hasListeners = false;
private events: { event: Event<T>; listener: IDisposable; }[] = [];
+1 -1
View File
@@ -50,7 +50,7 @@ export class ConfigWatcher<T> implements IConfigWatcher<T>, IDisposable {
private loaded: boolean;
private timeoutHandle: NodeJS.Timer;
private disposables: IDisposable[];
private _onDidUpdateConfiguration: Emitter<IConfigurationChangeEvent<T>>;
private readonly _onDidUpdateConfiguration: Emitter<IConfigurationChangeEvent<T>>;
private configName: string;
constructor(private _path: string, private options: IConfigOptions<T> = { changeBufferDelay: 0, defaultConfig: Object.create(null), onError: error => console.error(error) }) {
+2 -2
View File
@@ -440,10 +440,10 @@ export class TreeView extends HeightMap {
private highlightedItemWasDraggable: boolean;
private onHiddenScrollTop: number;
private _onDOMFocus: Emitter<void> = new Emitter<void>();
private readonly _onDOMFocus: Emitter<void> = new Emitter<void>();
get onDOMFocus(): Event<void> { return this._onDOMFocus.event; }
private _onDOMBlur: Emitter<void> = new Emitter<void>();
private readonly _onDOMBlur: Emitter<void> = new Emitter<void>();
get onDOMBlur(): Event<void> { return this._onDOMBlur.event; }
constructor(context: _.ITreeContext, container: HTMLElement) {
+1 -1
View File
@@ -20,7 +20,7 @@ export class KeyboardLayoutMonitor {
public static readonly INSTANCE = new KeyboardLayoutMonitor();
private _emitter: Emitter<void>;
private readonly _emitter: Emitter<void>;
private _registered: boolean;
private constructor() {
@@ -14,12 +14,12 @@ export abstract class AbstractCodeEditorService implements ICodeEditorService {
_serviceBrand: any;
private _onCodeEditorAdd: Emitter<ICodeEditor>;
private _onCodeEditorRemove: Emitter<ICodeEditor>;
private readonly _onCodeEditorAdd: Emitter<ICodeEditor>;
private readonly _onCodeEditorRemove: Emitter<ICodeEditor>;
private _codeEditors: { [editorId: string]: ICodeEditor; };
private _onDiffEditorAdd: Emitter<IDiffEditor>;
private _onDiffEditorRemove: Emitter<IDiffEditor>;
private readonly _onDiffEditorAdd: Emitter<IDiffEditor>;
private readonly _onDiffEditorRemove: Emitter<IDiffEditor>;
private _diffEditors: { [editorId: string]: IDiffEditor; };
constructor() {
@@ -455,7 +455,7 @@ class CodeEditorWidgetFocusTracker extends Disposable {
private _hasFocus: boolean;
private _domFocusTracker: dom.IFocusTracker;
private _onChange: Emitter<void> = this._register(new Emitter<void>());
private readonly _onChange: Emitter<void> = this._register(new Emitter<void>());
public readonly onChange: Event<void> = this._onChange.event;
constructor(domElement: HTMLElement) {
@@ -34,7 +34,7 @@ export interface ITabFocus {
export const TabFocus: ITabFocus = new class implements ITabFocus {
private _tabFocus: boolean = false;
private _onDidChangeTabFocus: Emitter<boolean> = new Emitter<boolean>();
private readonly _onDidChangeTabFocus: Emitter<boolean> = new Emitter<boolean>();
public readonly onDidChangeTabFocus: Event<boolean> = this._onDidChangeTabFocus.event;
public getTabFocusMode(): boolean {
+1 -1
View File
@@ -16,7 +16,7 @@ export const EditorZoom: IEditorZoom = new class implements IEditorZoom {
private _zoomLevel: number = 0;
private _onDidChangeZoomLevel: Emitter<number> = new Emitter<number>();
private readonly _onDidChangeZoomLevel: Emitter<number> = new Emitter<number>();
public readonly onDidChangeZoomLevel: Event<number> = this._onDidChangeZoomLevel.event;
public getZoomLevel(): number {
@@ -177,7 +177,7 @@ export class LanguageConfigurationRegistryImpl {
private _entries: RichEditSupport[];
private _onDidChange: Emitter<LanguageConfigurationChangeEvent> = new Emitter<LanguageConfigurationChangeEvent>();
private readonly _onDidChange: Emitter<LanguageConfigurationChangeEvent> = new Emitter<LanguageConfigurationChangeEvent>();
public readonly onDidChange: Event<LanguageConfigurationChangeEvent> = this._onDidChange.event;
constructor() {
@@ -21,7 +21,7 @@ export default class LanguageFeatureRegistry<T> {
private _clock: number = 0;
private _entries: Entry<T>[] = [];
private _onDidChange: Emitter<number> = new Emitter<number>();
private readonly _onDidChange: Emitter<number> = new Emitter<number>();
constructor() {
}
+1 -1
View File
@@ -20,7 +20,7 @@ export class EditorModesRegistry {
private _languages: ILanguageExtensionPoint[];
private _onDidAddLanguages: Emitter<ILanguageExtensionPoint[]> = new Emitter<ILanguageExtensionPoint[]>();
private readonly _onDidAddLanguages: Emitter<ILanguageExtensionPoint[]> = new Emitter<ILanguageExtensionPoint[]>();
public readonly onDidAddLanguages: Event<ILanguageExtensionPoint[]> = this._onDidAddLanguages.event;
constructor() {
@@ -13,7 +13,7 @@ export class TokenizationRegistryImpl implements ITokenizationRegistry {
private _map: { [language: string]: ITokenizationSupport };
private _onDidChange: Emitter<ITokenizationSupportChangedEvent> = new Emitter<ITokenizationSupportChangedEvent>();
private readonly _onDidChange: Emitter<ITokenizationSupportChangedEvent> = new Emitter<ITokenizationSupportChangedEvent>();
public readonly onDidChange: Event<ITokenizationSupportChangedEvent> = this._onDidChange.event;
private _colorMap: Color[];
@@ -193,9 +193,9 @@ export class ModelServiceImpl implements IModelService {
private _configurationService: IConfigurationService;
private _configurationServiceSubscription: IDisposable;
private _onModelAdded: Emitter<ITextModel>;
private _onModelRemoved: Emitter<ITextModel>;
private _onModelModeChanged: Emitter<{ model: ITextModel; oldModeId: string; }>;
private readonly _onModelAdded: Emitter<ITextModel>;
private readonly _onModelRemoved: Emitter<ITextModel>;
private readonly _onModelModeChanged: Emitter<{ model: ITextModel; oldModeId: string; }>;
private _modelCreationOptionsByLanguageAndResource: {
[languageAndResource: string]: ITextModelCreationOptions;
+1 -1
View File
@@ -70,7 +70,7 @@ export class FindReplaceState implements IDisposable {
private _matchesPosition: number;
private _matchesCount: number;
private _currentMatch: Range;
private _onFindReplaceStateChange: Emitter<FindReplaceStateChangedEvent>;
private readonly _onFindReplaceStateChange: Emitter<FindReplaceStateChangedEvent>;
public get searchString(): string { return this._searchString; }
public get replaceString(): string { return this._replaceString; }
@@ -28,7 +28,7 @@ export class TestFindController extends CommonFindController {
public delayUpdateHistory: boolean = false;
public delayedUpdateHistoryPromise: TPromise<void>;
private _delayedUpdateHistoryEvent: Emitter<void> = new Emitter<void>();
private readonly _delayedUpdateHistoryEvent: Emitter<void> = new Emitter<void>();
constructor(
editor: ICodeEditor,
+2 -2
View File
@@ -34,8 +34,8 @@ class MarkerModel {
private _nextIdx: number;
private _toUnbind: IDisposable[];
private _ignoreSelectionChange: boolean;
private _onCurrentMarkerChanged: Emitter<IMarker>;
private _onMarkerSetChanged: Emitter<MarkerModel>;
private readonly _onCurrentMarkerChanged: Emitter<IMarker>;
private readonly _onMarkerSetChanged: Emitter<MarkerModel>;
constructor(editor: ICodeEditor, markers: IMarker[]) {
this._editor = editor;
@@ -96,9 +96,9 @@ export class SuggestModel implements IDisposable {
private _currentSelection: Selection;
private _completionModel: CompletionModel;
private _onDidCancel: Emitter<ICancelEvent> = new Emitter<ICancelEvent>();
private _onDidTrigger: Emitter<ITriggerEvent> = new Emitter<ITriggerEvent>();
private _onDidSuggest: Emitter<ISuggestEvent> = new Emitter<ISuggestEvent>();
private readonly _onDidCancel: Emitter<ICancelEvent> = new Emitter<ICancelEvent>();
private readonly _onDidTrigger: Emitter<ITriggerEvent> = new Emitter<ITriggerEvent>();
private readonly _onDidSuggest: Emitter<ISuggestEvent> = new Emitter<ISuggestEvent>();
readonly onDidCancel: Event<ICancelEvent> = this._onDidCancel.event;
readonly onDidTrigger: Event<ITriggerEvent> = this._onDidTrigger.event;
@@ -73,7 +73,7 @@ export class SimpleEditor implements IEditor {
export class SimpleModel implements ITextEditorModel {
private model: ITextModel;
private _onDispose: Emitter<void>;
private readonly _onDispose: Emitter<void>;
constructor(model: ITextModel) {
this.model = model;
@@ -308,7 +308,7 @@ export class StandaloneCommandService implements ICommandService {
private readonly _instantiationService: IInstantiationService;
private _dynamicCommands: { [id: string]: ICommand; };
private _onWillExecuteCommand: Emitter<ICommandEvent> = new Emitter<ICommandEvent>();
private readonly _onWillExecuteCommand: Emitter<ICommandEvent> = new Emitter<ICommandEvent>();
public readonly onWillExecuteCommand: Event<ICommandEvent> = this._onWillExecuteCommand.event;
constructor(instantiationService: IInstantiationService) {
@@ -118,7 +118,7 @@ export class StandaloneThemeServiceImpl implements IStandaloneThemeService {
private _knownThemes: Map<string, StandaloneTheme>;
private _styleElement: HTMLStyleElement;
private _theme: IStandaloneTheme;
private _onThemeChange: Emitter<IStandaloneTheme>;
private readonly _onThemeChange: Emitter<IStandaloneTheme>;
constructor() {
@@ -29,7 +29,7 @@ export interface IBroadcastService {
export class BroadcastService implements IBroadcastService {
public _serviceBrand: any;
private _onBroadcast: Emitter<IBroadcast>;
private readonly _onBroadcast: Emitter<IBroadcast>;
constructor(
private windowId: number,
@@ -108,7 +108,7 @@ class ConfigurationRegistry implements IConfigurationRegistry {
private overrideIdentifiers: string[] = [];
private overridePropertyPattern: string;
private _onDidRegisterConfiguration: Emitter<string[]> = new Emitter<string[]>();
private readonly _onDidRegisterConfiguration: Emitter<string[]> = new Emitter<string[]>();
readonly onDidRegisterConfiguration: Event<string[]> = this._onDidRegisterConfiguration.event;
constructor() {
@@ -14,7 +14,7 @@ export class UserConfiguration extends Disposable {
private userConfigModelWatcher: ConfigWatcher<ConfigurationModelParser>;
private _onDidChangeConfiguration: Emitter<ConfigurationModel> = this._register(new Emitter<ConfigurationModel>());
private readonly _onDidChangeConfiguration: Emitter<ConfigurationModel> = this._register(new Emitter<ConfigurationModel>());
readonly onDidChangeConfiguration: Event<ConfigurationModel> = this._onDidChangeConfiguration.event;
constructor(settingsPath: string) {
@@ -23,7 +23,7 @@ export class ConfigurationService extends Disposable implements IConfigurationSe
private _configuration: Configuration;
private userConfiguration: UserConfiguration;
private _onDidChangeConfiguration: Emitter<IConfigurationChangeEvent> = this._register(new Emitter<IConfigurationChangeEvent>());
private readonly _onDidChangeConfiguration: Emitter<IConfigurationChangeEvent> = this._register(new Emitter<IConfigurationChangeEvent>());
readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event;
constructor(
@@ -55,7 +55,7 @@ class JSONContributionRegistry implements IJSONContributionRegistry {
private schemasById: { [id: string]: IJSONSchema };
private _onDidChangeSchema: Emitter<string> = new Emitter<string>();
private readonly _onDidChangeSchema: Emitter<string> = new Emitter<string>();
readonly onDidChangeSchema: Event<string> = this._onDidChangeSchema.event;
constructor() {
+1 -1
View File
@@ -455,7 +455,7 @@ export interface IResourceResultsNavigationOptions {
export class TreeResourceNavigator extends Disposable {
private _openResource: Emitter<IOpenResourceOptions> = new Emitter<IOpenResourceOptions>();
private readonly _openResource: Emitter<IOpenResourceOptions> = new Emitter<IOpenResourceOptions>();
readonly openResource: Event<IOpenResourceOptions> = this._openResource.event;
constructor(private tree: WorkbenchTree, private options?: IResourceResultsNavigationOptions) {
@@ -194,7 +194,7 @@ export interface INotificationService {
export class NoOpNotification implements INotificationHandle {
readonly progress = new NoOpProgress();
private _onDidDispose: Emitter<void> = new Emitter();
private readonly _onDidDispose: Emitter<void> = new Emitter();
public get onDidDispose(): Event<void> {
return this._onDidDispose.event;
+1 -1
View File
@@ -100,7 +100,7 @@ export interface IThemingRegistry {
class ThemingRegistry implements IThemingRegistry {
private themingParticipants: IThemingParticipant[] = [];
private onThemingParticipantAddedEmitter: Emitter<IThemingParticipant>;
private readonly onThemingParticipantAddedEmitter: Emitter<IThemingParticipant>;
constructor() {
this.themingParticipants = [];
@@ -16,7 +16,7 @@ export class URLService implements IURLService {
_serviceBrand: any;
private openUrlEmitter: Emitter<string> = new Emitter<string>();
private readonly openUrlEmitter: Emitter<string> = new Emitter<string>();
onOpenURL: Event<URI>;
constructor(
@@ -37,8 +37,8 @@ export class WorkspacesMainService implements IWorkspacesMainService {
protected workspacesHome: string;
private _onWorkspaceSaved: Emitter<IWorkspaceSavedEvent>;
private _onUntitledWorkspaceDeleted: Emitter<IWorkspaceIdentifier>;
private readonly _onWorkspaceSaved: Emitter<IWorkspaceSavedEvent>;
private readonly _onUntitledWorkspaceDeleted: Emitter<IWorkspaceIdentifier>;
constructor(
@IEnvironmentService private environmentService: IEnvironmentService,
@@ -185,7 +185,7 @@ export class MainThreadTextEditor {
private _codeEditorListeners: IDisposable[];
private _properties: MainThreadTextEditorProperties;
private _onPropertiesChanged: Emitter<IEditorPropertiesChangeData>;
private readonly _onPropertiesChanged: Emitter<IEditorPropertiesChangeData>;
constructor(
id: string,
@@ -32,7 +32,7 @@ export class HeapService implements IHeapService {
_serviceBrand: any;
private _onGarbageCollection: Emitter<number[]> = new Emitter<number[]>();
private readonly _onGarbageCollection: Emitter<number[]> = new Emitter<number[]>();
public readonly onGarbageCollection: Event<number[]> = this._onGarbageCollection.event;
private _activeSignals = new WeakMap<any, object>();
@@ -59,10 +59,10 @@ type TreeItemHandle = string;
class TreeViewDataProvider implements ITreeViewDataProvider {
private _onDidChange: Emitter<ITreeItem[] | undefined | null> = new Emitter<ITreeItem[] | undefined | null>();
private readonly _onDidChange: Emitter<ITreeItem[] | undefined | null> = new Emitter<ITreeItem[] | undefined | null>();
readonly onDidChange: Event<ITreeItem[] | undefined | null> = this._onDidChange.event;
private _onDispose: Emitter<void> = new Emitter<void>();
private readonly _onDispose: Emitter<void> = new Emitter<void>();
readonly onDispose: Event<void> = this._onDispose.event;
private itemsMap: Map<TreeItemHandle, ITreeItem> = new Map<TreeItemHandle, ITreeItem>();
@@ -29,19 +29,19 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
private _debugServiceProxy: MainThreadDebugServiceShape;
private _debugSessions: Map<DebugSessionUUID, ExtHostDebugSession> = new Map<DebugSessionUUID, ExtHostDebugSession>();
private _onDidStartDebugSession: Emitter<vscode.DebugSession>;
private readonly _onDidStartDebugSession: Emitter<vscode.DebugSession>;
get onDidStartDebugSession(): Event<vscode.DebugSession> { return this._onDidStartDebugSession.event; }
private _onDidTerminateDebugSession: Emitter<vscode.DebugSession>;
private readonly _onDidTerminateDebugSession: Emitter<vscode.DebugSession>;
get onDidTerminateDebugSession(): Event<vscode.DebugSession> { return this._onDidTerminateDebugSession.event; }
private _onDidChangeActiveDebugSession: Emitter<vscode.DebugSession | undefined>;
private readonly _onDidChangeActiveDebugSession: Emitter<vscode.DebugSession | undefined>;
get onDidChangeActiveDebugSession(): Event<vscode.DebugSession | undefined> { return this._onDidChangeActiveDebugSession.event; }
private _activeDebugSession: ExtHostDebugSession | undefined;
get activeDebugSession(): ExtHostDebugSession | undefined { return this._activeDebugSession; }
private _onDidReceiveDebugSessionCustomEvent: Emitter<vscode.DebugSessionCustomEvent>;
private readonly _onDidReceiveDebugSessionCustomEvent: Emitter<vscode.DebugSessionCustomEvent>;
get onDidReceiveDebugSessionCustomEvent(): Event<vscode.DebugSessionCustomEvent> { return this._onDidReceiveDebugSessionCustomEvent.event; }
private _activeDebugConsole: ExtHostDebugConsole;
@@ -50,7 +50,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
private _breakpoints: Map<string, vscode.Breakpoint>;
private _breakpointEventsActive: boolean;
private _onDidChangeBreakpoints: Emitter<vscode.BreakpointsChangeEvent>;
private readonly _onDidChangeBreakpoints: Emitter<vscode.BreakpointsChangeEvent>;
constructor(mainContext: IMainContext, workspace: ExtHostWorkspace) {
@@ -98,7 +98,7 @@ export class ExtHostTerminal implements vscode.Terminal {
export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
private _onDidCloseTerminal: Emitter<vscode.Terminal>;
private readonly _onDidCloseTerminal: Emitter<vscode.Terminal>;
private _proxy: MainThreadTerminalServiceShape;
private _terminals: ExtHostTerminal[];
+2 -2
View File
@@ -28,8 +28,8 @@ import { IDisposable } from 'vs/base/common/lifecycle';
* layout and focus call, but only one create and dispose call.
*/
export abstract class Composite extends Component implements IComposite {
private _onTitleAreaUpdate: Emitter<void>;
private _onDidFocus: Emitter<void>;
private readonly _onTitleAreaUpdate: Emitter<void>;
private readonly _onDidFocus: Emitter<void>;
private _focusTracker?: DOM.IFocusTracker;
private _focusListenerDisposable?: IDisposable;
@@ -37,7 +37,7 @@ export interface ICompositeBarOptions {
export class CompositeBar implements ICompositeBar {
private _onDidContextMenu: Emitter<MouseEvent>;
private readonly _onDidContextMenu: Emitter<MouseEvent>;
private dimension: Dimension;
private toDispose: IDisposable[];
@@ -24,7 +24,7 @@ import { ResourceViewerContext, ResourceViewer } from 'vs/workbench/browser/part
* This class is only intended to be subclassed and not instantiated.
*/
export abstract class BaseBinaryResourceEditor extends BaseEditor {
private _onMetadataChanged: Emitter<void>;
private readonly _onMetadataChanged: Emitter<void>;
private metadata: string;
private binaryContainer: Builder;
@@ -160,7 +160,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
private visibleEditorFocusTrackerDisposable: IDisposable[];
private _onGroupFocusChanged: Emitter<void>;
private readonly _onGroupFocusChanged: Emitter<void>;
private onStacksChangeScheduler: RunOnceScheduler;
private stacksChangedBuffer: IStacksModelChangeEvent[];
@@ -106,11 +106,11 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
private revealIfOpen: boolean;
private _onEditorsChanged: ThrottledEmitter<void>;
private _onEditorOpening: Emitter<IEditorOpeningEvent>;
private _onEditorGroupMoved: Emitter<void>;
private _onEditorOpenFail: Emitter<EditorInput>;
private _onGroupOrientationChanged: Emitter<void>;
private _onTabOptionsChanged: Emitter<IEditorTabOptions>;
private readonly _onEditorOpening: Emitter<IEditorOpeningEvent>;
private readonly _onEditorGroupMoved: Emitter<void>;
private readonly _onEditorOpenFail: Emitter<EditorInput>;
private readonly _onGroupOrientationChanged: Emitter<void>;
private readonly _onTabOptionsChanged: Emitter<IEditorTabOptions>;
private textCompareEditorVisible: IContextKey<boolean>;
@@ -25,7 +25,7 @@ export class RangeHighlightDecorations implements IDisposable {
private editor: ICodeEditor = null;
private editorDisposables: IDisposable[] = [];
private _onHighlightRemoved: Emitter<void> = new Emitter<void>();
private readonly _onHighlightRemoved: Emitter<void> = new Emitter<void>();
public readonly onHighlghtRemoved: Event<void> = this._onHighlightRemoved.event;
constructor(@IWorkbenchEditorService private editorService: IWorkbenchEditorService) {
@@ -36,7 +36,7 @@ export class NotificationsCenter extends Themable {
private notificationsList: NotificationsList;
private _isVisible: boolean;
private workbenchDimensions: Dimension;
private _onDidChangeVisibility: Emitter<void>;
private readonly _onDidChangeVisibility: Emitter<void>;
private notificationsCenterVisibleContextKey: IContextKey<boolean>;
constructor(
@@ -84,8 +84,8 @@ export class QuickOpenController extends Component implements IQuickOpenService
private static readonly ID = 'workbench.component.quickopen';
private _onShow: Emitter<void>;
private _onHide: Emitter<void>;
private readonly _onShow: Emitter<void>;
private readonly _onHide: Emitter<void>;
private quickOpenWidget: QuickOpenWidget;
private pickOpenWidget: QuickOpenWidget;
@@ -194,7 +194,7 @@ export class ViewsViewlet extends PanelViewlet implements IViewsViewlet {
protected viewsStates: Map<string, IViewState> = new Map<string, IViewState>();
private areExtensionsReady: boolean = false;
private _onDidChangeViewVisibilityState: Emitter<string> = new Emitter<string>();
private readonly _onDidChangeViewVisibilityState: Emitter<string> = new Emitter<string>();
readonly onDidChangeViewVisibilityState: Event<string> = this._onDidChangeViewVisibilityState.event;
constructor(
+2 -2
View File
@@ -96,7 +96,7 @@ export interface IEditorInputFactory {
* Each editor input is mapped to an editor that is capable of opening it through the Platform facade.
*/
export abstract class EditorInput implements IEditorInput {
private _onDispose: Emitter<void>;
private readonly _onDispose: Emitter<void>;
protected _onDidChangeDirty: Emitter<void>;
protected _onDidChangeLabel: Emitter<void>;
@@ -475,7 +475,7 @@ export interface ITextEditorModel extends IEditorModel {
* are typically cached for some while because they are expensive to construct.
*/
export class EditorModel extends Disposable implements IEditorModel {
private _onDispose: Emitter<void>;
private readonly _onDispose: Emitter<void>;
constructor() {
super();
@@ -61,17 +61,17 @@ export class EditorGroup implements IEditorGroup {
private toDispose: IDisposable[];
private editorOpenPositioning: 'left' | 'right' | 'first' | 'last';
private _onEditorActivated: Emitter<EditorInput>;
private _onEditorOpened: Emitter<EditorInput>;
private _onEditorClosed: Emitter<EditorCloseEvent>;
private _onEditorDisposed: Emitter<EditorInput>;
private _onEditorDirty: Emitter<EditorInput>;
private _onEditorLabelChange: Emitter<EditorInput>;
private _onEditorMoved: Emitter<EditorInput>;
private _onEditorPinned: Emitter<EditorInput>;
private _onEditorUnpinned: Emitter<EditorInput>;
private _onEditorStateChanged: Emitter<EditorInput>;
private _onEditorsStructureChanged: Emitter<EditorInput>;
private readonly _onEditorActivated: Emitter<EditorInput>;
private readonly _onEditorOpened: Emitter<EditorInput>;
private readonly _onEditorClosed: Emitter<EditorCloseEvent>;
private readonly _onEditorDisposed: Emitter<EditorInput>;
private readonly _onEditorDirty: Emitter<EditorInput>;
private readonly _onEditorLabelChange: Emitter<EditorInput>;
private readonly _onEditorMoved: Emitter<EditorInput>;
private readonly _onEditorPinned: Emitter<EditorInput>;
private readonly _onEditorUnpinned: Emitter<EditorInput>;
private readonly _onEditorStateChanged: Emitter<EditorInput>;
private readonly _onEditorsStructureChanged: Emitter<EditorInput>;
constructor(
arg1: string | ISerializedEditorGroup,
@@ -709,22 +709,22 @@ export class EditorStacksModel implements IEditorStacksModel {
private _activeGroup: EditorGroup;
private groupToIdentifier: { [id: number]: EditorGroup };
private _onGroupOpened: Emitter<EditorGroup>;
private _onGroupClosed: Emitter<EditorGroup>;
private _onGroupMoved: Emitter<EditorGroup>;
private _onGroupActivated: Emitter<EditorGroup>;
private _onGroupDeactivated: Emitter<EditorGroup>;
private _onGroupRenamed: Emitter<EditorGroup>;
private readonly _onGroupOpened: Emitter<EditorGroup>;
private readonly _onGroupClosed: Emitter<EditorGroup>;
private readonly _onGroupMoved: Emitter<EditorGroup>;
private readonly _onGroupActivated: Emitter<EditorGroup>;
private readonly _onGroupDeactivated: Emitter<EditorGroup>;
private readonly _onGroupRenamed: Emitter<EditorGroup>;
private _onEditorDisposed: Emitter<EditorIdentifier>;
private _onEditorDirty: Emitter<EditorIdentifier>;
private _onEditorLabelChange: Emitter<EditorIdentifier>;
private _onEditorOpened: Emitter<EditorIdentifier>;
private readonly _onEditorDisposed: Emitter<EditorIdentifier>;
private readonly _onEditorDirty: Emitter<EditorIdentifier>;
private readonly _onEditorLabelChange: Emitter<EditorIdentifier>;
private readonly _onEditorOpened: Emitter<EditorIdentifier>;
private _onWillCloseEditor: Emitter<EditorCloseEvent>;
private _onEditorClosed: Emitter<EditorCloseEvent>;
private readonly _onWillCloseEditor: Emitter<EditorCloseEvent>;
private readonly _onEditorClosed: Emitter<EditorCloseEvent>;
private _onModelChanged: Emitter<IStacksModelChangeEvent>;
private readonly _onModelChanged: Emitter<IStacksModelChangeEvent>;
constructor(
private restoreFromStorage: boolean,
@@ -35,8 +35,8 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport
private cachedModel: UntitledEditorModel;
private modelResolve: TPromise<UntitledEditorModel>;
private _onDidModelChangeContent: Emitter<void>;
private _onDidModelChangeEncoding: Emitter<void>;
private readonly _onDidModelChangeContent: Emitter<void>;
private readonly _onDidModelChangeEncoding: Emitter<void>;
private toUnbind: IDisposable[];
@@ -28,9 +28,9 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin
private toDispose: IDisposable[];
private dirty: boolean;
private _onDidChangeContent: Emitter<void>;
private _onDidChangeDirty: Emitter<void>;
private _onDidChangeEncoding: Emitter<void>;
private readonly _onDidChangeContent: Emitter<void>;
private readonly _onDidChangeDirty: Emitter<void>;
private readonly _onDidChangeEncoding: Emitter<void>;
private versionId: number;
+6 -6
View File
@@ -44,7 +44,7 @@ export interface INotificationChangeEvent {
}
export class NotificationHandle implements INotificationHandle {
private _onDidDispose: Emitter<void> = new Emitter();
private readonly _onDidDispose: Emitter<void> = new Emitter();
constructor(private item: INotificationViewItem, private disposeItem: (item: INotificationViewItem) => void) {
this.registerListeners();
@@ -89,7 +89,7 @@ export class NotificationsModel implements INotificationsModel {
private _notifications: INotificationViewItem[];
private _onDidNotificationChange: Emitter<INotificationChangeEvent>;
private readonly _onDidNotificationChange: Emitter<INotificationChangeEvent>;
private toDispose: IDisposable[];
constructor() {
@@ -253,7 +253,7 @@ export interface INotificationViewItemProgress extends INotificationProgress {
export class NotificationViewItemProgress implements INotificationViewItemProgress {
private _state: INotificationViewItemProgressState;
private _onDidChange: Emitter<void>;
private readonly _onDidChange: Emitter<void>;
private toDispose: IDisposable[];
constructor() {
@@ -358,9 +358,9 @@ export class NotificationViewItem implements INotificationViewItem {
private _actions: INotificationActions;
private _progress: NotificationViewItemProgress;
private _onDidExpansionChange: Emitter<void>;
private _onDidDispose: Emitter<void>;
private _onDidLabelChange: Emitter<INotificationViewItemLabelChangeEvent>;
private readonly _onDidExpansionChange: Emitter<void>;
private readonly _onDidDispose: Emitter<void>;
private readonly _onDidLabelChange: Emitter<INotificationViewItemLabelChangeEvent>;
public static create(notification: INotification): INotificationViewItem {
if (!notification || !notification.message || isPromiseCanceledError(notification.message)) {
+2 -2
View File
@@ -79,10 +79,10 @@ export interface IViewsRegistry {
export const ViewsRegistry: IViewsRegistry = new class implements IViewsRegistry {
private _onViewsRegistered: Emitter<IViewDescriptor[]> = new Emitter<IViewDescriptor[]>();
private readonly _onViewsRegistered: Emitter<IViewDescriptor[]> = new Emitter<IViewDescriptor[]>();
readonly onViewsRegistered: Event<IViewDescriptor[]> = this._onViewsRegistered.event;
private _onViewsDeregistered: Emitter<IViewDescriptor[]> = new Emitter<IViewDescriptor[]>();
private readonly _onViewsDeregistered: Emitter<IViewDescriptor[]> = new Emitter<IViewDescriptor[]>();
readonly onViewsDeregistered: Event<IViewDescriptor[]> = this._onViewsDeregistered.event;
private _viewLocations: ViewLocation[] = [];
@@ -19,7 +19,7 @@ export class ResourceGlobMatcher {
private static readonly NO_ROOT: string = null;
private _onExpressionChange: Emitter<void>;
private readonly _onExpressionChange: Emitter<void>;
private toUnbind: IDisposable[];
private mapRootToParsedExpression: Map<string, ParsedExpression>;
private mapRootToExpressionConfig: Map<string, IExpression>;
@@ -174,7 +174,7 @@ export class Workbench implements IPartService {
private static readonly fontAliasingConfigurationKey = 'workbench.fontAliasing';
private _onTitleBarVisibilityChange: Emitter<void>;
private readonly _onTitleBarVisibilityChange: Emitter<void>;
public _serviceBrand: any;
@@ -733,10 +733,10 @@ export class Model implements IModel {
private toDispose: lifecycle.IDisposable[];
private replElements: IReplElement[];
private schedulers = new Map<string, RunOnceScheduler>();
private _onDidChangeBreakpoints: Emitter<IBreakpointsChangeEvent>;
private _onDidChangeCallStack: Emitter<void>;
private _onDidChangeWatchExpressions: Emitter<IExpression>;
private _onDidChangeREPLElements: Emitter<void>;
private readonly _onDidChangeBreakpoints: Emitter<IBreakpointsChangeEvent>;
private readonly _onDidChangeCallStack: Emitter<void>;
private readonly _onDidChangeWatchExpressions: Emitter<IExpression>;
private readonly _onDidChangeREPLElements: Emitter<void>;
constructor(
private breakpoints: Breakpoint[],
@@ -14,9 +14,9 @@ export class ViewModel implements IViewModel {
private _focusedThread: IThread;
private selectedExpression: IExpression;
private selectedFunctionBreakpoint: IFunctionBreakpoint;
private _onDidFocusProcess: Emitter<IProcess | undefined>;
private _onDidFocusStackFrame: Emitter<{ stackFrame: IStackFrame, explicit: boolean }>;
private _onDidSelectExpression: Emitter<IExpression>;
private readonly _onDidFocusProcess: Emitter<IProcess | undefined>;
private readonly _onDidFocusStackFrame: Emitter<{ stackFrame: IStackFrame, explicit: boolean }>;
private readonly _onDidSelectExpression: Emitter<IExpression>;
private multiProcessView: boolean;
private expressionSelectedContextKey: IContextKey<boolean>;
private breakpointSelectedContextKey: IContextKey<boolean>;
@@ -68,10 +68,10 @@ export class DebugService implements debug.IDebugService {
public _serviceBrand: any;
private sessionStates: Map<string, debug.State>;
private _onDidChangeState: Emitter<debug.State>;
private _onDidNewProcess: Emitter<debug.IProcess>;
private _onDidEndProcess: Emitter<debug.IProcess>;
private _onDidCustomEvent: Emitter<debug.DebugEvent>;
private readonly _onDidChangeState: Emitter<debug.State>;
private readonly _onDidNewProcess: Emitter<debug.IProcess>;
private readonly _onDidEndProcess: Emitter<debug.IProcess>;
private readonly _onDidCustomEvent: Emitter<debug.DebugEvent>;
private model: Model;
private viewModel: ViewModel;
private allProcesses: Map<string, debug.IProcess>;
@@ -54,16 +54,16 @@ export class RawDebugSession extends V8Protocol implements debug.ISession {
private _capabilities: DebugProtocol.Capabilities;
private allThreadsContinued: boolean;
private _onDidInitialize: Emitter<DebugProtocol.InitializedEvent>;
private _onDidStop: Emitter<DebugProtocol.StoppedEvent>;
private _onDidContinued: Emitter<DebugProtocol.ContinuedEvent>;
private _onDidTerminateDebugee: Emitter<SessionTerminatedEvent>;
private _onDidExitAdapter: Emitter<SessionExitedEvent>;
private _onDidThread: Emitter<DebugProtocol.ThreadEvent>;
private _onDidOutput: Emitter<DebugProtocol.OutputEvent>;
private _onDidBreakpoint: Emitter<DebugProtocol.BreakpointEvent>;
private _onDidCustomEvent: Emitter<debug.DebugEvent>;
private _onDidEvent: Emitter<DebugProtocol.Event>;
private readonly _onDidInitialize: Emitter<DebugProtocol.InitializedEvent>;
private readonly _onDidStop: Emitter<DebugProtocol.StoppedEvent>;
private readonly _onDidContinued: Emitter<DebugProtocol.ContinuedEvent>;
private readonly _onDidTerminateDebugee: Emitter<SessionTerminatedEvent>;
private readonly _onDidExitAdapter: Emitter<SessionExitedEvent>;
private readonly _onDidThread: Emitter<DebugProtocol.ThreadEvent>;
private readonly _onDidOutput: Emitter<DebugProtocol.OutputEvent>;
private readonly _onDidBreakpoint: Emitter<DebugProtocol.BreakpointEvent>;
private readonly _onDidCustomEvent: Emitter<debug.DebugEvent>;
private readonly _onDidEvent: Emitter<DebugProtocol.Event>;
constructor(
id: string,
@@ -358,7 +358,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {
private autoUpdateDelayer: ThrottledDelayer<void>;
private disposables: IDisposable[] = [];
private _onChange: Emitter<void> = new Emitter<void>();
private readonly _onChange: Emitter<void> = new Emitter<void>();
get onChange(): Event<void> { return this._onChange.event; }
private _extensionAllowedBadgeProviders: string[];
@@ -165,10 +165,10 @@ export interface IOutputChannelRegistry {
class OutputChannelRegistry implements IOutputChannelRegistry {
private channels = new Map<string, IOutputChannelIdentifier>();
private _onDidRegisterChannel: Emitter<string> = new Emitter<string>();
private readonly _onDidRegisterChannel: Emitter<string> = new Emitter<string>();
readonly onDidRegisterChannel: Event<string> = this._onDidRegisterChannel.event;
private _onDidRemoveChannel: Emitter<string> = new Emitter<string>();
private readonly _onDidRemoveChannel: Emitter<string> = new Emitter<string>();
readonly onDidRemoveChannel: Event<string> = this._onDidRemoveChannel.event;
public registerChannel(id: string, label: string, file?: URI): void {
@@ -315,7 +315,7 @@ class OutputChannelBackedByFile extends AbstractFileOutputChannel implements Out
class OutputFileListener extends Disposable {
private _onDidChange: Emitter<void> = new Emitter<void>();
private readonly _onDidChange: Emitter<void> = new Emitter<void>();
readonly onDidContentChange: Event<void> = this._onDidChange.event;
private watching: boolean = false;
@@ -423,7 +423,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
private activeChannel: IOutputChannel;
private readonly outputDir: string;
private _onActiveOutputChannel: Emitter<string> = new Emitter<string>();
private readonly _onActiveOutputChannel: Emitter<string> = new Emitter<string>();
readonly onActiveOutputChannel: Event<string> = this._onActiveOutputChannel.event;
private _outputPanel: OutputPanel;
@@ -651,7 +651,7 @@ class BufferredOutputChannel extends Disposable implements OutputChannel {
protected _onDidAppendedContent: Emitter<void> = new Emitter<void>();
readonly onDidAppendedContent: Event<void> = this._onDidAppendedContent.event;
private _onDispose: Emitter<void> = new Emitter<void>();
private readonly _onDispose: Emitter<void> = new Emitter<void>();
readonly onDispose: Event<void> = this._onDispose.event;
private modelUpdater: RunOnceScheduler;
@@ -398,7 +398,7 @@ class PreferencesRenderersController extends Disposable {
private _lastQuery: string;
private _lastFilterResult: IFilterResult;
private _onDidFilterResultsCountChange: Emitter<IPreferencesCount> = this._register(new Emitter<IPreferencesCount>());
private readonly _onDidFilterResultsCountChange: Emitter<IPreferencesCount> = this._register(new Emitter<IPreferencesCount>());
public readonly onDidFilterResultsCountChange: Event<IPreferencesCount> = this._onDidFilterResultsCountChange.event;
constructor(
@@ -782,10 +782,10 @@ class SideBySidePreferencesWidget extends Widget {
private settingsTargetsWidget: SettingsTargetsWidget;
private _onFocus: Emitter<void> = new Emitter<void>();
private readonly _onFocus: Emitter<void> = new Emitter<void>();
readonly onFocus: Event<void> = this._onFocus.event;
private _onDidSettingsTargetChange: Emitter<SettingsTarget> = new Emitter<SettingsTarget>();
private readonly _onDidSettingsTargetChange: Emitter<SettingsTarget> = new Emitter<SettingsTarget>();
readonly onDidSettingsTargetChange: Event<SettingsTarget> = this._onDidSettingsTargetChange.event;
private lastFocusedEditor: BaseEditor;
@@ -69,13 +69,13 @@ export class UserSettingsRenderer extends Disposable implements IPreferencesRend
private modelChangeDelayer: Delayer<void> = new Delayer<void>(200);
private associatedPreferencesModel: IPreferencesEditorModel<ISetting>;
private _onFocusPreference: Emitter<ISetting> = new Emitter<ISetting>();
private readonly _onFocusPreference: Emitter<ISetting> = new Emitter<ISetting>();
public readonly onFocusPreference: Event<ISetting> = this._onFocusPreference.event;
private _onClearFocusPreference: Emitter<ISetting> = new Emitter<ISetting>();
private readonly _onClearFocusPreference: Emitter<ISetting> = new Emitter<ISetting>();
public readonly onClearFocusPreference: Event<ISetting> = this._onClearFocusPreference.event;
private _onUpdatePreference: Emitter<{ key: string, value: any, source: IIndexedSetting }> = new Emitter<{ key: string, value: any, source: IIndexedSetting }>();
private readonly _onUpdatePreference: Emitter<{ key: string, value: any, source: IIndexedSetting }> = new Emitter<{ key: string, value: any, source: IIndexedSetting }>();
public readonly onUpdatePreference: Event<{ key: string, value: any, source: IIndexedSetting }> = this._onUpdatePreference.event;
private filterResult: IFilterResult;
@@ -257,13 +257,13 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR
private extensionCodelensRenderer: ExtensionCodelensRenderer;
private filterResult: IFilterResult;
private _onUpdatePreference: Emitter<{ key: string, value: any, source: IIndexedSetting }> = new Emitter<{ key: string, value: any, source: IIndexedSetting }>();
private readonly _onUpdatePreference: Emitter<{ key: string, value: any, source: IIndexedSetting }> = new Emitter<{ key: string, value: any, source: IIndexedSetting }>();
public readonly onUpdatePreference: Event<{ key: string, value: any, source: IIndexedSetting }> = this._onUpdatePreference.event;
private _onFocusPreference: Emitter<ISetting> = new Emitter<ISetting>();
private readonly _onFocusPreference: Emitter<ISetting> = new Emitter<ISetting>();
public readonly onFocusPreference: Event<ISetting> = this._onFocusPreference.event;
private _onClearFocusPreference: Emitter<ISetting> = new Emitter<ISetting>();
private readonly _onClearFocusPreference: Emitter<ISetting> = new Emitter<ISetting>();
public readonly onClearFocusPreference: Event<ISetting> = this._onClearFocusPreference.event;
constructor(protected editor: ICodeEditor, public readonly preferencesModel: DefaultSettingsEditorModel,
@@ -481,7 +481,7 @@ class DefaultSettingsHeaderRenderer extends Disposable {
export class SettingsGroupTitleRenderer extends Disposable implements HiddenAreasProvider {
private _onHiddenAreasChanged: Emitter<void> = new Emitter<void>();
private readonly _onHiddenAreasChanged: Emitter<void> = new Emitter<void>();
get onHiddenAreasChanged(): Event<void> { return this._onHiddenAreasChanged.event; }
private settingsGroups: ISettingsGroup[];
@@ -1031,7 +1031,7 @@ class EditSettingRenderer extends Disposable {
public associatedPreferencesModel: IPreferencesEditorModel<ISetting>;
private toggleEditPreferencesForMouseMoveDelayer: Delayer<void>;
private _onUpdateSetting: Emitter<{ key: string, value: any, source: IIndexedSetting }> = new Emitter<{ key: string, value: any, source: IIndexedSetting }>();
private readonly _onUpdateSetting: Emitter<{ key: string, value: any, source: IIndexedSetting }> = new Emitter<{ key: string, value: any, source: IIndexedSetting }>();
public readonly onUpdateSetting: Event<{ key: string, value: any, source: IIndexedSetting }> = this._onUpdateSetting.event;
constructor(private editor: ICodeEditor, private masterSettingsModel: ISettingsEditorModel,
@@ -1295,7 +1295,7 @@ class SettingHighlighter extends Disposable {
private volatileHighlighter: RangeHighlightDecorations;
private highlightedSetting: ISetting;
constructor(private editor: ICodeEditor, private focusEventEmitter: Emitter<ISetting>, private clearFocusEventEmitter: Emitter<ISetting>,
constructor(private editor: ICodeEditor, private readonly focusEventEmitter: Emitter<ISetting>, private readonly clearFocusEventEmitter: Emitter<ISetting>,
@IInstantiationService instantiationService: IInstantiationService
) {
super();
@@ -49,7 +49,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
private lastOpenedSettingsInput: PreferencesEditorInput = null;
private _onDispose: Emitter<void> = new Emitter<void>();
private readonly _onDispose: Emitter<void> = new Emitter<void>();
private _defaultSettingsUriCounter = 0;
private _defaultSettingsContentModel: DefaultSettings;
@@ -461,7 +461,7 @@ export class SettingsTargetsWidget extends Widget {
private _settingsTarget: SettingsTarget;
private _onDidTargetChange: Emitter<SettingsTarget> = new Emitter<SettingsTarget>();
private readonly _onDidTargetChange: Emitter<SettingsTarget> = new Emitter<SettingsTarget>();
public readonly onDidTargetChange: Event<SettingsTarget> = this._onDidTargetChange.event;
constructor(
@@ -573,10 +573,10 @@ export class SearchWidget extends Widget {
private inputBox: InputBox;
private controlsDiv: HTMLElement;
private _onDidChange: Emitter<string> = this._register(new Emitter<string>());
private readonly _onDidChange: Emitter<string> = this._register(new Emitter<string>());
public readonly onDidChange: Event<string> = this._onDidChange.event;
private _onFocus: Emitter<void> = this._register(new Emitter<void>());
private readonly _onFocus: Emitter<void> = this._register(new Emitter<void>());
public readonly onFocus: Event<void> = this._onFocus.event;
constructor(parent: HTMLElement, protected options: SearchOptions,
@@ -705,7 +705,7 @@ export class FloatingClickWidget extends Widget implements IOverlayWidget {
private _domNode: HTMLElement;
private _onClick: Emitter<void> = this._register(new Emitter<void>());
private readonly _onClick: Emitter<void> = this._register(new Emitter<void>());
public readonly onClick: Event<void> = this._onClick.event;
constructor(
@@ -766,7 +766,7 @@ export class EditPreferenceWidget<T> extends Disposable {
private _editPreferenceDecoration: string[];
private _onClick: Emitter<IEditorMouseEvent> = new Emitter<IEditorMouseEvent>();
private readonly _onClick: Emitter<IEditorMouseEvent> = new Emitter<IEditorMouseEvent>();
public get onClick(): Event<IEditorMouseEvent> { return this._onClick.event; }
constructor(private editor: ICodeEditor
@@ -119,7 +119,7 @@ export class SettingsEditorModel extends AbstractSettingsModel implements ISetti
private _settingsGroups: ISettingsGroup[];
protected settingsModel: ITextModel;
private _onDidChangeGroups: Emitter<void> = this._register(new Emitter<void>());
private readonly _onDidChangeGroups: Emitter<void> = this._register(new Emitter<void>());
readonly onDidChangeGroups: Event<void> = this._onDidChangeGroups.event;
constructor(reference: IReference<ITextEditorModel>, private _configurationTarget: ConfigurationTarget) {
@@ -597,7 +597,7 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements
private _model: ITextModel;
private _onDidChangeGroups: Emitter<void> = this._register(new Emitter<void>());
private readonly _onDidChangeGroups: Emitter<void> = this._register(new Emitter<void>());
readonly onDidChangeGroups: Event<void> = this._onDidChangeGroups.event;
constructor(
@@ -98,7 +98,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
private currentSelectedFileMatch: FileMatch;
private selectCurrentMatchEmitter: Emitter<string>;
private readonly selectCurrentMatchEmitter: Emitter<string>;
private delayedRefresh: Delayer<void>;
private changedWhileHidden: boolean;
@@ -682,7 +682,7 @@ export class SearchModel extends Disposable {
private _replaceString: string = null;
private _replacePattern: ReplacePattern = null;
private _onReplaceTermChanged: Emitter<void> = this._register(new Emitter<void>());
private readonly _onReplaceTermChanged: Emitter<void> = this._register(new Emitter<void>());
public readonly onReplaceTermChanged: Event<void> = this._onReplaceTermChanged.event;
private currentRequest: PPromise<ISearchComplete, ISearchProgressItem>;
@@ -453,7 +453,7 @@ class TaskService implements ITaskService {
private _recentlyUsedTasks: LinkedMap<string, string>;
private _outputChannel: IOutputChannel;
private _onDidStateChange: Emitter<TaskEvent>;
private readonly _onDidStateChange: Emitter<TaskEvent>;
constructor(
@IConfigurationService private configurationService: IConfigurationService,
@@ -91,7 +91,7 @@ export class TerminalTaskSystem implements ITaskSystem {
private idleTaskTerminals: LinkedMap<string, string>;
private sameTaskTerminals: IStringDictionary<string>;
private _onDidStateChange: Emitter<TaskEvent>;
private readonly _onDidStateChange: Emitter<TaskEvent>;
constructor(private terminalService: ITerminalService, private outputService: IOutputService,
private markerService: IMarkerService, private modelService: IModelService,
@@ -54,7 +54,7 @@ export class ProcessTaskSystem implements ITaskSystem {
private activeTask: CustomTask;
private activeTaskPromise: TPromise<ITaskSummary>;
private _onDidStateChange: Emitter<TaskEvent>;
private readonly _onDidStateChange: Emitter<TaskEvent>;
constructor(markerService: IMarkerService, modelService: IModelService, telemetryService: ITelemetryService,
outputService: IOutputService, configurationResolverService: IConfigurationResolverService, outputChannelId: string) {
@@ -31,7 +31,7 @@ export abstract class TerminalService implements ITerminalService {
protected abstract _terminalInstances: ITerminalInstance[];
private _activeTabIndex: number;
private _onActiveTabChanged: Emitter<void>;
private readonly _onActiveTabChanged: Emitter<void>;
public get activeTabIndex(): number { return this._activeTabIndex; }
public get onActiveTabChanged(): Event<void> { return this._onActiveTabChanged.event; }
@@ -78,10 +78,10 @@ export class TerminalInstance implements ITerminalInstance {
private _processState: ProcessState;
private _processReady: TPromise<void>;
private _isDisposed: boolean;
private _onDisposed: Emitter<ITerminalInstance>;
private _onFocused: Emitter<ITerminalInstance>;
private _onProcessIdReady: Emitter<ITerminalInstance>;
private _onTitleChanged: Emitter<string>;
private readonly _onDisposed: Emitter<ITerminalInstance>;
private readonly _onFocused: Emitter<ITerminalInstance>;
private readonly _onProcessIdReady: Emitter<ITerminalInstance>;
private readonly _onTitleChanged: Emitter<string>;
private _process: cp.ChildProcess;
private _processId: number;
private _skipTerminalCommands: string[];
@@ -248,9 +248,9 @@ export class TerminalTab extends Disposable implements ITerminalTab {
public get terminalInstances(): ITerminalInstance[] { return this._terminalInstances; }
private _onDisposed: Emitter<ITerminalTab>;
private readonly _onDisposed: Emitter<ITerminalTab>;
public get onDisposed(): Event<ITerminalTab> { return this._onDisposed.event; }
private _onInstancesChanged: Emitter<void>;
private readonly _onInstancesChanged: Emitter<void>;
public get onInstancesChanged(): Event<void> { return this._onInstancesChanged.event; }
constructor(
@@ -31,7 +31,7 @@ export class WebviewEditor extends BaseWebviewEditor {
private editorFrame: HTMLElement;
private content: HTMLElement;
private webviewContent: HTMLElement | undefined;
private _onDidFocusWebview: Emitter<void>;
private readonly _onDidFocusWebview: Emitter<void>;
private _webviewFocusTracker?: DOM.IFocusTracker;
private _webviewFocusListenerDisposable?: IDisposable;
@@ -18,7 +18,7 @@ export class CommandService extends Disposable implements ICommandService {
private _extensionHostIsReady: boolean = false;
private _onWillExecuteCommand: Emitter<ICommandEvent> = this._register(new Emitter<ICommandEvent>());
private readonly _onWillExecuteCommand: Emitter<ICommandEvent> = this._register(new Emitter<ICommandEvent>());
public readonly onWillExecuteCommand: Event<ICommandEvent> = this._onWillExecuteCommand.event;
constructor(
@@ -79,7 +79,7 @@ export class WorkspaceConfiguration extends Disposable {
private _workspaceConfigurationWatcher: ConfigWatcher<WorkspaceConfigurationModelParser>;
private _workspaceConfigurationWatcherDisposables: IDisposable[] = [];
private _onDidUpdateConfiguration: Emitter<void> = this._register(new Emitter<void>());
private readonly _onDidUpdateConfiguration: Emitter<void> = this._register(new Emitter<void>());
public readonly onDidUpdateConfiguration: Event<void> = this._onDidUpdateConfiguration.event;
private _workspaceConfigurationModelParser: WorkspaceConfigurationModelParser = new WorkspaceConfigurationModelParser(this._workspaceConfigPath ? this._workspaceConfigPath.fsPath : '');
@@ -182,7 +182,7 @@ export class FolderConfiguration extends Disposable {
private _cache: ConfigurationModel = new ConfigurationModel();
private reloadConfigurationScheduler: RunOnceScheduler;
private reloadConfigurationEventEmitter: Emitter<ConfigurationModel> = new Emitter<ConfigurationModel>();
private readonly reloadConfigurationEventEmitter: Emitter<ConfigurationModel> = new Emitter<ConfigurationModel>();
constructor(private folder: URI, private configFolderRelativePath: string, workbenchState: WorkbenchState) {
super();
@@ -39,7 +39,7 @@ import { INotificationService, Severity } from 'vs/platform/notification/common/
export class ExtensionHostProcessWorker {
private _onCrashed: Emitter<[number, string]> = new Emitter<[number, string]>();
private readonly _onCrashed: Emitter<[number, string]> = new Emitter<[number, string]>();
public readonly onCrashed: Event<[number, string]> = this._onCrashed.event;
private readonly _toDispose: IDisposable[];
@@ -113,7 +113,7 @@ const NO_OP_VOID_PROMISE = TPromise.wrap<void>(void 0);
export class ExtensionService extends Disposable implements IExtensionService {
public _serviceBrand: any;
private _onDidRegisterExtensions: Emitter<void>;
private readonly _onDidRegisterExtensions: Emitter<void>;
private _registry: ExtensionDescriptionRegistry;
private readonly _installedExtensionsReady: Barrier;
@@ -119,8 +119,8 @@ export class FileService implements IFileService {
private tmpPath: string;
private options: IFileServiceOptions;
private _onFileChanges: Emitter<FileChangesEvent>;
private _onAfterOperation: Emitter<FileOperationEvent>;
private readonly _onFileChanges: Emitter<FileChangesEvent>;
private readonly _onAfterOperation: Emitter<FileOperationEvent>;
private toDispose: IDisposable[];
@@ -14,7 +14,7 @@ import { IRawFileChange, toFileChangesEvent, normalize } from 'vs/workbench/serv
import Event, { Emitter } from 'vs/base/common/event';
class TestFileWatcher {
private _onFileChanges: Emitter<FileChangesEvent>;
private readonly _onFileChanges: Emitter<FileChangesEvent>;
constructor() {
this._onFileChanges = new Emitter<FileChangesEvent>();
@@ -46,7 +46,7 @@ export class KeyboardMapperFactory {
private _keyboardMapper: IKeyboardMapper;
private _initialized: boolean;
private _onDidChangeKeyboardMapper: Emitter<void> = new Emitter<void>();
private readonly _onDidChangeKeyboardMapper: Emitter<void> = new Emitter<void>();
public readonly onDidChangeKeyboardMapper: Event<void> = this._onDidChangeKeyboardMapper.event;
private constructor() {
@@ -28,7 +28,7 @@ export class TMScopeRegistry {
private _scopeNameToLanguageRegistration: { [scopeName: string]: TMLanguageRegistration; };
private _encounteredLanguages: boolean[];
private _onDidEncounterLanguage: Emitter<LanguageId> = new Emitter<LanguageId>();
private readonly _onDidEncounterLanguage: Emitter<LanguageId> = new Emitter<LanguageId>();
public readonly onDidEncounterLanguage: Event<LanguageId> = this._onDidEncounterLanguage.event;
constructor() {
@@ -63,8 +63,8 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
private disposed: boolean;
private lastSaveAttemptTime: number;
private createTextEditorModelPromise: TPromise<TextFileEditorModel>;
private _onDidContentChange: Emitter<StateChange>;
private _onDidStateChange: Emitter<StateChange>;
private readonly _onDidContentChange: Emitter<StateChange>;
private readonly _onDidStateChange: Emitter<StateChange>;
private inConflictMode: boolean;
private inOrphanMode: boolean;
@@ -17,14 +17,14 @@ import { ResourceMap } from 'vs/base/common/map';
export class TextFileEditorModelManager implements ITextFileEditorModelManager {
private toUnbind: IDisposable[];
private _onModelDisposed: Emitter<URI>;
private _onModelContentChanged: Emitter<TextFileModelChangeEvent>;
private _onModelDirty: Emitter<TextFileModelChangeEvent>;
private _onModelSaveError: Emitter<TextFileModelChangeEvent>;
private _onModelSaved: Emitter<TextFileModelChangeEvent>;
private _onModelReverted: Emitter<TextFileModelChangeEvent>;
private _onModelEncodingChanged: Emitter<TextFileModelChangeEvent>;
private _onModelOrphanedChanged: Emitter<TextFileModelChangeEvent>;
private readonly _onModelDisposed: Emitter<URI>;
private readonly _onModelContentChanged: Emitter<TextFileModelChangeEvent>;
private readonly _onModelDirty: Emitter<TextFileModelChangeEvent>;
private readonly _onModelSaveError: Emitter<TextFileModelChangeEvent>;
private readonly _onModelSaved: Emitter<TextFileModelChangeEvent>;
private readonly _onModelReverted: Emitter<TextFileModelChangeEvent>;
private readonly _onModelEncodingChanged: Emitter<TextFileModelChangeEvent>;
private readonly _onModelOrphanedChanged: Emitter<TextFileModelChangeEvent>;
private _onModelsDirtyEvent: Event<TextFileModelChangeEvent[]>;
private _onModelsSaveError: Event<TextFileModelChangeEvent[]>;
@@ -51,10 +51,10 @@ export abstract class TextFileService implements ITextFileService {
private toUnbind: IDisposable[];
private _models: TextFileEditorModelManager;
private _onFilesAssociationChange: Emitter<void>;
private readonly _onFilesAssociationChange: Emitter<void>;
private currentFilesAssociationConfig: { [key: string]: string; };
private _onAutoSaveConfigurationChange: Emitter<IAutoSaveConfiguration>;
private readonly _onAutoSaveConfigurationChange: Emitter<IAutoSaveConfiguration>;
private configuredAutoSaveDelay: number;
private configuredAutoSaveOnFocusChange: boolean;
private configuredAutoSaveOnWindowChange: boolean;
@@ -47,7 +47,7 @@ let themesExtPoint = ExtensionsRegistry.registerExtensionPoint<IThemeExtensionPo
export class ColorThemeStore {
private extensionsColorThemes: ColorThemeData[];
private onDidChangeEmitter: Emitter<ColorThemeData[]>;
private readonly onDidChangeEmitter: Emitter<ColorThemeData[]>;
public get onDidChange(): Event<ColorThemeData[]> { return this.onDidChangeEmitter.event; }
@@ -41,7 +41,7 @@ let iconThemeExtPoint = ExtensionsRegistry.registerExtensionPoint<IThemeExtensio
export class FileIconThemeStore {
private knownIconThemes: FileIconThemeData[];
private onDidChangeEmitter: Emitter<FileIconThemeData[]>;
private readonly onDidChangeEmitter: Emitter<FileIconThemeData[]>;
public get onDidChange(): Event<FileIconThemeData[]> { return this.onDidChangeEmitter.event; }
@@ -74,11 +74,11 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
private colorThemeStore: ColorThemeStore;
private currentColorTheme: ColorThemeData;
private container: HTMLElement;
private onColorThemeChange: Emitter<IColorTheme>;
private readonly onColorThemeChange: Emitter<IColorTheme>;
private iconThemeStore: FileIconThemeStore;
private currentIconTheme: IFileIconTheme;
private onFileIconThemeChange: Emitter<IFileIconTheme>;
private readonly onFileIconThemeChange: Emitter<IFileIconTheme>;
private themingParticipantChangeListener: IDisposable;
private _configurationWriter: ConfigurationWriter;
@@ -110,10 +110,10 @@ export class UntitledEditorService implements IUntitledEditorService {
private mapResourceToInput = new ResourceMap<UntitledEditorInput>();
private mapResourceToAssociatedFilePath = new ResourceMap<boolean>();
private _onDidChangeContent: Emitter<URI>;
private _onDidChangeDirty: Emitter<URI>;
private _onDidChangeEncoding: Emitter<URI>;
private _onDidDisposeModel: Emitter<URI>;
private readonly _onDidChangeContent: Emitter<URI>;
private readonly _onDidChangeDirty: Emitter<URI>;
private readonly _onDidChangeEncoding: Emitter<URI>;
private readonly _onDidDisposeModel: Emitter<URI>;
constructor(
@IInstantiationService private instantiationService: IInstantiationService,
+11 -11
View File
@@ -77,9 +77,9 @@ export class TestContextService implements IWorkspaceContextService {
private workspace: IWorkbenchWorkspace;
private options: any;
private _onDidChangeWorkspaceName: Emitter<void>;
private _onDidChangeWorkspaceFolders: Emitter<IWorkspaceFoldersChangeEvent>;
private _onDidChangeWorkbenchState: Emitter<WorkbenchState>;
private readonly _onDidChangeWorkspaceName: Emitter<void>;
private readonly _onDidChangeWorkspaceFolders: Emitter<IWorkspaceFoldersChangeEvent>;
private readonly _onDidChangeWorkbenchState: Emitter<WorkbenchState>;
constructor(workspace: any = TestWorkspace, options: any = null) {
this.workspace = workspace;
@@ -475,12 +475,12 @@ export class TestEditorGroupService implements IEditorGroupService {
private stacksModel: EditorStacksModel;
private _onEditorsChanged: Emitter<void>;
private _onEditorOpening: Emitter<IEditorOpeningEvent>;
private _onEditorOpenFail: Emitter<IEditorInput>;
private _onEditorsMoved: Emitter<void>;
private _onGroupOrientationChanged: Emitter<void>;
private _onTabOptionsChanged: Emitter<IEditorTabOptions>;
private readonly _onEditorsChanged: Emitter<void>;
private readonly _onEditorOpening: Emitter<IEditorOpeningEvent>;
private readonly _onEditorOpenFail: Emitter<IEditorInput>;
private readonly _onEditorsMoved: Emitter<void>;
private readonly _onGroupOrientationChanged: Emitter<void>;
private readonly _onTabOptionsChanged: Emitter<IEditorTabOptions>;
constructor(callback?: (method: string) => void) {
this._onEditorsMoved = new Emitter<void>();
@@ -679,8 +679,8 @@ export class TestFileService implements IFileService {
public _serviceBrand: any;
private _onFileChanges: Emitter<FileChangesEvent>;
private _onAfterOperation: Emitter<FileOperationEvent>;
private readonly _onFileChanges: Emitter<FileChangesEvent>;
private readonly _onAfterOperation: Emitter<FileOperationEvent>;
private content = 'Hello Html';