windwp / nvim-ts-autotag

Use treesitter to auto close and auto rename html tag
MIT License
1.62k stars 86 forks source link

Autocompletion Incorrectly Expands Self-Closing Tags in React JSX #124

Closed Innei closed 6 months ago

Innei commented 1 year ago

Hello,

I'm experiencing an issue with the nvim-ts-autotag plugin where the autocompletion feature is not correctly expanding self-closing tags.

Current Behavior:

When I type <Img /, the plugin automatically completes it as <Img /Img>, which is not the expected behavior.

Expected Behavior:

The expected behavior is for the plugin to complete the tag as <Img />.

Steps to Reproduce:

Open a .jsx or .tsx file. Start typing a self-closing tag, for example: <Img /. The plugin incorrectly autocompletes the tag as <Img /Img>.

Env

    ● nvim-ts-autotag 1.29ms  start
        dir    /Users/innei/.local/share/nvim/lazy/nvim-ts-autotag
        url    https://github.com/windwp/nvim-ts-autotag
        branch main
        commit 6be1192
        readme README.md
2Senn commented 1 year ago

Having the same issue. Any fix?

nomnivore commented 1 year ago

I'm also facing this problem. I think that conditionally turning off the close_on_slash feature while inside of a tag element should suffice.

2Senn commented 1 year ago

That kinda solves the problem but it sorta created a new issue. The functionality for closing tags like:

broke. Basically it does not create a closed tag for it anymore which is sadge.
doganalper commented 1 year ago

@2Senn I haven't turned off close_on_slash feature yet and I'm facing issue you mentioned above. I don't think turning off that feature caused it.

gonstoll commented 1 year ago

Getting the same here 😔 turning off close_on_slash works as a temporary fix. Hope this gets sorted out soon!

andelkocvjetkovic commented 12 months ago

I'm having the same issues.

AnthonyDugarte commented 10 months ago

Having the same issues.

alevor657 commented 9 months ago

Same issues here

kuator commented 9 months ago

Same issue

kuator commented 9 months ago

Alternative solution: https://github.com/aca/emmet-ls/issues/69

drew-harris commented 9 months ago

Also having the same issue. Feels like it started happening out of no where

sajadspeed commented 8 months ago

Same here.

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.