[native_assets_cli] Add paths to syntax views #2107
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.
Bug: #1826
This PR adds the path that was navigated through the JSON to the syntax classes. This makes syntax errors more descriptive:
Unexpected value '123' for 'target_os'. Expected a String.
->Unexpected value '123' (int) for 'config.code.target_os'. Expected a String.
.Because the data asset and code asset extensions don't know the internals of the base protocol extension, the extension points now expose both a
json
and ajsonPath
. That path is then used to instantiate the syntax view of the extension, so it can give more precise error messages.CodeConfig
this comes naturally, it's a clean view.EncodedAsset
this is somewhat weird because it is half-used as value class: [native_assets_cli]EncodedAsset
is not immutable but overrideshashCode
#2045(The next PR will add a full syntax validation pass, at which point we should be able to address #2039.)