提交 adcf6b2d 编写于 作者: M Matt Bierner

Mark public event properties readonly

上级 585cda3e
...@@ -17,7 +17,7 @@ class WindowManager { ...@@ -17,7 +17,7 @@ class WindowManager {
private _lastZoomLevelChangeTime: number = 0; private _lastZoomLevelChangeTime: number = 0;
private _onDidChangeZoomLevel: Emitter<number> = new Emitter<number>(); private _onDidChangeZoomLevel: Emitter<number> = new Emitter<number>();
public onDidChangeZoomLevel: Event<number> = this._onDidChangeZoomLevel.event; public readonly onDidChangeZoomLevel: Event<number> = this._onDidChangeZoomLevel.event;
public getZoomLevel(): number { public getZoomLevel(): number {
return this._zoomLevel; return this._zoomLevel;
} }
...@@ -63,7 +63,7 @@ class WindowManager { ...@@ -63,7 +63,7 @@ class WindowManager {
private _fullscreen: boolean; private _fullscreen: boolean;
private _onDidChangeFullscreen: Emitter<void> = new Emitter<void>(); private _onDidChangeFullscreen: Emitter<void> = new Emitter<void>();
public onDidChangeFullscreen: Event<void> = this._onDidChangeFullscreen.event; public readonly onDidChangeFullscreen: Event<void> = this._onDidChangeFullscreen.event;
public setFullscreen(fullscreen: boolean): void { public setFullscreen(fullscreen: boolean): void {
if (this._fullscreen === fullscreen) { if (this._fullscreen === fullscreen) {
return; return;
...@@ -80,7 +80,7 @@ class WindowManager { ...@@ -80,7 +80,7 @@ class WindowManager {
private _accessibilitySupport = Platform.AccessibilitySupport.Unknown; private _accessibilitySupport = Platform.AccessibilitySupport.Unknown;
private _onDidChangeAccessibilitySupport: Emitter<void> = new Emitter<void>(); private _onDidChangeAccessibilitySupport: Emitter<void> = new Emitter<void>();
public onDidChangeAccessibilitySupport: Event<void> = this._onDidChangeAccessibilitySupport.event; public readonly onDidChangeAccessibilitySupport: Event<void> = this._onDidChangeAccessibilitySupport.event;
public setAccessibilitySupport(accessibilitySupport: Platform.AccessibilitySupport): void { public setAccessibilitySupport(accessibilitySupport: Platform.AccessibilitySupport): void {
if (this._accessibilitySupport === accessibilitySupport) { if (this._accessibilitySupport === accessibilitySupport) {
return; return;
......
...@@ -64,23 +64,23 @@ export class FindInput extends Widget { ...@@ -64,23 +64,23 @@ export class FindInput extends Widget {
public domNode: HTMLElement; public domNode: HTMLElement;
public inputBox: InputBox; public inputBox: InputBox;
private _onDidOptionChange = this._register(new Emitter<boolean>()); private readonly _onDidOptionChange = this._register(new Emitter<boolean>());
public onDidOptionChange: Event<boolean /* via keyboard */> = this._onDidOptionChange.event; public readonly onDidOptionChange: Event<boolean /* via keyboard */> = this._onDidOptionChange.event;
private _onKeyDown = this._register(new Emitter<IKeyboardEvent>()); private readonly _onKeyDown = this._register(new Emitter<IKeyboardEvent>());
public onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event; public readonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;
private _onMouseDown = this._register(new Emitter<IMouseEvent>()); private readonly _onMouseDown = this._register(new Emitter<IMouseEvent>());
public onMouseDown: Event<IMouseEvent> = this._onMouseDown.event; public readonly onMouseDown: Event<IMouseEvent> = this._onMouseDown.event;
private _onInput = this._register(new Emitter<void>()); private readonly _onInput = this._register(new Emitter<void>());
public onInput: Event<void> = this._onInput.event; public readonly onInput: Event<void> = this._onInput.event;
private _onKeyUp = this._register(new Emitter<IKeyboardEvent>()); private readonly _onKeyUp = this._register(new Emitter<IKeyboardEvent>());
public onKeyUp: Event<IKeyboardEvent> = this._onKeyUp.event; public readonly onKeyUp: Event<IKeyboardEvent> = this._onKeyUp.event;
private _onCaseSensitiveKeyDown = this._register(new Emitter<IKeyboardEvent>()); private _onCaseSensitiveKeyDown = this._register(new Emitter<IKeyboardEvent>());
public onCaseSensitiveKeyDown: Event<IKeyboardEvent> = this._onCaseSensitiveKeyDown.event; public readonly onCaseSensitiveKeyDown: Event<IKeyboardEvent> = this._onCaseSensitiveKeyDown.event;
constructor(parent: HTMLElement, contextViewProvider: IContextViewProvider, options?: IFindInputOptions) { constructor(parent: HTMLElement, contextViewProvider: IContextViewProvider, options?: IFindInputOptions) {
super(); super();
......
...@@ -104,10 +104,10 @@ export class InputBox extends Widget { ...@@ -104,10 +104,10 @@ export class InputBox extends Widget {
private inputValidationErrorBackground: Color; private inputValidationErrorBackground: Color;
private _onDidChange = this._register(new Emitter<string>()); private _onDidChange = this._register(new Emitter<string>());
public onDidChange: Event<string> = this._onDidChange.event; public readonly onDidChange: Event<string> = this._onDidChange.event;
private _onDidHeightChange = this._register(new Emitter<number>()); private _onDidHeightChange = this._register(new Emitter<number>());
public onDidHeightChange: Event<number> = this._onDidHeightChange.event; public readonly onDidHeightChange: Event<number> = this._onDidHeightChange.event;
constructor(container: HTMLElement, contextViewProvider: IContextViewProvider, options?: IInputOptions) { constructor(container: HTMLElement, contextViewProvider: IContextViewProvider, options?: IInputOptions) {
super(); super();
......
...@@ -164,7 +164,7 @@ export abstract class AbstractScrollableElement extends Widget { ...@@ -164,7 +164,7 @@ export abstract class AbstractScrollableElement extends Widget {
private _shouldRender: boolean; private _shouldRender: boolean;
private readonly _onScroll = this._register(new Emitter<ScrollEvent>()); private readonly _onScroll = this._register(new Emitter<ScrollEvent>());
public onScroll: Event<ScrollEvent> = this._onScroll.event; public readonly onScroll: Event<ScrollEvent> = this._onScroll.event;
protected constructor(element: HTMLElement, options: ScrollableElementCreationOptions, scrollable?: Scrollable) { protected constructor(element: HTMLElement, options: ScrollableElementCreationOptions, scrollable?: Scrollable) {
super(); super();
......
...@@ -186,7 +186,7 @@ export class Scrollable extends Disposable { ...@@ -186,7 +186,7 @@ export class Scrollable extends Disposable {
private _smoothScrolling: SmoothScrollingOperation; private _smoothScrolling: SmoothScrollingOperation;
private _onScroll = this._register(new Emitter<ScrollEvent>()); private _onScroll = this._register(new Emitter<ScrollEvent>());
public onScroll: Event<ScrollEvent> = this._onScroll.event; public readonly onScroll: Event<ScrollEvent> = this._onScroll.event;
constructor(smoothScrollDuration: number, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable) { constructor(smoothScrollDuration: number, scheduleAtNextAnimationFrame: (callback: () => void) => IDisposable) {
super(); super();
......
...@@ -102,7 +102,7 @@ class CSSBasedConfiguration extends Disposable { ...@@ -102,7 +102,7 @@ class CSSBasedConfiguration extends Disposable {
private _evictUntrustedReadingsTimeout: number; private _evictUntrustedReadingsTimeout: number;
private _onDidChange = this._register(new Emitter<void>()); private _onDidChange = this._register(new Emitter<void>());
public onDidChange: Event<void> = this._onDidChange.event; public readonly onDidChange: Event<void> = this._onDidChange.event;
constructor() { constructor() {
super(); super();
......
...@@ -53,37 +53,37 @@ export interface ITextAreaInputHost { ...@@ -53,37 +53,37 @@ export interface ITextAreaInputHost {
export class TextAreaInput extends Disposable { export class TextAreaInput extends Disposable {
private _onFocus = this._register(new Emitter<void>()); private _onFocus = this._register(new Emitter<void>());
public onFocus: Event<void> = this._onFocus.event; public readonly onFocus: Event<void> = this._onFocus.event;
private _onBlur = this._register(new Emitter<void>()); private _onBlur = this._register(new Emitter<void>());
public onBlur: Event<void> = this._onBlur.event; public readonly onBlur: Event<void> = this._onBlur.event;
private _onKeyDown = this._register(new Emitter<IKeyboardEvent>()); private _onKeyDown = this._register(new Emitter<IKeyboardEvent>());
public onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event; public readonly onKeyDown: Event<IKeyboardEvent> = this._onKeyDown.event;
private _onKeyUp = this._register(new Emitter<IKeyboardEvent>()); private _onKeyUp = this._register(new Emitter<IKeyboardEvent>());
public onKeyUp: Event<IKeyboardEvent> = this._onKeyUp.event; public readonly onKeyUp: Event<IKeyboardEvent> = this._onKeyUp.event;
private _onCut = this._register(new Emitter<void>()); private _onCut = this._register(new Emitter<void>());
public onCut: Event<void> = this._onCut.event; public readonly onCut: Event<void> = this._onCut.event;
private _onPaste = this._register(new Emitter<IPasteData>()); private _onPaste = this._register(new Emitter<IPasteData>());
public onPaste: Event<IPasteData> = this._onPaste.event; public readonly onPaste: Event<IPasteData> = this._onPaste.event;
private _onType = this._register(new Emitter<ITypeData>()); private _onType = this._register(new Emitter<ITypeData>());
public onType: Event<ITypeData> = this._onType.event; public readonly onType: Event<ITypeData> = this._onType.event;
private _onCompositionStart = this._register(new Emitter<void>()); private _onCompositionStart = this._register(new Emitter<void>());
public onCompositionStart: Event<void> = this._onCompositionStart.event; public readonly onCompositionStart: Event<void> = this._onCompositionStart.event;
private _onCompositionUpdate = this._register(new Emitter<ICompositionData>()); private _onCompositionUpdate = this._register(new Emitter<ICompositionData>());
public onCompositionUpdate: Event<ICompositionData> = this._onCompositionUpdate.event; public readonly onCompositionUpdate: Event<ICompositionData> = this._onCompositionUpdate.event;
private _onCompositionEnd = this._register(new Emitter<void>()); private _onCompositionEnd = this._register(new Emitter<void>());
public onCompositionEnd: Event<void> = this._onCompositionEnd.event; public readonly onCompositionEnd: Event<void> = this._onCompositionEnd.event;
private _onSelectionChangeRequest = this._register(new Emitter<Selection>()); private _onSelectionChangeRequest = this._register(new Emitter<Selection>());
public onSelectionChangeRequest: Event<Selection> = this._onSelectionChangeRequest.event; public readonly onSelectionChangeRequest: Event<Selection> = this._onSelectionChangeRequest.event;
// --- // ---
......
...@@ -456,7 +456,7 @@ class CodeEditorWidgetFocusTracker extends Disposable { ...@@ -456,7 +456,7 @@ class CodeEditorWidgetFocusTracker extends Disposable {
private _domFocusTracker: dom.IFocusTracker; private _domFocusTracker: dom.IFocusTracker;
private _onChange: Emitter<void> = this._register(new Emitter<void>()); private _onChange: Emitter<void> = this._register(new Emitter<void>());
public onChange: Event<void> = this._onChange.event; public readonly onChange: Event<void> = this._onChange.event;
constructor(domElement: HTMLElement) { constructor(domElement: HTMLElement) {
super(); super();
......
...@@ -35,7 +35,7 @@ export const TabFocus: ITabFocus = new class implements ITabFocus { ...@@ -35,7 +35,7 @@ export const TabFocus: ITabFocus = new class implements ITabFocus {
private _tabFocus: boolean = false; private _tabFocus: boolean = false;
private _onDidChangeTabFocus: Emitter<boolean> = new Emitter<boolean>(); private _onDidChangeTabFocus: Emitter<boolean> = new Emitter<boolean>();
public onDidChangeTabFocus: Event<boolean> = this._onDidChangeTabFocus.event; public readonly onDidChangeTabFocus: Event<boolean> = this._onDidChangeTabFocus.event;
public getTabFocusMode(): boolean { public getTabFocusMode(): boolean {
return this._tabFocus; return this._tabFocus;
...@@ -70,7 +70,7 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed ...@@ -70,7 +70,7 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed
private _lineNumbersDigitCount: number; private _lineNumbersDigitCount: number;
private _onDidChange = this._register(new Emitter<editorOptions.IConfigurationChangedEvent>()); private _onDidChange = this._register(new Emitter<editorOptions.IConfigurationChangedEvent>());
public onDidChange: Event<editorOptions.IConfigurationChangedEvent> = this._onDidChange.event; public readonly onDidChange: Event<editorOptions.IConfigurationChangedEvent> = this._onDidChange.event;
constructor(options: editorOptions.IEditorOptions) { constructor(options: editorOptions.IEditorOptions) {
super(); super();
......
...@@ -17,7 +17,7 @@ export const EditorZoom: IEditorZoom = new class implements IEditorZoom { ...@@ -17,7 +17,7 @@ export const EditorZoom: IEditorZoom = new class implements IEditorZoom {
private _zoomLevel: number = 0; private _zoomLevel: number = 0;
private _onDidChangeZoomLevel: Emitter<number> = new Emitter<number>(); private _onDidChangeZoomLevel: Emitter<number> = new Emitter<number>();
public onDidChangeZoomLevel: Event<number> = this._onDidChangeZoomLevel.event; public readonly onDidChangeZoomLevel: Event<number> = this._onDidChangeZoomLevel.event;
public getZoomLevel(): number { public getZoomLevel(): number {
return this._zoomLevel; return this._zoomLevel;
......
...@@ -178,7 +178,7 @@ export class LanguageConfigurationRegistryImpl { ...@@ -178,7 +178,7 @@ export class LanguageConfigurationRegistryImpl {
private _entries: RichEditSupport[]; private _entries: RichEditSupport[];
private _onDidChange: Emitter<LanguageConfigurationChangeEvent> = new Emitter<LanguageConfigurationChangeEvent>(); private _onDidChange: Emitter<LanguageConfigurationChangeEvent> = new Emitter<LanguageConfigurationChangeEvent>();
public onDidChange: Event<LanguageConfigurationChangeEvent> = this._onDidChange.event; public readonly onDidChange: Event<LanguageConfigurationChangeEvent> = this._onDidChange.event;
constructor() { constructor() {
this._entries = []; this._entries = [];
......
...@@ -21,7 +21,7 @@ export class EditorModesRegistry { ...@@ -21,7 +21,7 @@ export class EditorModesRegistry {
private _languages: ILanguageExtensionPoint[]; private _languages: ILanguageExtensionPoint[];
private _onDidAddLanguages: Emitter<ILanguageExtensionPoint[]> = new Emitter<ILanguageExtensionPoint[]>(); private _onDidAddLanguages: Emitter<ILanguageExtensionPoint[]> = new Emitter<ILanguageExtensionPoint[]>();
public onDidAddLanguages: Event<ILanguageExtensionPoint[]> = this._onDidAddLanguages.event; public readonly onDidAddLanguages: Event<ILanguageExtensionPoint[]> = this._onDidAddLanguages.event;
constructor() { constructor() {
this._languages = []; this._languages = [];
......
...@@ -14,7 +14,7 @@ export class TokenizationRegistryImpl implements ITokenizationRegistry { ...@@ -14,7 +14,7 @@ export class TokenizationRegistryImpl implements ITokenizationRegistry {
private _map: { [language: string]: ITokenizationSupport }; private _map: { [language: string]: ITokenizationSupport };
private _onDidChange: Emitter<ITokenizationSupportChangedEvent> = new Emitter<ITokenizationSupportChangedEvent>(); private _onDidChange: Emitter<ITokenizationSupportChangedEvent> = new Emitter<ITokenizationSupportChangedEvent>();
public onDidChange: Event<ITokenizationSupportChangedEvent> = this._onDidChange.event; public readonly onDidChange: Event<ITokenizationSupportChangedEvent> = this._onDidChange.event;
private _colorMap: Color[]; private _colorMap: Color[];
......
...@@ -21,7 +21,7 @@ export class MinimapTokensColorTracker { ...@@ -21,7 +21,7 @@ export class MinimapTokensColorTracker {
private _backgroundIsLight: boolean; private _backgroundIsLight: boolean;
private _onDidChange = new Emitter<void>(); private _onDidChange = new Emitter<void>();
public onDidChange: Event<void> = this._onDidChange.event; public readonly onDidChange: Event<void> = this._onDidChange.event;
private constructor() { private constructor() {
this._updateColorMap(); this._updateColorMap();
......
...@@ -472,7 +472,7 @@ export class SimpleConfigurationService implements IConfigurationService { ...@@ -472,7 +472,7 @@ export class SimpleConfigurationService implements IConfigurationService {
_serviceBrand: any; _serviceBrand: any;
private _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>(); private _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>();
public onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event; public readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event;
private _configuration: Configuration; private _configuration: Configuration;
......
...@@ -58,7 +58,7 @@ suite('TokenizationSupport2Adapter', () => { ...@@ -58,7 +58,7 @@ suite('TokenizationSupport2Adapter', () => {
} }
}; };
} }
public onThemeChange: Event<ITheme> = null; public readonly onThemeChange: Event<ITheme> = null;
} }
class MockState implements IState { class MockState implements IState {
......
...@@ -23,7 +23,7 @@ export class ExtensionEnablementService implements IExtensionEnablementService { ...@@ -23,7 +23,7 @@ export class ExtensionEnablementService implements IExtensionEnablementService {
private disposables: IDisposable[] = []; private disposables: IDisposable[] = [];
private _onEnablementChanged = new Emitter<IExtensionIdentifier>(); private _onEnablementChanged = new Emitter<IExtensionIdentifier>();
public onEnablementChanged: Event<IExtensionIdentifier> = this._onEnablementChanged.event; public readonly onEnablementChanged: Event<IExtensionIdentifier> = this._onEnablementChanged.event;
constructor( constructor(
@IStorageService private storageService: IStorageService, @IStorageService private storageService: IStorageService,
......
...@@ -249,5 +249,5 @@ export class MockSession implements ISession { ...@@ -249,5 +249,5 @@ export class MockSession implements ISession {
return TPromise.as(null); return TPromise.as(null);
} }
public onDidStop: Event<DebugProtocol.StoppedEvent> = null; public readonly onDidStop: Event<DebugProtocol.StoppedEvent> = null;
} }
...@@ -399,7 +399,7 @@ class PreferencesRenderersController extends Disposable { ...@@ -399,7 +399,7 @@ class PreferencesRenderersController extends Disposable {
private _lastFilterResult: IFilterResult; private _lastFilterResult: IFilterResult;
private _onDidFilterResultsCountChange: Emitter<IPreferencesCount> = this._register(new Emitter<IPreferencesCount>()); private _onDidFilterResultsCountChange: Emitter<IPreferencesCount> = this._register(new Emitter<IPreferencesCount>());
public onDidFilterResultsCountChange: Event<IPreferencesCount> = this._onDidFilterResultsCountChange.event; public readonly onDidFilterResultsCountChange: Event<IPreferencesCount> = this._onDidFilterResultsCountChange.event;
constructor( constructor(
@IPreferencesSearchService private preferencesSearchService: IPreferencesSearchService, @IPreferencesSearchService private preferencesSearchService: IPreferencesSearchService,
......
...@@ -465,7 +465,7 @@ export class BracesHidingRenderer extends Disposable implements HiddenAreasProvi ...@@ -465,7 +465,7 @@ export class BracesHidingRenderer extends Disposable implements HiddenAreasProvi
class DefaultSettingsHeaderRenderer extends Disposable { class DefaultSettingsHeaderRenderer extends Disposable {
private settingsHeaderWidget: DefaultSettingsHeaderWidget; private settingsHeaderWidget: DefaultSettingsHeaderWidget;
public onClick: Event<void>; public readonly onClick: Event<void>;
constructor(editor: ICodeEditor, scope: ConfigurationScope) { constructor(editor: ICodeEditor, scope: ConfigurationScope) {
super(); super();
......
...@@ -102,7 +102,7 @@ export class SettingsHeaderWidget extends Widget implements IViewZone { ...@@ -102,7 +102,7 @@ export class SettingsHeaderWidget extends Widget implements IViewZone {
export class DefaultSettingsHeaderWidget extends SettingsHeaderWidget { export class DefaultSettingsHeaderWidget extends SettingsHeaderWidget {
private _onClick = this._register(new Emitter<void>()); private _onClick = this._register(new Emitter<void>());
public onClick: Event<void> = this._onClick.event; public readonly onClick: Event<void> = this._onClick.event;
protected create() { protected create() {
super.create(); super.create();
...@@ -130,7 +130,7 @@ export class SettingsGroupTitleWidget extends Widget implements IViewZone { ...@@ -130,7 +130,7 @@ export class SettingsGroupTitleWidget extends Widget implements IViewZone {
private title: HTMLElement; private title: HTMLElement;
private _onToggled = this._register(new Emitter<boolean>()); private _onToggled = this._register(new Emitter<boolean>());
public onToggled: Event<boolean> = this._onToggled.event; public readonly onToggled: Event<boolean> = this._onToggled.event;
private previousPosition: Position; private previousPosition: Position;
...@@ -706,7 +706,7 @@ export class FloatingClickWidget extends Widget implements IOverlayWidget { ...@@ -706,7 +706,7 @@ export class FloatingClickWidget extends Widget implements IOverlayWidget {
private _domNode: HTMLElement; private _domNode: HTMLElement;
private _onClick: Emitter<void> = this._register(new Emitter<void>()); private _onClick: Emitter<void> = this._register(new Emitter<void>());
public onClick: Event<void> = this._onClick.event; public readonly onClick: Event<void> = this._onClick.event;
constructor( constructor(
private editor: ICodeEditor, private editor: ICodeEditor,
......
...@@ -100,22 +100,22 @@ export class SearchWidget extends Widget { ...@@ -100,22 +100,22 @@ export class SearchWidget extends Widget {
private previousGlobalFindBufferValue: string; private previousGlobalFindBufferValue: string;
private _onSearchSubmit = this._register(new Emitter<boolean>()); private _onSearchSubmit = this._register(new Emitter<boolean>());
public onSearchSubmit: Event<boolean> = this._onSearchSubmit.event; public readonly onSearchSubmit: Event<boolean> = this._onSearchSubmit.event;
private _onSearchCancel = this._register(new Emitter<void>()); private _onSearchCancel = this._register(new Emitter<void>());
public onSearchCancel: Event<void> = this._onSearchCancel.event; public readonly onSearchCancel: Event<void> = this._onSearchCancel.event;
private _onReplaceToggled = this._register(new Emitter<void>()); private _onReplaceToggled = this._register(new Emitter<void>());
public onReplaceToggled: Event<void> = this._onReplaceToggled.event; public readonly onReplaceToggled: Event<void> = this._onReplaceToggled.event;
private _onReplaceStateChange = this._register(new Emitter<boolean>()); private _onReplaceStateChange = this._register(new Emitter<boolean>());
public onReplaceStateChange: Event<boolean> = this._onReplaceStateChange.event; public readonly onReplaceStateChange: Event<boolean> = this._onReplaceStateChange.event;
private _onReplaceValueChanged = this._register(new Emitter<string>()); private _onReplaceValueChanged = this._register(new Emitter<string>());
public onReplaceValueChanged: Event<string> = this._onReplaceValueChanged.event; public readonly onReplaceValueChanged: Event<string> = this._onReplaceValueChanged.event;
private _onReplaceAll = this._register(new Emitter<void>()); private _onReplaceAll = this._register(new Emitter<void>());
public onReplaceAll: Event<void> = this._onReplaceAll.event; public readonly onReplaceAll: Event<void> = this._onReplaceAll.event;
constructor( constructor(
container: Builder, container: Builder,
......
...@@ -118,10 +118,10 @@ export class FileMatch extends Disposable { ...@@ -118,10 +118,10 @@ export class FileMatch extends Disposable {
} }
private _onChange = this._register(new Emitter<boolean>()); private _onChange = this._register(new Emitter<boolean>());
public onChange: Event<boolean> = this._onChange.event; public readonly onChange: Event<boolean> = this._onChange.event;
private _onDispose = this._register(new Emitter<void>()); private _onDispose = this._register(new Emitter<void>());
public onDispose: Event<void> = this._onDispose.event; public readonly onDispose: Event<void> = this._onDispose.event;
private _resource: URI; private _resource: URI;
private _model: ITextModel; private _model: ITextModel;
...@@ -338,10 +338,10 @@ export interface IChangeEvent { ...@@ -338,10 +338,10 @@ export interface IChangeEvent {
export class FolderMatch extends Disposable { export class FolderMatch extends Disposable {
private _onChange = this._register(new Emitter<IChangeEvent>()); private _onChange = this._register(new Emitter<IChangeEvent>());
public onChange: Event<IChangeEvent> = this._onChange.event; public readonly onChange: Event<IChangeEvent> = this._onChange.event;
private _onDispose = this._register(new Emitter<void>()); private _onDispose = this._register(new Emitter<void>());
public onDispose: Event<void> = this._onDispose.event; public readonly onDispose: Event<void> = this._onDispose.event;
private _fileMatches: ResourceMap<FileMatch>; private _fileMatches: ResourceMap<FileMatch>;
private _unDisposedFileMatches: ResourceMap<FileMatch>; private _unDisposedFileMatches: ResourceMap<FileMatch>;
...@@ -499,7 +499,7 @@ export class FolderMatch extends Disposable { ...@@ -499,7 +499,7 @@ export class FolderMatch extends Disposable {
export class SearchResult extends Disposable { export class SearchResult extends Disposable {
private _onChange = this._register(new Emitter<IChangeEvent>()); private _onChange = this._register(new Emitter<IChangeEvent>());
public onChange: Event<IChangeEvent> = this._onChange.event; public readonly onChange: Event<IChangeEvent> = this._onChange.event;
private _folderMatches: FolderMatch[] = []; private _folderMatches: FolderMatch[] = [];
private _folderMatchesMap: TernarySearchTree<FolderMatch> = TernarySearchTree.forPaths<FolderMatch>(); private _folderMatchesMap: TernarySearchTree<FolderMatch> = TernarySearchTree.forPaths<FolderMatch>();
...@@ -683,7 +683,7 @@ export class SearchModel extends Disposable { ...@@ -683,7 +683,7 @@ export class SearchModel extends Disposable {
private _replacePattern: ReplacePattern = null; private _replacePattern: ReplacePattern = null;
private _onReplaceTermChanged: Emitter<void> = this._register(new Emitter<void>()); private _onReplaceTermChanged: Emitter<void> = this._register(new Emitter<void>());
public onReplaceTermChanged: Event<void> = this._onReplaceTermChanged.event; public readonly onReplaceTermChanged: Event<void> = this._onReplaceTermChanged.event;
private currentRequest: PPromise<ISearchComplete, ISearchProgressItem>; private currentRequest: PPromise<ISearchComplete, ISearchProgressItem>;
......
...@@ -47,7 +47,7 @@ export class KeyboardMapperFactory { ...@@ -47,7 +47,7 @@ export class KeyboardMapperFactory {
private _initialized: boolean; private _initialized: boolean;
private _onDidChangeKeyboardMapper: Emitter<void> = new Emitter<void>(); private _onDidChangeKeyboardMapper: Emitter<void> = new Emitter<void>();
public onDidChangeKeyboardMapper: Event<void> = this._onDidChangeKeyboardMapper.event; public readonly onDidChangeKeyboardMapper: Event<void> = this._onDidChangeKeyboardMapper.event;
private constructor() { private constructor() {
this._layoutInfo = null; this._layoutInfo = null;
......
...@@ -29,7 +29,7 @@ export class TMScopeRegistry { ...@@ -29,7 +29,7 @@ export class TMScopeRegistry {
private _encounteredLanguages: boolean[]; private _encounteredLanguages: boolean[];
private _onDidEncounterLanguage: Emitter<LanguageId> = new Emitter<LanguageId>(); private _onDidEncounterLanguage: Emitter<LanguageId> = new Emitter<LanguageId>();
public onDidEncounterLanguage: Event<LanguageId> = this._onDidEncounterLanguage.event; public readonly onDidEncounterLanguage: Event<LanguageId> = this._onDidEncounterLanguage.event;
constructor() { constructor() {
this._scopeNameToLanguageRegistration = Object.create(null); this._scopeNameToLanguageRegistration = Object.create(null);
...@@ -122,7 +122,7 @@ export class TextMateService implements ITextMateService { ...@@ -122,7 +122,7 @@ export class TextMateService implements ITextMateService {
private _currentTokenColors: ITokenColorizationRule[]; private _currentTokenColors: ITokenColorizationRule[];
public onDidEncounterLanguage: Event<LanguageId>; public readonly onDidEncounterLanguage: Event<LanguageId>;
constructor( constructor(
@IModeService modeService: IModeService, @IModeService modeService: IModeService,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册