Skip to content
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

How to enable auto tag for react fragments? #199

Closed
AlejandroSanchez90 opened this issue Jun 22, 2024 · 6 comments · Fixed by #202
Closed

How to enable auto tag for react fragments? #199

AlejandroSanchez90 opened this issue Jun 22, 2024 · 6 comments · Fixed by #202

Comments

@AlejandroSanchez90
Copy link

it possible to make this work for fragments swell?

<> => </>

@roycrippen4
Copy link
Contributor

roycrippen4 commented Jul 14, 2024

@AlejandroSanchez90, for clarification, you want version 1?

| = cursor position

Version 1

Old text   Command   New text
   <|         >       <>|</>

Version 2

Old text   Command   New text
   <|         >        </>

roycrippen4 pushed a commit to roycrippen4/nvim-ts-autotag that referenced this issue Jul 14, 2024
Detects if `<>` was typed in a react file (`js`, `jsx`, or `tsx`)
and autocloses the fragment tag.
roycrippen4 pushed a commit to roycrippen4/nvim-ts-autotag that referenced this issue Jul 14, 2024
Detects if `<>` was typed in a react file (`js`, `jsx`, or `tsx`)
and autocloses the fragment tag.
roycrippen4 added a commit to roycrippen4/nvim-ts-autotag that referenced this issue Jul 14, 2024
roycrippen4 added a commit to roycrippen4/nvim-ts-autotag that referenced this issue Jul 14, 2024
roycrippen4 added a commit to roycrippen4/nvim-ts-autotag that referenced this issue Jul 14, 2024
@PriceHiller
Copy link
Collaborator

PriceHiller commented Jul 14, 2024

Should/will be closed by #202

(Thanks to @roycrippen4 for the hard work 😄)

Duplicate of #185. Since there's discussion on-going here, I'll leave this open as well and close it alongside #185.

The above is incorrect, see next comment.

@PriceHiller PriceHiller linked a pull request Jul 14, 2024 that will close this issue
@roycrippen4
Copy link
Contributor

roycrippen4 commented Jul 14, 2024

@PriceHiller Unfortunately it's not a duplicate of #185. It's a similar-ish problem, but #202 doesn't solve #185. I'll be submitting a separate PR for that issue.

@AlejandroSanchez90
Copy link
Author

@AlejandroSanchez90, for clarification, you want version 1?

| = cursor position

Version 1

Old text   Command   New text
   <|         >       <>|</>

Version 2

Old text   Command   New text
   <|         >        </>

Hi thanks for the reply, I was referring to version one

@roycrippen4
Copy link
Contributor

Sounds good, @AlejandroSanchez90. A PR has been submitted that fixes this issue and should be merged in shortly.

@hanumanman
Copy link

hanumanman commented Oct 5, 2024

@roycrippen4 Thanks a lot for this feature! This works now when typing normally, but doesnt work when updating tag name using diw/ciw and the like
Example:
<div></div>
Delete div with diw => the text is now
<></div>
instead of
<></>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants