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

Commit 1f1da30

Browse files
committed
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.
1 parent 25863da commit 1f1da30

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/main.js

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ exports.activate = function () {
99
switch (firstChild.type) {
1010
case 'identifier':
1111
return languageStringForTemplateTag(firstChild.text)
12+
case 'call_expression':
13+
return languageStringForTemplateTag(firstChild.children[0].text)
1214
case 'member_expression':
1315
if (firstChild.startPosition.row === firstChild.endPosition.row) {
1416
return languageStringForTemplateTag(firstChild.text)

0 commit comments

Comments
 (0)