bulk - some renames and some polish
This commit is contained in:
parent
f8a19b58c7
commit
2982c6296a
12 changed files with 67 additions and 57 deletions
|
@ -1240,31 +1240,41 @@ export class FoldingRangeKind {
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function isResourceFileEdit(thing: any): thing is ResourceFileEdit {
|
||||
return isObject(thing) && (Boolean((<ResourceFileEdit>thing).newUri) || Boolean((<ResourceFileEdit>thing).oldUri));
|
||||
export namespace WorkspaceFileEdit {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function is(thing: any): thing is WorkspaceFileEdit {
|
||||
return isObject(thing) && (Boolean((<WorkspaceFileEdit>thing).newUri) || Boolean((<WorkspaceFileEdit>thing).oldUri));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function isResourceTextEdit(thing: any): thing is ResourceTextEdit {
|
||||
return isObject(thing) && (<ResourceTextEdit>thing).resource && Array.isArray((<ResourceTextEdit>thing).edits);
|
||||
export namespace WorkspaceTextEdit {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function is(thing: any): thing is WorkspaceTextEdit {
|
||||
return isObject(thing) && (<WorkspaceTextEdit>thing).resource && Array.isArray((<WorkspaceTextEdit>thing).edits);
|
||||
}
|
||||
}
|
||||
|
||||
export interface ResourceFileEdit {
|
||||
export interface WorkspaceFileEdit {
|
||||
oldUri?: URI;
|
||||
newUri?: URI;
|
||||
options?: { overwrite?: boolean, ignoreIfNotExists?: boolean, ignoreIfExists?: boolean, recursive?: boolean };
|
||||
}
|
||||
|
||||
export interface ResourceTextEdit {
|
||||
export interface WorkspaceTextEdit {
|
||||
resource: URI;
|
||||
modelVersionId?: number;
|
||||
edits: TextEdit[];
|
||||
}
|
||||
|
||||
export interface WorkspaceEdit {
|
||||
edits: Array<ResourceTextEdit | ResourceFileEdit>;
|
||||
edits: Array<WorkspaceTextEdit | WorkspaceFileEdit>;
|
||||
}
|
||||
|
||||
export interface Rejection {
|
||||
|
|
|
@ -69,7 +69,7 @@ suite('CodeAction', () => {
|
|||
bcd: {
|
||||
diagnostics: <IMarkerData[]>[],
|
||||
edit: new class implements modes.WorkspaceEdit {
|
||||
edits!: modes.ResourceTextEdit[];
|
||||
edits!: modes.WorkspaceTextEdit[];
|
||||
},
|
||||
title: 'abc'
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import { IPosition, Position as Pos } from 'vs/editor/common/core/position';
|
|||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { IEditor } from 'vs/editor/common/editorCommon';
|
||||
import { ITextModel, ITextSnapshot } from 'vs/editor/common/model';
|
||||
import { TextEdit, WorkspaceEdit, isResourceTextEdit } from 'vs/editor/common/modes';
|
||||
import { TextEdit, WorkspaceEdit, WorkspaceTextEdit } from 'vs/editor/common/modes';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { IResolvedTextEditorModel, ITextModelContentProvider, ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
import { ITextResourceConfigurationService, ITextResourcePropertiesService, ITextResourceConfigurationChangeEvent } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
|
@ -645,7 +645,7 @@ export class SimpleBulkEditService implements IBulkEditService {
|
|||
|
||||
if (workspaceEdit.edits) {
|
||||
for (let edit of workspaceEdit.edits) {
|
||||
if (!isResourceTextEdit(edit)) {
|
||||
if (!WorkspaceTextEdit.is(edit)) {
|
||||
return Promise.reject(new Error('bad edit - only text edits are supported'));
|
||||
}
|
||||
let model = this._modelService.getModel(edit.resource);
|
||||
|
|
6
src/vs/monaco.d.ts
vendored
6
src/vs/monaco.d.ts
vendored
|
@ -5874,7 +5874,7 @@ declare namespace monaco.languages {
|
|||
constructor(value: string);
|
||||
}
|
||||
|
||||
export interface ResourceFileEdit {
|
||||
export interface WorkspaceFileEdit {
|
||||
oldUri?: Uri;
|
||||
newUri?: Uri;
|
||||
options?: {
|
||||
|
@ -5885,14 +5885,14 @@ declare namespace monaco.languages {
|
|||
};
|
||||
}
|
||||
|
||||
export interface ResourceTextEdit {
|
||||
export interface WorkspaceTextEdit {
|
||||
resource: Uri;
|
||||
modelVersionId?: number;
|
||||
edits: TextEdit[];
|
||||
}
|
||||
|
||||
export interface WorkspaceEdit {
|
||||
edits: Array<ResourceTextEdit | ResourceFileEdit>;
|
||||
edits: Array<WorkspaceTextEdit | WorkspaceFileEdit>;
|
||||
}
|
||||
|
||||
export interface Rejection {
|
||||
|
|
|
@ -8,7 +8,7 @@ import { URI } from 'vs/base/common/uri';
|
|||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { createTextBufferFactoryFromSnapshot } from 'vs/editor/common/model/textModel';
|
||||
import { WorkspaceEdit, isResourceTextEdit, TextEdit, ResourceTextEdit, ResourceFileEdit } from 'vs/editor/common/modes';
|
||||
import { WorkspaceEdit, TextEdit, WorkspaceTextEdit, WorkspaceFileEdit } from 'vs/editor/common/modes';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { mergeSort, coalesceInPlace } from 'vs/base/common/arrays';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
|
@ -59,7 +59,7 @@ export class BulkFileOperation extends CheckedObject {
|
|||
|
||||
type: BulkFileOperationType = 0;
|
||||
textEdits: BulkTextEdit[] = [];
|
||||
originalEdits = new Map<number, ResourceTextEdit | ResourceFileEdit>();
|
||||
originalEdits = new Map<number, WorkspaceTextEdit | WorkspaceFileEdit>();
|
||||
newUri?: URI;
|
||||
|
||||
constructor(
|
||||
|
@ -69,10 +69,10 @@ export class BulkFileOperation extends CheckedObject {
|
|||
super(parent._onDidChangeCheckedState);
|
||||
}
|
||||
|
||||
addEdit(index: number, type: BulkFileOperationType, edit: ResourceTextEdit | ResourceFileEdit, ) {
|
||||
addEdit(index: number, type: BulkFileOperationType, edit: WorkspaceTextEdit | WorkspaceFileEdit, ) {
|
||||
this.type += type;
|
||||
this.originalEdits.set(index, edit);
|
||||
if (isResourceTextEdit(edit)) {
|
||||
if (WorkspaceTextEdit.is(edit)) {
|
||||
this.textEdits = this.textEdits.concat(edit.edits.map(edit => new BulkTextEdit(this, edit, this._emitter)));
|
||||
|
||||
} else if (type === BulkFileOperationType.Rename) {
|
||||
|
@ -117,7 +117,7 @@ export class BulkFileOperations {
|
|||
let uri: URI;
|
||||
let type: BulkFileOperationType;
|
||||
|
||||
if (isResourceTextEdit(edit)) {
|
||||
if (WorkspaceTextEdit.is(edit)) {
|
||||
type = BulkFileOperationType.TextEdit;
|
||||
uri = edit.resource;
|
||||
|
||||
|
@ -194,8 +194,8 @@ export class BulkFileOperations {
|
|||
|
||||
file.originalEdits.forEach((value, idx) => {
|
||||
|
||||
if (isResourceTextEdit(value)) {
|
||||
let newValue: ResourceTextEdit = { ...value, edits: [] };
|
||||
if (WorkspaceTextEdit.is(value)) {
|
||||
let newValue: WorkspaceTextEdit = { ...value, edits: [] };
|
||||
let allEditsAccepted = true;
|
||||
for (let edit of value.edits) {
|
||||
if (!checkedEdits.has(keyOfEdit(edit))) {
|
||||
|
|
|
@ -18,7 +18,7 @@ import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
|||
import { ScrollType } from 'vs/editor/common/editorCommon';
|
||||
import { ITextModel, IIdentifiedSingleEditOperation } from 'vs/editor/common/model';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ResourceTextEdit } from 'vs/editor/common/modes';
|
||||
import { WorkspaceTextEdit } from 'vs/editor/common/modes';
|
||||
import { createTextBufferFactoryFromSnapshot } from 'vs/editor/common/model/textModel';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService';
|
||||
|
@ -101,7 +101,7 @@ export class ReplaceService implements IReplaceService {
|
|||
replace(files: FileMatch[], progress?: IProgress<IProgressStep>): Promise<any>;
|
||||
replace(match: FileMatchOrMatch, progress?: IProgress<IProgressStep>, resource?: URI): Promise<any>;
|
||||
async replace(arg: any, progress: IProgress<IProgressStep> | undefined = undefined, resource: URI | null = null): Promise<any> {
|
||||
const edits: ResourceTextEdit[] = this.createEdits(arg, resource);
|
||||
const edits: WorkspaceTextEdit[] = this.createEdits(arg, resource);
|
||||
await this.bulkEditorService.apply({ edits }, { progress });
|
||||
|
||||
return Promise.all(edits.map(e => {
|
||||
|
@ -173,8 +173,8 @@ export class ReplaceService implements IReplaceService {
|
|||
replaceModel.pushEditOperations([], mergeSort(modelEdits, (a, b) => Range.compareRangesUsingStarts(a.range, b.range)), () => []);
|
||||
}
|
||||
|
||||
private createEdits(arg: FileMatchOrMatch | FileMatch[], resource: URI | null = null): ResourceTextEdit[] {
|
||||
const edits: ResourceTextEdit[] = [];
|
||||
private createEdits(arg: FileMatchOrMatch | FileMatch[], resource: URI | null = null): WorkspaceTextEdit[] {
|
||||
const edits: WorkspaceTextEdit[] = [];
|
||||
|
||||
if (arg instanceof Match) {
|
||||
const match = <Match>arg;
|
||||
|
@ -197,9 +197,9 @@ export class ReplaceService implements IReplaceService {
|
|||
return edits;
|
||||
}
|
||||
|
||||
private createEdit(match: Match, text: string, resource: URI | null = null): ResourceTextEdit {
|
||||
private createEdit(match: Match, text: string, resource: URI | null = null): WorkspaceTextEdit {
|
||||
const fileMatch: FileMatch = match.parent();
|
||||
const resourceEdit: ResourceTextEdit = {
|
||||
const resourceEdit: WorkspaceTextEdit = {
|
||||
resource: resource !== null ? resource : fileMatch.resource,
|
||||
edits: [{
|
||||
range: match.range(),
|
||||
|
|
|
@ -11,7 +11,7 @@ import { IBulkEditOptions, IBulkEditResult, IBulkEditService, IBulkEditPreviewHa
|
|||
import { EditOperation } from 'vs/editor/common/core/editOperation';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { EndOfLineSequence, IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/model';
|
||||
import { isResourceFileEdit, isResourceTextEdit, ResourceFileEdit, ResourceTextEdit, WorkspaceEdit } from 'vs/editor/common/modes';
|
||||
import { WorkspaceFileEdit, WorkspaceTextEdit, WorkspaceEdit } from 'vs/editor/common/modes';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { ITextModelService, IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService';
|
||||
import { localize } from 'vs/nls';
|
||||
|
@ -47,7 +47,7 @@ class ModelEditTask implements IDisposable {
|
|||
this._modelReference.dispose();
|
||||
}
|
||||
|
||||
addEdit(resourceEdit: ResourceTextEdit): void {
|
||||
addEdit(resourceEdit: WorkspaceTextEdit): void {
|
||||
this._expectedModelVersionId = resourceEdit.modelVersionId;
|
||||
for (const edit of resourceEdit.edits) {
|
||||
if (typeof edit.eol === 'number') {
|
||||
|
@ -124,13 +124,13 @@ class EditorEditTask extends ModelEditTask {
|
|||
|
||||
class BulkEditModel implements IDisposable {
|
||||
|
||||
private _edits = new Map<string, ResourceTextEdit[]>();
|
||||
private _edits = new Map<string, WorkspaceTextEdit[]>();
|
||||
private _tasks: ModelEditTask[] | undefined;
|
||||
|
||||
constructor(
|
||||
private readonly _editor: ICodeEditor | undefined,
|
||||
private readonly _progress: IProgress<void>,
|
||||
edits: ResourceTextEdit[],
|
||||
edits: WorkspaceTextEdit[],
|
||||
@IEditorWorkerService private readonly _editorWorker: IEditorWorkerService,
|
||||
@ITextModelService private readonly _textModelResolverService: ITextModelService,
|
||||
) {
|
||||
|
@ -143,7 +143,7 @@ class BulkEditModel implements IDisposable {
|
|||
}
|
||||
}
|
||||
|
||||
private _addEdit(edit: ResourceTextEdit): void {
|
||||
private _addEdit(edit: WorkspaceTextEdit): void {
|
||||
let array = this._edits.get(edit.resource.toString());
|
||||
if (!array) {
|
||||
array = [];
|
||||
|
@ -217,7 +217,7 @@ class BulkEditModel implements IDisposable {
|
|||
}
|
||||
}
|
||||
|
||||
type Edit = ResourceFileEdit | ResourceTextEdit;
|
||||
type Edit = WorkspaceFileEdit | WorkspaceTextEdit;
|
||||
|
||||
class BulkEdit {
|
||||
|
||||
|
@ -243,7 +243,7 @@ class BulkEdit {
|
|||
}
|
||||
|
||||
ariaMessage(): string {
|
||||
const editCount = this._edits.reduce((prev, cur) => isResourceFileEdit(cur) ? prev : prev + cur.edits.length, 0);
|
||||
const editCount = this._edits.reduce((prev, cur) => WorkspaceFileEdit.is(cur) ? prev : prev + cur.edits.length, 0);
|
||||
const resourceCount = this._edits.length;
|
||||
if (editCount === 0) {
|
||||
return localize('summary.0', "Made no edits");
|
||||
|
@ -263,15 +263,15 @@ class BulkEdit {
|
|||
let group: Edit[] | undefined;
|
||||
for (const edit of this._edits) {
|
||||
if (!group
|
||||
|| (isResourceFileEdit(group[0]) && !isResourceFileEdit(edit))
|
||||
|| (isResourceTextEdit(group[0]) && !isResourceTextEdit(edit))
|
||||
|| (WorkspaceFileEdit.is(group[0]) && !WorkspaceFileEdit.is(edit))
|
||||
|| (WorkspaceTextEdit.is(group[0]) && !WorkspaceTextEdit.is(edit))
|
||||
) {
|
||||
group = [];
|
||||
groups.push(group);
|
||||
}
|
||||
group.push(edit);
|
||||
|
||||
if (isResourceFileEdit(edit)) {
|
||||
if (WorkspaceFileEdit.is(edit)) {
|
||||
total += 1;
|
||||
} else if (!seen.has(edit.resource.toString())) {
|
||||
seen.add(edit.resource.toString());
|
||||
|
@ -287,15 +287,15 @@ class BulkEdit {
|
|||
|
||||
// do it.
|
||||
for (const group of groups) {
|
||||
if (isResourceFileEdit(group[0])) {
|
||||
await this._performFileEdits(<ResourceFileEdit[]>group, progress);
|
||||
if (WorkspaceFileEdit.is(group[0])) {
|
||||
await this._performFileEdits(<WorkspaceFileEdit[]>group, progress);
|
||||
} else {
|
||||
await this._performTextEdits(<ResourceTextEdit[]>group, progress);
|
||||
await this._performTextEdits(<WorkspaceTextEdit[]>group, progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async _performFileEdits(edits: ResourceFileEdit[], progress: IProgress<void>) {
|
||||
private async _performFileEdits(edits: WorkspaceFileEdit[], progress: IProgress<void>) {
|
||||
this._logService.debug('_performFileEdits', JSON.stringify(edits));
|
||||
for (const edit of edits) {
|
||||
progress.report(undefined);
|
||||
|
@ -330,7 +330,7 @@ class BulkEdit {
|
|||
}
|
||||
}
|
||||
|
||||
private async _performTextEdits(edits: ResourceTextEdit[], progress: IProgress<void>): Promise<void> {
|
||||
private async _performTextEdits(edits: WorkspaceTextEdit[], progress: IProgress<void>): Promise<void> {
|
||||
this._logService.debug('_performTextEdits', JSON.stringify(edits));
|
||||
|
||||
const recording = Recording.start(this._fileService);
|
||||
|
@ -402,7 +402,7 @@ export class BulkEditService implements IBulkEditService {
|
|||
|
||||
// First check if loaded models were not changed in the meantime
|
||||
for (const edit of edits) {
|
||||
if (!isResourceFileEdit(edit) && typeof edit.modelVersionId === 'number') {
|
||||
if (!WorkspaceFileEdit.is(edit) && typeof edit.modelVersionId === 'number') {
|
||||
let model = this._modelService.getModel(edit.resource);
|
||||
if (model && model.getVersionId() !== edit.modelVersionId) {
|
||||
// model changed in the meantime
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { WorkspaceEdit, isResourceTextEdit } from 'vs/editor/common/modes';
|
||||
import { WorkspaceEdit, WorkspaceTextEdit } from 'vs/editor/common/modes';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { ResourceMap } from 'vs/base/common/map';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
|
@ -49,7 +49,7 @@ export class ConflictDetector {
|
|||
const _workspaceEditResources = new ResourceMap<boolean>();
|
||||
|
||||
for (let edit of workspaceEdit.edits) {
|
||||
if (isResourceTextEdit(edit)) {
|
||||
if (WorkspaceTextEdit.is(edit)) {
|
||||
|
||||
_workspaceEditResources.set(edit.resource, true);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import { SaveReason } from 'vs/workbench/common/editor';
|
|||
import type * as vscode from 'vscode';
|
||||
import { mock } from 'vs/workbench/test/electron-browser/api/mock';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { isResourceTextEdit, ResourceTextEdit } from 'vs/editor/common/modes';
|
||||
import { WorkspaceTextEdit } from 'vs/editor/common/modes';
|
||||
import { timeout } from 'vs/base/common/async';
|
||||
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
|
||||
|
@ -279,8 +279,8 @@ suite('ExtHostDocumentSaveParticipant', () => {
|
|||
sub.dispose();
|
||||
|
||||
assert.equal(dto.edits.length, 1);
|
||||
assert.ok(isResourceTextEdit(dto.edits[0]));
|
||||
assert.equal((<ResourceTextEdit>dto.edits[0]).edits.length, 2);
|
||||
assert.ok(WorkspaceTextEdit.is(dto.edits[0]));
|
||||
assert.equal((<WorkspaceTextEdit>dto.edits[0]).edits.length, 2);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -326,7 +326,7 @@ suite('ExtHostDocumentSaveParticipant', () => {
|
|||
$tryApplyWorkspaceEdit(dto: IWorkspaceEditDto) {
|
||||
|
||||
for (const edit of dto.edits) {
|
||||
if (!isResourceTextEdit(edit)) {
|
||||
if (!WorkspaceTextEdit.is(edit)) {
|
||||
continue;
|
||||
}
|
||||
const { resource, edits } = edit;
|
||||
|
|
|
@ -759,8 +759,8 @@ suite('ExtHostLanguageFeatures', function () {
|
|||
const value = await rename(model, new EditorPosition(1, 1), 'newName');
|
||||
// least relevant rename provider
|
||||
assert.equal(value.edits.length, 2);
|
||||
assert.equal((<modes.ResourceTextEdit>value.edits[0]).edits.length, 1);
|
||||
assert.equal((<modes.ResourceTextEdit>value.edits[1]).edits.length, 1);
|
||||
assert.equal((<modes.WorkspaceTextEdit>value.edits[0]).edits.length, 1);
|
||||
assert.equal((<modes.WorkspaceTextEdit>value.edits[1]).edits.length, 1);
|
||||
});
|
||||
|
||||
// --- parameter hints
|
||||
|
|
|
@ -10,7 +10,7 @@ import { mock } from 'vs/workbench/test/electron-browser/api/mock';
|
|||
import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors';
|
||||
import { SingleProxyRPCProtocol, TestRPCProtocol } from 'vs/workbench/test/electron-browser/api/testRPCProtocol';
|
||||
import { ExtHostEditors } from 'vs/workbench/api/common/extHostTextEditors';
|
||||
import { ResourceTextEdit } from 'vs/editor/common/modes';
|
||||
import { WorkspaceTextEdit } from 'vs/editor/common/modes';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
|
||||
suite('ExtHostTextEditors.applyWorkspaceEdit', () => {
|
||||
|
@ -48,7 +48,7 @@ suite('ExtHostTextEditors.applyWorkspaceEdit', () => {
|
|||
edit.replace(resource, new extHostTypes.Range(0, 0, 0, 0), 'hello');
|
||||
await editors.applyWorkspaceEdit(edit);
|
||||
assert.equal(workspaceResourceEdits.edits.length, 1);
|
||||
assert.equal((<ResourceTextEdit>workspaceResourceEdits.edits[0]).modelVersionId, 1337);
|
||||
assert.equal((<WorkspaceTextEdit>workspaceResourceEdits.edits[0]).modelVersionId, 1337);
|
||||
});
|
||||
|
||||
test('does not use version id if document is not available', async () => {
|
||||
|
@ -56,7 +56,7 @@ suite('ExtHostTextEditors.applyWorkspaceEdit', () => {
|
|||
edit.replace(URI.parse('foo:bar2'), new extHostTypes.Range(0, 0, 0, 0), 'hello');
|
||||
await editors.applyWorkspaceEdit(edit);
|
||||
assert.equal(workspaceResourceEdits.edits.length, 1);
|
||||
assert.ok(typeof (<ResourceTextEdit>workspaceResourceEdits.edits[0]).modelVersionId === 'undefined');
|
||||
assert.ok(typeof (<WorkspaceTextEdit>workspaceResourceEdits.edits[0]).modelVersionId === 'undefined');
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -20,7 +20,7 @@ import { Position } from 'vs/editor/common/core/position';
|
|||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { EditOperation } from 'vs/editor/common/core/editOperation';
|
||||
import { TestFileService, TestEditorService, TestEditorGroupsService, TestEnvironmentService, TestContextService, TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { ResourceTextEdit } from 'vs/editor/common/modes';
|
||||
import { WorkspaceTextEdit } from 'vs/editor/common/modes';
|
||||
import { BulkEditService } from 'vs/workbench/services/bulkEdit/browser/bulkEditService';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { ITextModelService, IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService';
|
||||
|
@ -141,7 +141,7 @@ suite('MainThreadEditors', () => {
|
|||
|
||||
let model = modelService.createModel('something', null, resource);
|
||||
|
||||
let workspaceResourceEdit: ResourceTextEdit = {
|
||||
let workspaceResourceEdit: WorkspaceTextEdit = {
|
||||
resource: resource,
|
||||
modelVersionId: model.getVersionId(),
|
||||
edits: [{
|
||||
|
@ -162,7 +162,7 @@ suite('MainThreadEditors', () => {
|
|||
|
||||
let model = modelService.createModel('something', null, resource);
|
||||
|
||||
let workspaceResourceEdit1: ResourceTextEdit = {
|
||||
let workspaceResourceEdit1: WorkspaceTextEdit = {
|
||||
resource: resource,
|
||||
modelVersionId: model.getVersionId(),
|
||||
edits: [{
|
||||
|
@ -170,7 +170,7 @@ suite('MainThreadEditors', () => {
|
|||
range: new Range(1, 1, 1, 1)
|
||||
}]
|
||||
};
|
||||
let workspaceResourceEdit2: ResourceTextEdit = {
|
||||
let workspaceResourceEdit2: WorkspaceTextEdit = {
|
||||
resource: resource,
|
||||
modelVersionId: model.getVersionId(),
|
||||
edits: [{
|
||||
|
|
Loading…
Reference in a new issue