-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
fix(#199): Auto-tag react fragments #202
Conversation
Detects if `<>` was typed in a react file (`js`, `jsx`, or `tsx`) and autocloses the fragment tag.
Assigning myself as a reminder to look at this in a bit when I'm available. |
@PriceHiller No problem. I'm writing a few more tests to ensure it's working correctly. I know there's a possible issue in This shouldn't be an issue in |
I found a couple issues when running the tests. I'm working on a fix now. |
If the tests fail due to incompatibility between this and a less important feature (like automatically adding a closing tag for an opening tag without a closing partner) and it proves to be too difficult to resolve the compatilibty between them just list out the compatability issues and we can decide if it's worth losing something for this. Fragment closing seems to be quite popular in terms of requested features so I'm ok with losing lesser known/used features for it. If that turns out to be the case though, I'll be marking this as the start of autotag 1.0.0 and yanking some things that have been marked as deprecated for a while. |
It should all be compatible. I just made an error with boolean logic and need one extra check function and (hopefully) everything should work. There are a couple of tests failing on the main branch. I'm making my measure of success as getting the same tests that fail on main to match the PR's tests. |
Refactor: Moved detection functions into `utils.lua` Fix: Improved react detection logic in `.js` files
Yeah, those tests appear to be failing due to an update upstream in Probably not your fault based on what I'm seeing locally. Entirely separate issue (though it is a problem). |
We should make an issue to get them fixed so at least it's documented. |
Already done 😉 (#205) |
Ping me when you're good to go over here (or convert this PR to a draft and then promote it when you're ready) and I'll take a look |
It's good to go |
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.
Overall, it looks great!
Can you run make format
for me and push those changes? You'll need stylua
installed for the formatting.
I really need to add a CI check for formattingn now that I've noticed this 😅
Also, for clarification's sake, do I need to close #185 once this is merged? |
Co-authored-by: Price Hiller <[email protected]>
No, #185 will get it's own PR. I probably won't get it done today, but in the near future. |
Gotcha, no rush on it. You're doing god's work right now. I'll leave that issue alone then. Just hit it with a |
Awesome, thanks again @roycrippen4 -- great work! |
Happy to help! |
Is there a way to opt out from this feature, or potentially change current behavior. Right now it causes problems when i want to pass type arguments by adding </>. For example: |
Auto-closes react fragment tags in
js
,jsx
, andtsx
files.