Fix the tag with type argument detectioon when type arguments span over multiple lines

Fixes #632
This commit is contained in:
Sheetal Nandi 2018-07-03 13:19:52 -07:00
Родитель 40288b8722
Коммит 88217b1c7d
4 изменённых файлов: 363 добавлений и 5 удалений

Просмотреть файл

@ -15,7 +15,7 @@ variables:
jsxTagName: \s*{{jsxTagNamespace}}((?:[a-z][a-z0-9]*|({{jsxTagOrAtrributeIdentifier}}*))(?<!\.|-))
jsxOpeningTagWithoutAttributes: (<){{jsxTagName}}?\s*(>)
jsxClosingTag: (</){{jsxTagName}}?\s*(>)
jsxTagStart: (<){{jsxTagName}}(?=(({{typeArguments}}\s*)|(\s+))(?!\?)|\/?>)
jsxTagStart: (<){{jsxTagName}}(?=((<\s*)|(\s+))(?!\?)|\/?>)
jsxTagStartLookahead: (?={{jsxTagStart}})
jsxLookBehindInExpression: (?<!\+\+|--)(?<=[({\[,?=>:*]|&&|\|\||\?|{{lookBehindReturn}}|{{lookBehindDefault}}|^)\s*

Просмотреть файл

@ -7863,9 +7863,9 @@
<string>(?x)
(?&lt;!\+\+|--)(?&lt;=[({\[,?=&gt;:*]|&amp;&amp;|\|\||\?|^return|[^\._$[:alnum:]]return|^default|[^\._$[:alnum:]]default|^)\s*
(?!&lt;\s*[_$[:alpha:]][_$[:alnum:]]*((\s+extends\s+[^=&gt;])|,)) # look ahead is not type parameter of arrow
(?=(&lt;)\s*(?:([_$a-zA-Z][-$\w.]*)(?&lt;!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?&lt;!\.|-))(?=((&lt;\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\&lt;\&gt;\,\.\[=]|&amp;(?!&amp;)|\|(?!\|)))))([^&lt;&gt;\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?&lt;==)\&gt;|\&lt;\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\&lt;\&gt;\,\.\[=]|&amp;(?!&amp;)|\|(?!\|)))))([^&lt;&gt;\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?&lt;==)\&gt;)*(?!=)\&gt;)*(?!=)&gt;\s*)|(\s+))(?!\?)|\/?&gt;))</string>
(?=(&lt;)\s*(?:([_$a-zA-Z][-$\w.]*)(?&lt;!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?&lt;!\.|-))(?=((&lt;\s*)|(\s+))(?!\?)|\/?&gt;))</string>
<key>end</key>
<string>(?!(&lt;)\s*(?:([_$a-zA-Z][-$\w.]*)(?&lt;!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?&lt;!\.|-))(?=((&lt;\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\&lt;\&gt;\,\.\[=]|&amp;(?!&amp;)|\|(?!\|)))))([^&lt;&gt;\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?&lt;==)\&gt;|\&lt;\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\&lt;\&gt;\,\.\[=]|&amp;(?!&amp;)|\|(?!\|)))))([^&lt;&gt;\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?&lt;==)\&gt;)*(?!=)\&gt;)*(?!=)&gt;\s*)|(\s+))(?!\?)|\/?&gt;))</string>
<string>(?!(&lt;)\s*(?:([_$a-zA-Z][-$\w.]*)(?&lt;!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?&lt;!\.|-))(?=((&lt;\s*)|(\s+))(?!\?)|\/?&gt;))</string>
<key>patterns</key>
<array>
<dict>
@ -7879,7 +7879,7 @@
<key>name</key>
<string>meta.tag.tsx</string>
<key>begin</key>
<string>(?=(&lt;)\s*(?:([_$a-zA-Z][-$\w.]*)(?&lt;!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?&lt;!\.|-))(?=((&lt;\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\&lt;\&gt;\,\.\[=]|&amp;(?!&amp;)|\|(?!\|)))))([^&lt;&gt;\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?&lt;==)\&gt;|\&lt;\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\&lt;\&gt;\,\.\[=]|&amp;(?!&amp;)|\|(?!\|)))))([^&lt;&gt;\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?&lt;==)\&gt;)*(?!=)\&gt;)*(?!=)&gt;\s*)|(\s+))(?!\?)|\/?&gt;))</string>
<string>(?=(&lt;)\s*(?:([_$a-zA-Z][-$\w.]*)(?&lt;!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?&lt;!\.|-))(?=((&lt;\s*)|(\s+))(?!\?)|\/?&gt;))</string>
<key>end</key>
<string>(/&gt;)|(?:(&lt;/)\s*(?:([_$a-zA-Z][-$\w.]*)(?&lt;!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?&lt;!\.|-))?\s*(&gt;))</string>
<key>endCaptures</key>
@ -7924,7 +7924,7 @@
<array>
<dict>
<key>begin</key>
<string>(&lt;)\s*(?:([_$a-zA-Z][-$\w.]*)(?&lt;!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?&lt;!\.|-))(?=((&lt;\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\&lt;\&gt;\,\.\[=]|&amp;(?!&amp;)|\|(?!\|)))))([^&lt;&gt;\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?&lt;==)\&gt;|\&lt;\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\&lt;\&gt;\,\.\[=]|&amp;(?!&amp;)|\|(?!\|)))))([^&lt;&gt;\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?&lt;==)\&gt;)*(?!=)\&gt;)*(?!=)&gt;\s*)|(\s+))(?!\?)|\/?&gt;)</string>
<string>(&lt;)\s*(?:([_$a-zA-Z][-$\w.]*)(?&lt;!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?&lt;!\.|-))(?=((&lt;\s*)|(\s+))(?!\?)|\/?&gt;)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>

Просмотреть файл

@ -0,0 +1,330 @@
original file
-----------------------------------
// @onlyOwnGrammar - As this has jsx
<Bar>
{({ name }) => (
<HelloWorld<Foo>
name={name}
variants={['TEST']}
/>
)}
</Bar>
<Bar>
{({ name }) => (
<HelloWorld<
Foo>
name={name}
/>
)}
</Bar>
<Bar>
{({ name }) => (
<HelloWorld<
Foo>
name={name}
variants={['TEST']}
/>
)}
</Bar>
-----------------------------------
Grammar: TypeScriptReact.tmLanguage
-----------------------------------
>// @onlyOwnGrammar - As this has jsx
^^
source.tsx comment.line.double-slash.tsx punctuation.definition.comment.tsx
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
source.tsx comment.line.double-slash.tsx
><Bar>
^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.begin.tsx
^^^
source.tsx meta.tag.without-attributes.tsx entity.name.tag.tsx support.class.component.tsx
^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.end.tsx
> {({ name }) => (
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx punctuation.section.embedded.begin.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx punctuation.definition.parameters.begin.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx punctuation.definition.binding-pattern.object.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx variable.parameter.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx punctuation.definition.binding-pattern.object.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx punctuation.definition.parameters.end.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx storage.type.function.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.brace.round.tsx
> <HelloWorld<Foo>
^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx punctuation.definition.tag.begin.tsx
^^^^^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx entity.name.tag.tsx support.class.component.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx
^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.type.parameters.tsx entity.name.type.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx
> name={name}
^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx entity.other.attribute-name.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx keyword.operator.assignment.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx punctuation.section.embedded.begin.tsx
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx variable.other.readwrite.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx punctuation.section.embedded.end.tsx
> variants={['TEST']}
^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx
^^^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx entity.other.attribute-name.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx keyword.operator.assignment.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx punctuation.section.embedded.begin.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx meta.array.literal.tsx meta.brace.square.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx meta.array.literal.tsx string.quoted.single.tsx punctuation.definition.string.begin.tsx
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx meta.array.literal.tsx string.quoted.single.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx meta.array.literal.tsx string.quoted.single.tsx punctuation.definition.string.end.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx meta.array.literal.tsx meta.brace.square.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx punctuation.section.embedded.end.tsx
> />
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx punctuation.definition.tag.end.tsx
> )}
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.brace.round.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx punctuation.section.embedded.end.tsx
></Bar>
^^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.begin.tsx
^^^
source.tsx meta.tag.without-attributes.tsx entity.name.tag.tsx support.class.component.tsx
^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.end.tsx
>
^
source.tsx
><Bar>
^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.begin.tsx
^^^
source.tsx meta.tag.without-attributes.tsx entity.name.tag.tsx support.class.component.tsx
^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.end.tsx
> {({ name }) => (
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx punctuation.section.embedded.begin.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx punctuation.definition.parameters.begin.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx punctuation.definition.binding-pattern.object.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx variable.parameter.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx punctuation.definition.binding-pattern.object.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx punctuation.definition.parameters.end.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx storage.type.function.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.brace.round.tsx
> <HelloWorld<
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx punctuation.definition.tag.begin.tsx
^^^^^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx entity.name.tag.tsx support.class.component.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx
> Foo>
^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.type.parameters.tsx
^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.type.parameters.tsx entity.name.type.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx
> name={name}
^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx entity.other.attribute-name.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx keyword.operator.assignment.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx punctuation.section.embedded.begin.tsx
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx variable.other.readwrite.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx punctuation.section.embedded.end.tsx
> />
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx punctuation.definition.tag.end.tsx
> )}
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.brace.round.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx punctuation.section.embedded.end.tsx
></Bar>
^^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.begin.tsx
^^^
source.tsx meta.tag.without-attributes.tsx entity.name.tag.tsx support.class.component.tsx
^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.end.tsx
>
^
source.tsx
><Bar>
^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.begin.tsx
^^^
source.tsx meta.tag.without-attributes.tsx entity.name.tag.tsx support.class.component.tsx
^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.end.tsx
> {({ name }) => (
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx punctuation.section.embedded.begin.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx punctuation.definition.parameters.begin.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx punctuation.definition.binding-pattern.object.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx variable.parameter.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx meta.parameter.object-binding-pattern.tsx punctuation.definition.binding-pattern.object.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.parameters.tsx punctuation.definition.parameters.end.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx storage.type.function.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.brace.round.tsx
> <HelloWorld<
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx punctuation.definition.tag.begin.tsx
^^^^^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx entity.name.tag.tsx support.class.component.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx
> Foo>
^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.type.parameters.tsx
^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.type.parameters.tsx entity.name.type.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx
> name={name}
^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx entity.other.attribute-name.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx keyword.operator.assignment.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx punctuation.section.embedded.begin.tsx
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx variable.other.readwrite.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx punctuation.section.embedded.end.tsx
> variants={['TEST']}
^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx
^^^^^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx entity.other.attribute-name.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx keyword.operator.assignment.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx punctuation.section.embedded.begin.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx meta.array.literal.tsx meta.brace.square.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx meta.array.literal.tsx string.quoted.single.tsx punctuation.definition.string.begin.tsx
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx meta.array.literal.tsx string.quoted.single.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx meta.array.literal.tsx string.quoted.single.tsx punctuation.definition.string.end.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx meta.array.literal.tsx meta.brace.square.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx meta.embedded.expression.tsx punctuation.section.embedded.end.tsx
> />
^^^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx meta.tag.attributes.tsx
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.tag.tsx punctuation.definition.tag.end.tsx
> )}
^^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx meta.arrow.tsx meta.brace.round.tsx
^
source.tsx meta.tag.without-attributes.tsx meta.jsx.children.tsx meta.embedded.expression.tsx punctuation.section.embedded.end.tsx
></Bar>
^^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.begin.tsx
^^^
source.tsx meta.tag.without-attributes.tsx entity.name.tag.tsx support.class.component.tsx
^
source.tsx meta.tag.without-attributes.tsx punctuation.definition.tag.end.tsx

28
tests/cases/Issue632.tsx Normal file
Просмотреть файл

@ -0,0 +1,28 @@
// @onlyOwnGrammar - As this has jsx
<Bar>
{({ name }) => (
<HelloWorld<Foo>
name={name}
variants={['TEST']}
/>
)}
</Bar>
<Bar>
{({ name }) => (
<HelloWorld<
Foo>
name={name}
/>
)}
</Bar>
<Bar>
{({ name }) => (
<HelloWorld<
Foo>
name={name}
variants={['TEST']}
/>
)}
</Bar>