New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix highlighting issue when printing JSON that isn't indented #2038
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2038 +/- ##
==========================================
- Coverage 99.81% 99.78% -0.03%
==========================================
Files 71 71
Lines 7058 7107 +49
==========================================
+ Hits 7045 7092 +47
- Misses 13 15 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of requests, as discussed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Type of changes
Checklist
Description
Previously the JSONHighlighter would do two passes with Text.highlight - the second pass would highlight JSON keys.
I've got rid of the second regex for the 2nd Text.highlight pass, and replaced it with a regex which captures the spans of strings, followed by some manual processing to determine whether they're keys or not. If the string is a key, we append the json.key Span.
Previously:
Closes #2027