This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Type parameters on JSX open tag identifiers cause the JSX block to be highlighted incorrectly #34
Closed
Description
Edit by @rsese to add code from #34 (comment) and link to Apollo example code
export const TaskListItem = ({ id, children }: taskListItemProps) => (
<Query<taskListItem, taskListItemVariables>
query={TASK_LIST_ITEM}
variables={{ id }}
>
{(queryProps) => {
const { loading, data } = queryProps
if (!loading && data && data.task) {
return (
<Mutations task={data.task}>
{(mutations) => {
return children({ ...queryProps, mutations })
}}
</Mutations>
)
} else {
return children({ ...queryProps, mutations: undefined })
}
}}
</Query>
)
Apollo code example: https://github.com/apollographql/react-apollo/blob/master/examples/typescript/src/Character.tsx
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
when adding aliases (?) to a component the rest of the JSX does not render correctly
for example, in the following code
<Query<taskListItem, taskListItemVariables>
query={TASK_LIST_ITEM}
variables={{ id }}
>
{(queryProps) => (
<Mutations id={id}>
{(mutations) => {
const finalProps = { ...queryProps, mutations }
return children(finalProps)
}}
</Mutations>
)}
</Query>
the <taskListItem, taskListItemVariables>
causes the entire jsx block to be rendered incorrectly.
inspecting it looks like the scope goes from:
source.tsx
meta.var.expr.tsx
meta.tag.tsx
entity.name.tag.tsx
support.class.component.tsx
to
source.tsx
meta.var.expr.tsx
variable.other.readwrite.tsx
Versions
Atom: 1.34.0
language-typescript: 0.4.11