editor with write capability
This commit is contained in:
+8
-1
@@ -125,6 +125,13 @@ final class FilesystemVfsProjectDocument implements VfsProjectDocument {
|
||||
return new VfsDocumentSaveResult(supportedDocument.path(), supportedDocument.typeId(), VfsDocumentSaveStatus.SAVED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VfsDocumentOpenResult.VfsTextDocument discardDocument(final Path path) {
|
||||
final var supportedDocument = requireSupportedDocument(path);
|
||||
editableSnapshots.remove(supportedDocument.path());
|
||||
return toVfsTextDocument(supportedDocument, false, accessContextFor(supportedDocument));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VfsDocumentSaveResult> saveAllDocuments() {
|
||||
return editableSnapshots.keySet().stream()
|
||||
@@ -230,7 +237,7 @@ final class FilesystemVfsProjectDocument implements VfsProjectDocument {
|
||||
return new DocumentKind(VfsDocumentTypeIds.BASH, false, VfsDocumentAccessMode.EDITABLE);
|
||||
}
|
||||
if (isFrontendSourceDocument(extension)) {
|
||||
return new DocumentKind(projectContext.languageId(), true, VfsDocumentAccessMode.READ_ONLY);
|
||||
return new DocumentKind(projectContext.languageId(), true, VfsDocumentAccessMode.EDITABLE);
|
||||
}
|
||||
return new DocumentKind(VfsDocumentTypeIds.TEXT, false, VfsDocumentAccessMode.EDITABLE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user