Improve YAML validation error messages #2191
Labels
enhancement
New feature or request
yaml-validation
Issues with YAML validation and autocompletion in quarto
Milestone
The following error message is very hard to read:
There are two problems here.
Formatting
We can improve formatting in at least three ways. If we're going to print object values that violate the schema, we should always print them by themselves instead of wrapping text around them. That error should then read like so:
I think we also shouldn't use the work
key
, we should use the wordfield
.Finally, when we're emitting error messages in contexts that have no color formatting, we should consistently use quotes (as we already do in
'true'
and'false'
). The error should readBetter information in the case of short suggestions
This error is especially bad, though, in that it suggests that the replacement value has to be
true
orfalse
.The problem is that although these replacements work, they are not the only options. The other alternatives, though, are more complicated schemas, and our short error report doesn't show that.
Our error heuristics should try to offer short suggestions, but they should not mislead.
The text was updated successfully, but these errors were encountered: