-
Notifications
You must be signed in to change notification settings - Fork 133
support namespaced tsx #557
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
Conversation
^ | ||
source.tsx | ||
>const valid2 = <namespaced:tag namespaced:boolean-attr>foo</namespaced:tag>; | ||
^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:tag
and :boolean-attr
is getting scoped here instead of just tag
and boolean-attr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was intended, to highlight the colon the same color as the rest of the tag/attribute.
Would you prefer the colon to have its own scope? (punctuation.separator.namespace.tsx
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be good
@@ -0,0 +1,9 @@ | |||
const valid1 = <standard-tag standard-attribute="foo" />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment // @onlyOwnGrammar - As this has jsx
at the top to avoid scoping this for TypeScript without react support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the test baseline
✓ |
Add support for namespaced tsx as per jsx specification.
This is not a breaking change. All tests are green, I added an additional test for good measure.
The change is pretty simple, but it ends up being quite big due to the sheer amount of similar regexes:
A namespaced tag or attribute is defined by an identifier (namespace), followed by a colon, followed by another identifier (name), which gives us this addition: