@@ -11,7 +11,7 @@ import { IBulkEditOptions, IBulkEditResult, IBulkEditService, IBulkEditPreviewHa
1111import { EditOperation } from 'vs/editor/common/core/editOperation' ;
1212import { Range } from 'vs/editor/common/core/range' ;
1313import { EndOfLineSequence , IIdentifiedSingleEditOperation , ITextModel } from 'vs/editor/common/model' ;
14- import { isResourceFileEdit , isResourceTextEdit , ResourceFileEdit , ResourceTextEdit , WorkspaceEdit } from 'vs/editor/common/modes' ;
14+ import { WorkspaceFileEdit , WorkspaceTextEdit , WorkspaceEdit } from 'vs/editor/common/modes' ;
1515import { IModelService } from 'vs/editor/common/services/modelService' ;
1616import { ITextModelService , IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService' ;
1717import { localize } from 'vs/nls' ;
@@ -47,7 +47,7 @@ class ModelEditTask implements IDisposable {
4747 this . _modelReference . dispose ( ) ;
4848 }
4949
50- addEdit ( resourceEdit : ResourceTextEdit ) : void {
50+ addEdit ( resourceEdit : WorkspaceTextEdit ) : void {
5151 this . _expectedModelVersionId = resourceEdit . modelVersionId ;
5252 for ( const edit of resourceEdit . edits ) {
5353 if ( typeof edit . eol === 'number' ) {
@@ -124,13 +124,13 @@ class EditorEditTask extends ModelEditTask {
124124
125125class BulkEditModel implements IDisposable {
126126
127- private _edits = new Map < string , ResourceTextEdit [ ] > ( ) ;
127+ private _edits = new Map < string , WorkspaceTextEdit [ ] > ( ) ;
128128 private _tasks : ModelEditTask [ ] | undefined ;
129129
130130 constructor (
131131 private readonly _editor : ICodeEditor | undefined ,
132132 private readonly _progress : IProgress < void > ,
133- edits : ResourceTextEdit [ ] ,
133+ edits : WorkspaceTextEdit [ ] ,
134134 @IEditorWorkerService private readonly _editorWorker : IEditorWorkerService ,
135135 @ITextModelService private readonly _textModelResolverService : ITextModelService ,
136136 ) {
@@ -143,7 +143,7 @@ class BulkEditModel implements IDisposable {
143143 }
144144 }
145145
146- private _addEdit ( edit : ResourceTextEdit ) : void {
146+ private _addEdit ( edit : WorkspaceTextEdit ) : void {
147147 let array = this . _edits . get ( edit . resource . toString ( ) ) ;
148148 if ( ! array ) {
149149 array = [ ] ;
@@ -217,7 +217,7 @@ class BulkEditModel implements IDisposable {
217217 }
218218}
219219
220- type Edit = ResourceFileEdit | ResourceTextEdit ;
220+ type Edit = WorkspaceFileEdit | WorkspaceTextEdit ;
221221
222222class BulkEdit {
223223
@@ -243,7 +243,7 @@ class BulkEdit {
243243 }
244244
245245 ariaMessage ( ) : string {
246- const editCount = this . _edits . reduce ( ( prev , cur ) => isResourceFileEdit ( cur ) ? prev : prev + cur . edits . length , 0 ) ;
246+ const editCount = this . _edits . reduce ( ( prev , cur ) => WorkspaceFileEdit . is ( cur ) ? prev : prev + cur . edits . length , 0 ) ;
247247 const resourceCount = this . _edits . length ;
248248 if ( editCount === 0 ) {
249249 return localize ( 'summary.0' , "Made no edits" ) ;
@@ -263,15 +263,15 @@ class BulkEdit {
263263 let group : Edit [ ] | undefined ;
264264 for ( const edit of this . _edits ) {
265265 if ( ! group
266- || ( isResourceFileEdit ( group [ 0 ] ) && ! isResourceFileEdit ( edit ) )
267- || ( isResourceTextEdit ( group [ 0 ] ) && ! isResourceTextEdit ( edit ) )
266+ || ( WorkspaceFileEdit . is ( group [ 0 ] ) && ! WorkspaceFileEdit . is ( edit ) )
267+ || ( WorkspaceTextEdit . is ( group [ 0 ] ) && ! WorkspaceTextEdit . is ( edit ) )
268268 ) {
269269 group = [ ] ;
270270 groups . push ( group ) ;
271271 }
272272 group . push ( edit ) ;
273273
274- if ( isResourceFileEdit ( edit ) ) {
274+ if ( WorkspaceFileEdit . is ( edit ) ) {
275275 total += 1 ;
276276 } else if ( ! seen . has ( edit . resource . toString ( ) ) ) {
277277 seen . add ( edit . resource . toString ( ) ) ;
@@ -287,15 +287,15 @@ class BulkEdit {
287287
288288 // do it.
289289 for ( const group of groups ) {
290- if ( isResourceFileEdit ( group [ 0 ] ) ) {
291- await this . _performFileEdits ( < ResourceFileEdit [ ] > group , progress ) ;
290+ if ( WorkspaceFileEdit . is ( group [ 0 ] ) ) {
291+ await this . _performFileEdits ( < WorkspaceFileEdit [ ] > group , progress ) ;
292292 } else {
293- await this . _performTextEdits ( < ResourceTextEdit [ ] > group , progress ) ;
293+ await this . _performTextEdits ( < WorkspaceTextEdit [ ] > group , progress ) ;
294294 }
295295 }
296296 }
297297
298- private async _performFileEdits ( edits : ResourceFileEdit [ ] , progress : IProgress < void > ) {
298+ private async _performFileEdits ( edits : WorkspaceFileEdit [ ] , progress : IProgress < void > ) {
299299 this . _logService . debug ( '_performFileEdits' , JSON . stringify ( edits ) ) ;
300300 for ( const edit of edits ) {
301301 progress . report ( undefined ) ;
@@ -330,7 +330,7 @@ class BulkEdit {
330330 }
331331 }
332332
333- private async _performTextEdits ( edits : ResourceTextEdit [ ] , progress : IProgress < void > ) : Promise < void > {
333+ private async _performTextEdits ( edits : WorkspaceTextEdit [ ] , progress : IProgress < void > ) : Promise < void > {
334334 this . _logService . debug ( '_performTextEdits' , JSON . stringify ( edits ) ) ;
335335
336336 const recording = Recording . start ( this . _fileService ) ;
@@ -402,7 +402,7 @@ export class BulkEditService implements IBulkEditService {
402402
403403 // First check if loaded models were not changed in the meantime
404404 for ( const edit of edits ) {
405- if ( ! isResourceFileEdit ( edit ) && typeof edit . modelVersionId === 'number' ) {
405+ if ( ! WorkspaceFileEdit . is ( edit ) && typeof edit . modelVersionId === 'number' ) {
406406 let model = this . _modelService . getModel ( edit . resource ) ;
407407 if ( model && model . getVersionId ( ) !== edit . modelVersionId ) {
408408 // model changed in the meantime
0 commit comments