Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Introduce error highlighting #79

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

winstliu
Copy link
Contributor

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

What's this? Another rewrite? This rewrite primarily introduces error highlighting to indicate when invalid YAML is being written. For example, content after a non-scalar will now be highlighted as an error, as well as non-scalar content after a scalar. Two examples follow:

non-scalar
ERROR
key: value
ERROR

Previously, both ERROR statements would be innocuously tokenized as string.unquoted.yaml, when in fact they are invalid YAML.

Invalid tab highlighting has also been greatly improved.

Alternate Designs

None

Benefits

It is now easy to see when invalid YAML is being written.

Possible Drawbacks

One drawback is that when writing scalars, until you finish the key name with the colon, the key will be tokenized as an error. I don't see any way of getting around this short of removing the error highlighting (it was previously tokenized as an unquoted string).

Applicable Issues

Fixes #78

@winstliu
Copy link
Contributor Author

Pretty sure this will re-break YAML in GFM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant