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

Allow tagged template injections to accept function parameters - #639

Merged
daviwil merged 1 commit into
masterfrom
dw-fix-styled-call-injection
Feb 7, 2019
Merged

daviwil merged 1 commit into
masterfrom
dw-fix-styled-call-injection

Conversation

@daviwil

@daviwil daviwil commented Feb 7, 2019

Copy link
Copy Markdown
Contributor

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

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
@daviwil
daviwil deleted the dw-fix-styled-call-injection branch February 7, 2019 01:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSS grammar not injected for custom styled-components

2 participants