mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
Get rid of IEventService in favour of real events (#17515)
This commit is contained in:
@@ -11,7 +11,6 @@ import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IEventService } from 'vs/platform/event/common/event';
|
||||
import { TextFileModelChangeEvent, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
@@ -39,7 +38,6 @@ export class MainThreadDocuments extends MainThreadDocumentsShape {
|
||||
@IThreadService threadService: IThreadService,
|
||||
@IModelService modelService: IModelService,
|
||||
@IModeService modeService: IModeService,
|
||||
@IEventService eventService: IEventService,
|
||||
@ITextFileService textFileService: ITextFileService,
|
||||
@ICodeEditorService codeEditorService: ICodeEditorService,
|
||||
@IFileService fileService: IFileService,
|
||||
|
||||
@@ -16,7 +16,6 @@ import { Position as EditorPosition } from 'vs/platform/editor/common/editor';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { MainThreadEditorsTracker, TextEditorRevealType, MainThreadTextEditor, IApplyEditsOptions, ITextEditorConfigurationUpdate } from 'vs/workbench/api/node/mainThreadEditorsTracker';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IEventService } from 'vs/platform/event/common/event';
|
||||
import { equals as arrayEquals } from 'vs/base/common/arrays';
|
||||
import { equals as objectEquals } from 'vs/base/common/objects';
|
||||
import { ExtHostContext, MainThreadEditorsShape, ExtHostEditorsShape, ITextEditorPositionData } from './extHost.protocol';
|
||||
@@ -40,7 +39,6 @@ export class MainThreadEditors extends MainThreadEditorsShape {
|
||||
@IEditorGroupService editorGroupService: IEditorGroupService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@ICodeEditorService editorService: ICodeEditorService,
|
||||
@IEventService eventService: IEventService,
|
||||
@IModelService modelService: IModelService
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -4,15 +4,17 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { FileChangesEvent, FileChangeType } from 'vs/platform/files/common/files';
|
||||
import { FileChangeType, IFileService } from 'vs/platform/files/common/files';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { IEventService } from 'vs/platform/event/common/event';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { ExtHostContext, ExtHostFileSystemEventServiceShape, FileSystemEvents } from './extHost.protocol';
|
||||
|
||||
export class MainThreadFileSystemEventService {
|
||||
|
||||
constructor( @IEventService eventService: IEventService, @IThreadService threadService: IThreadService) {
|
||||
constructor(
|
||||
@IThreadService threadService: IThreadService,
|
||||
@IFileService fileService: IFileService
|
||||
) {
|
||||
|
||||
const proxy: ExtHostFileSystemEventServiceShape = threadService.get(ExtHostContext.ExtHostFileSystemEventService);
|
||||
const events: FileSystemEvents = {
|
||||
@@ -28,7 +30,7 @@ export class MainThreadFileSystemEventService {
|
||||
events.deleted.length = 0;
|
||||
}, 100);
|
||||
|
||||
eventService.addListener2('files:fileChanges', (event: FileChangesEvent) => {
|
||||
fileService.onFileChanges(event => {
|
||||
for (let change of event.changes) {
|
||||
switch (change.type) {
|
||||
case FileChangeType.ADDED:
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
import { isPromiseCanceledError } from 'vs/base/common/errors';
|
||||
import { ISearchService, QueryType } from 'vs/platform/search/common/search';
|
||||
import { IWorkspaceContextService, IWorkspace } from 'vs/platform/workspace/common/workspace';
|
||||
import { IEventService } from 'vs/platform/event/common/event';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
|
||||
@@ -16,6 +15,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { Uri } from 'vscode';
|
||||
import { MainThreadWorkspaceShape } from './extHost.protocol';
|
||||
import { ITextModelResolverService } from 'vs/editor/common/services/resolverService';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
|
||||
export class MainThreadWorkspace extends MainThreadWorkspaceShape {
|
||||
|
||||
@@ -25,7 +25,7 @@ export class MainThreadWorkspace extends MainThreadWorkspaceShape {
|
||||
private _textFileService: ITextFileService;
|
||||
private _editorService: IWorkbenchEditorService;
|
||||
private _textModelResolverService: ITextModelResolverService;
|
||||
private _eventService: IEventService;
|
||||
private _fileService: IFileService;
|
||||
|
||||
constructor(
|
||||
@ISearchService searchService: ISearchService,
|
||||
@@ -33,7 +33,7 @@ export class MainThreadWorkspace extends MainThreadWorkspaceShape {
|
||||
@ITextFileService textFileService,
|
||||
@IWorkbenchEditorService editorService,
|
||||
@ITextModelResolverService textModelResolverService,
|
||||
@IEventService eventService
|
||||
@IFileService fileService: IFileService
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -41,7 +41,7 @@ export class MainThreadWorkspace extends MainThreadWorkspaceShape {
|
||||
this._workspace = contextService.getWorkspace();
|
||||
this._textFileService = textFileService;
|
||||
this._editorService = editorService;
|
||||
this._eventService = eventService;
|
||||
this._fileService = fileService;
|
||||
this._textModelResolverService = textModelResolverService;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ export class MainThreadWorkspace extends MainThreadWorkspaceShape {
|
||||
}
|
||||
}
|
||||
|
||||
return bulkEdit(this._eventService, this._textModelResolverService, codeEditor, edits)
|
||||
return bulkEdit(this._fileService, this._textModelResolverService, codeEditor, edits)
|
||||
.then(() => true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user