debt - make bulkEdit a service so that we can add create/delete/rename file to it

This commit is contained in:
Johannes Rieken
2018-04-30 12:30:12 +02:00
parent 8d139ed565
commit 727774d6bc
13 changed files with 224 additions and 125 deletions

View File

@@ -30,14 +30,13 @@ import { isFalsyOrEmpty } from 'vs/base/common/arrays';
import { ILogService } from 'vs/platform/log/common/log';
import { shouldSynchronizeModel } from 'vs/editor/common/services/modelService';
import { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2';
import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IFileService } from 'vs/platform/files/common/files';
import { CodeActionKind } from 'vs/editor/contrib/codeAction/codeActionTrigger';
import { CodeAction } from 'vs/editor/common/modes';
import { applyCodeAction } from 'vs/editor/contrib/codeAction/codeActionCommands';
import { getCodeActions } from 'vs/editor/contrib/codeAction/codeAction';
import { ICodeActionsOnSaveOptions } from 'vs/editor/common/config/editorOptions';
import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService';
export interface ISaveParticipantParticipant extends ISaveParticipant {
// progressMessage: string;
@@ -270,8 +269,7 @@ class FormatOnSaveParticipant implements ISaveParticipantParticipant {
class CodeActionOnParticipant implements ISaveParticipant {
constructor(
@ITextModelService private readonly _textModelService: ITextModelService,
@IFileService private readonly _fileService: IFileService,
@IBulkEditService private readonly _bulkEditService: IBulkEditService,
@ICommandService private readonly _commandService: ICommandService,
@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,
@IConfigurationService private readonly _configurationService: IConfigurationService
@@ -309,7 +307,7 @@ class CodeActionOnParticipant implements ISaveParticipant {
private async applyCodeActions(actionsToRun: CodeAction[], editor: ICodeEditor) {
for (const action of actionsToRun) {
await applyCodeAction(action, this._textModelService, this._fileService, this._commandService, editor);
await applyCodeAction(action, this._bulkEditService, this._commandService, editor);
}
}