Reference : Support metadata edits. #1552
Merged
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.
Previously we never serialised any metadata from Reference nodes, regardless of whether the metadata originated from within the referenced file or was added/edited after loading. We now support both the addition of new metadata and editing of metadata from the reference.
This implementation uses the persistence flag on each metadata item to track whether it is considered to have come from the referenced file or not. Strictly speaking, this is slightly abusing the semantics of that flag, but this does allow us to support edits with minimal changes, and is similar to the way we treat the Dynamic plug flag already. We still need a full system for tracking reference edits to plug values - when we implement such a thing we should probably track metadata edits with the same mechanism.
Fixes #1536.
@davidsminor, could you take a look and see if this is sufficient for your current purposes? Also, am I right in thinking you have an "import reference" type functionality? If so, could you check that my changes are compatible with that?