mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
debt - use Event over EventSource
This commit is contained in:
@@ -300,8 +300,8 @@ export class MainThreadEditorsTracker {
|
||||
onLostFocus: () => this._updateFocusedTextEditor()
|
||||
};
|
||||
|
||||
this._modelService.onModelAdded.add(this._onModelAdded, this, this._toDispose);
|
||||
this._modelService.onModelRemoved.add(this._onModelRemoved, this, this._toDispose);
|
||||
this._modelService.onModelAdded(this._onModelAdded, this, this._toDispose);
|
||||
this._modelService.onModelRemoved(this._onModelRemoved, this, this._toDispose);
|
||||
|
||||
this._codeEditorService.onCodeEditorAdd(this._onCodeEditorAdd, this, this._toDispose);
|
||||
this._codeEditorService.onCodeEditorRemove(this._onCodeEditorRemove, this, this._toDispose);
|
||||
|
||||
@@ -552,9 +552,9 @@ export class MainThreadDocuments {
|
||||
this._modelIsSynced = {};
|
||||
|
||||
this._toDispose = [];
|
||||
modelService.onModelAdded.add(this._onModelAdded, this, this._toDispose);
|
||||
modelService.onModelRemoved.add(this._onModelRemoved, this, this._toDispose);
|
||||
modelService.onModelModeChanged.add(this._onModelModeChanged, this, this._toDispose);
|
||||
modelService.onModelAdded(this._onModelAdded, this, this._toDispose);
|
||||
modelService.onModelRemoved(this._onModelRemoved, this, this._toDispose);
|
||||
modelService.onModelModeChanged(this._onModelModeChanged, this, this._toDispose);
|
||||
|
||||
this._toDispose.push(eventService.addListener2(FileEventType.FILE_SAVED, (e: LocalFileChangeEvent) => {
|
||||
this._proxy._acceptModelSaved(e.getAfter().resource);
|
||||
@@ -595,7 +595,8 @@ export class MainThreadDocuments {
|
||||
});
|
||||
}
|
||||
|
||||
private _onModelModeChanged(model: EditorCommon.IModel, oldModeId:string): void {
|
||||
private _onModelModeChanged(event: { model: EditorCommon.IModel; oldModeId: string;}): void {
|
||||
let {model, oldModeId} = event;
|
||||
let modelUrl = model.getAssociatedResource();
|
||||
if (!this._modelIsSynced[modelUrl.toString()]) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user