This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Optionally fail to load buffers from missing files #259
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By default,
TextBuffer
will deserialize or load files that do not exist as empty buffers. As a consequence, when you open Atom after deleting or moving a file that was open in an editor in a previous session (or checking out a different git branch, or unmounting a drive...) your workspace is created with empty TextEditors.We also have some time-of-check, time-of-use race conditions in
Project
deserialization that are caused by needing to detect certain failure conditions before callingTextBuffer.deserialize()
.This adds a
mustExist:
option toTextBuffer
's load and deserialization methods that cause the ENOENT error to propagate to the caller, which can then report it or skip it based on higher-level abstraction logic.Prerequisite for the last bits of atom/atom#15681.