fix bad regression when doing "Save as"

This commit is contained in:
Benjamin Pasero 2017-01-05 15:31:33 +01:00
parent 61ef2f3844
commit 0d27e814eb

View file

@ -562,7 +562,7 @@ export abstract class TextFileService implements ITextFileService {
private doSaveTextFileAs(sourceModel: ITextFileEditorModel | UntitledEditorModel, resource: URI, target: URI): TPromise<void> {
// create the target file empty if it does not exist already
return this.fileService.resolveFile(target).then(stat => stat, () => null).then(stat => stat || this.fileService.createFile(target)).then(stat => {
return this.fileService.resolveFile(target).then(stat => stat, () => null).then(stat => stat || this.fileService.updateContent(target, '')).then(stat => {
// resolve a model for the file (which can be binary if the file is not a text file)
return this.models.loadOrCreate(target).then((targetModel: ITextFileEditorModel) => {