feat: if code frame error is on a single line, highlight the whole path#10361
Merged
nicolo-ribaudo merged 2 commits intobabel:masterfrom Oct 29, 2019
Merged
feat: if code frame error is on a single line, highlight the whole path#10361nicolo-ribaudo merged 2 commits intobabel:masterfrom
nicolo-ribaudo merged 2 commits intobabel:masterfrom
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11362/ |
Contributor
|
The highlighted path may contain many subpaths even though they are within the same line, i.e. foo(a, b(f, { g: h(i) }))If the whole callExpression |
Member
|
I prefer this PR to the current behavior. In @JLHwung example, if the problem is the whole call expression I don't see why it shouldn't be highlighted. |
nicolo-ribaudo
approved these changes
Aug 23, 2019
existentialism
approved these changes
Sep 25, 2019
This was referenced Nov 28, 2019
This was referenced Dec 5, 2019
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Before:

After:

buildCodeFrameErrordoesn't seem to have any tests, at least not any I could find. Thoughts on where I can add one (if you want this)This might make sense as an option passed to
path.buildCodeFrameErrorrather thanbuildCodeFrameErrorforcing it on consumers?