-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add highlighting for JSX fragment #535
Conversation
TypeScriptReact.YAML-tmLanguage
Outdated
|
||
#jsx tags | ||
jsx-fragment: | ||
name: meta.tag.fragment.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.
Instead of adding new rule for jsx-fragment,
Update: jsx-tag-without-attributes-in-expression and jsx-tag-without-attributes as:
#jsx tags
jsx-tag-without-attributes-in-expression:
begin: |-
(?x)
(?<=[({\[,?=>:*]|&&|\|\||\?|\Wreturn|^return|\Wdefault|^)\s*
(?=(<)\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?<!\.|-))?\s*(>))
end: (?!\s*(<)\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?<!\.|-))?\s*(>))
patterns:
- include: '#jsx-tag-without-attributes'
jsx-tag-without-attributes:
name: meta.tag.without-attributes.tsx
begin: (<)\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?<!\.|-))?\s*(>)
end: (</)\s*((?:[a-z][a-z0-9]*|([_$a-zA-Z][-$\w.]*))(?<!\.|-))?\s*(>)
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.
Updated.
You also need to add the testcase mentioned in #534 here. |
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.
Need testcase + it would be just better to update jsx-tag-without attributes instead of creating new rule.
Yeah the intent here was not for this to be a complete PR, I was actually just trying to get appveyor to run the tests since they're so broken locally. |
Now ready for review with test. |
Adds support for #534 (also see facebook/jsx#93 for more info).