This commit is contained in:
Benjamin Pasero 2019-04-18 16:58:35 +02:00
parent 0157b3c155
commit d1452c3fac
2 changed files with 2 additions and 6 deletions

View file

@ -137,12 +137,12 @@ export class SaveErrorHandler extends Disposable implements ISaveErrorHandler, I
const triedToMakeWriteable = isReadonly && fileOperationError.options && (fileOperationError.options as IWriteTextFileOptions).overwriteReadonly;
const isPermissionDenied = fileOperationError.fileOperationResult === FileOperationResult.FILE_PERMISSION_DENIED;
// Save Elevated (TODO@remote cannot write elevated https://github.com/Microsoft/vscode/issues/48659)
// Save Elevated (cannot write elevated https://github.com/Microsoft/vscode/issues/48659)
if (resource.scheme === Schemas.file && (isPermissionDenied || triedToMakeWriteable)) {
actions.primary!.push(this.instantiationService.createInstance(SaveElevatedAction, model, triedToMakeWriteable));
}
// Overwrite (TODO@remote cannot overwrite readonly https://github.com/Microsoft/vscode/issues/48659)
// Overwrite (cannot overwrite readonly https://github.com/Microsoft/vscode/issues/48659)
else if (resource.scheme === Schemas.file && isReadonly) {
actions.primary!.push(this.instantiationService.createInstance(OverwriteReadonlyAction, model));
}

View file

@ -763,10 +763,6 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
this.telemetryService.publicLog('filePUT', this.getTelemetryData(options.reason));
}
}, error => {
if (!error) {
error = new Error('Unknown Save Error'); // TODO@remote we should never get null as error (https://github.com/Microsoft/vscode/issues/55051)
}
this.logService.error(`doSave(${versionId}) - exit - resulted in a save error: ${error.toString()}`, this.resource);
// Flag as error state in the model