Skip to content
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

Allow tagged template injections to accept function parameters #639

Merged
merged 1 commit into from Feb 7, 2019

Conversation

Projects
None yet
1 participant
@daviwil
Copy link
Member

daviwil commented Feb 7, 2019

Description of the Change

This change fixes #634 which reports that the Tree-Sitter JavaScript grammar does not correctly highlight tagged template injections which have function parameters, such as those used in the Styled Components library. The fix enables tagged template injections to be highlighted correctly when the template invocation includes function arguments.

Before

styled_before

After

styled_fixed

Alternate Designs

This is the simplest design that enables any tagged template literal to be called with arguments and then have a language injection to be applied.

Benefits

CSS syntax inside of styled template literals with function arguments (styled(Button)) is now highlighted correctly.

Possible Drawbacks

None

Applicable Issues

Fixes #634

Allow tagged template injections to accept function parameters
This change fixes #634 which reports that the Tree-Sitter JavaScript grammar
does not correctly highlight tagged template injections which have function
parameters, such as those used in the Styled Components library.  The fix
enables tagged template injections to be highlighted correctly when the template
invocation includes function arguments.

@daviwil daviwil merged commit 0893d74 into master Feb 7, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@daviwil daviwil deleted the dw-fix-styled-call-injection branch Feb 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.