Repository navigation
Expose error and warning locations as data - #22
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request adds the type and location of an error or warning as data, so a tool can point at the source without reading it out of the message with a regular expression.
Errors and warnings used to cross the FFI boundary as a single string, so the location and the kind of error were lost there. The Rust side now sends each one as JSON with a
message, atypeand alocation, and the C extension builds the exception withfrom_jsonon the error class before raising it.The shape follows Prism, Herb and Yerba. A warning is a
LightningCSS::Warningwith amessage, atypeand alocation, like a diagnostic in Prism or Herb. ALightningCSS::Locationis aDatawith afilename, alinecounted from 1 and acolumncounted from 0, like a location in all three.Resolves #18