提交 deeafc26 编写于 作者: B Benjamin Pasero

add more logging for #13665

上级 80de3f6d
......@@ -467,6 +467,7 @@ export interface IImportResult {
export interface IFileOperationResult {
message: string;
fileOperationResult: FileOperationResult;
payload?: any;
}
export enum FileOperationResult {
......
......@@ -95,6 +95,15 @@ export class SaveErrorHandler implements ISaveErrorHandler, IWorkbenchContributi
// Dirty write prevention
if ((<IFileOperationResult>error).fileOperationResult === FileOperationResult.FILE_MODIFIED_SINCE) {
// TODO@Ben remove me once https://github.com/Microsoft/vscode/issues/13665 is resolved
if (error.payload) {
error.payload.modelValue = model.getValue();
error.payload.modelValueLength = error.payload.modelValue.length;
console.log(JSON.stringify(error.payload));
}
message = this.instantiationService.createInstance(ResolveSaveConflictMessage, model, null);
}
......
......@@ -621,9 +621,26 @@ export class FileService implements IFileService {
// Find out if content length has changed
if (options.etag !== etag(stat.size, options.mtime)) {
// TODO@Ben remove me once https://github.com/Microsoft/vscode/issues/13665 is resolved
let payload: any;
if (this.options.verboseLogging) {
const contents = fs.readFileSync(absolutePath);
const value = contents.toString();
payload = {
diskByteLength: contents.length,
diskValueLength: value.length,
diskValue: value,
options,
stat
};
}
return TPromise.wrapError(<IFileOperationResult>{
message: 'File Modified Since',
fileOperationResult: FileOperationResult.FILE_MODIFIED_SINCE
fileOperationResult: FileOperationResult.FILE_MODIFIED_SINCE,
payload
});
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册