Prototype update import paths on file rename/move for JS/TS (#50074)

* Prototype of updating paths on rename file

* Fix apply edits

* Hook up to normal rename

* Fix unit test

* Remove timeout

* Adding prompt

* Bail early if user has set 'never'
This commit is contained in:
Matt Bierner
2018-05-21 13:26:24 -07:00
committed by GitHub
parent 2cfe96f451
commit ff5f422dda
13 changed files with 285 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ import { IModelService, shouldSynchronizeModel } from 'vs/editor/common/services
import { IDisposable, dispose, IReference } from 'vs/base/common/lifecycle';
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';
import { IFileService, FileOperation } from 'vs/platform/files/common/files';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { ExtHostContext, MainThreadDocumentsShape, ExtHostDocumentsShape, IExtHostContext } from '../node/extHost.protocol';
@@ -119,6 +119,12 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
}
}));
this._toDispose.push(fileService.onAfterOperation(e => {
if (e.operation === FileOperation.MOVE) {
this._proxy.$onDidRename(e.resource, e.target.resource);
}
}));
this._modelToDisposeMap = Object.create(null);
}