提交 967451ed 编写于 作者: I isidor

propagate isReadonly properly

上级 f0ec28b4
......@@ -399,6 +399,11 @@ export interface IBaseStat {
* current state of the file or directory.
*/
etag: string;
/**
* The resource is readonly.
*/
isReadonly?: boolean;
}
/**
......@@ -412,11 +417,6 @@ export interface IFileStat extends IBaseStat {
*/
isDirectory: boolean;
/**
* The resource is readonly.
*/
isReadonly?: boolean;
/**
* The resource is a symbolic link.
*/
......
......@@ -273,6 +273,7 @@ export class FileService implements IFileService {
mtime: streamContent.mtime,
etag: streamContent.etag,
encoding: streamContent.encoding,
isReadonly: streamContent.isReadonly,
value: ''
};
......@@ -302,6 +303,7 @@ export class FileService implements IFileService {
mtime: void 0,
etag: void 0,
encoding: void 0,
isReadonly: false,
value: void 0
};
......
......@@ -412,6 +412,7 @@ export class RemoteFileService extends FileService {
name: fileStat.name,
etag: fileStat.etag,
mtime: fileStat.mtime,
isReadonly: fileStat.isReadonly
};
});
});
......@@ -499,7 +500,8 @@ export class RemoteFileService extends FileService {
etag: content.etag,
mtime: content.mtime,
name: content.name,
resource: content.resource
resource: content.resource,
isReadonly: content.isReadonly
};
content.value.on('data', chunk => result.value += chunk);
content.value.on('error', reject);
......
......@@ -310,7 +310,8 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
mtime: Date.now(),
etag: void 0,
value: createTextBufferFactory(''), /* will be filled later from backup */
encoding: this.fileService.encoding.getWriteEncoding(this.resource, this.preferredEncoding)
encoding: this.fileService.encoding.getWriteEncoding(this.resource, this.preferredEncoding),
isReadonly: false
};
return this.loadWithContent(content, backup);
......@@ -406,7 +407,8 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
etag: content.etag,
isDirectory: false,
isSymbolicLink: false,
children: void 0
children: void 0,
isReadonly: content.isReadonly
};
this.updateLastResolvedDiskStat(resolvedStat);
......
......@@ -63,6 +63,7 @@ export class TextFileService extends AbstractTextFileService {
mtime: streamContent.mtime,
etag: streamContent.etag,
encoding: streamContent.encoding,
isReadonly: streamContent.isReadonly,
value: res
};
return r;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册