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

files - implement isReadonly on model if provided

上级 326ee3ce
......@@ -672,9 +672,7 @@ export abstract class TextResourceEditorInput extends EditorInput {
return true; // resources without file support are always readonly
}
const model = this.textFileService.files.get(this.resource);
return model?.isReadonly() || this.fileService.hasCapability(this.resource, FileSystemProviderCapabilities.Readonly);
return this.fileService.hasCapability(this.resource, FileSystemProviderCapabilities.Readonly);
}
isSaving(): boolean {
......
......@@ -182,6 +182,14 @@ export class FileEditorInput extends TextResourceEditorInput implements IFileEdi
return !!(this.model?.isDirty());
}
isReadonly(): boolean {
if (this.model) {
return this.model.isReadonly();
}
return super.isReadonly();
}
isSaving(): boolean {
if (this.model?.hasState(ModelState.SAVED) || this.model?.hasState(ModelState.CONFLICT) || this.model?.hasState(ModelState.ERROR)) {
return false; // require the model to be dirty and not in conflict or error state
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册