nvim-ts-autotag icon indicating copy to clipboard operation
nvim-ts-autotag copied to clipboard

Autocompletion Incorrectly Expands Self-Closing Tags in React JSX

Open Innei opened this issue 2 years ago • 12 comments

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

Innei avatar Jul 17 '23 15:07 Innei

Having the same issue. Any fix?

2Senn avatar Jul 18 '23 08:07 2Senn

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.

nomnivore avatar Jul 19 '23 01:07 nomnivore

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

<NavigationStack.Navigator>

broke. Basically it does not create a closed tag for it anymore which is sadge.

2Senn avatar Jul 20 '23 09:07 2Senn

@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.

doganalper avatar Jul 20 '23 10:07 doganalper

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

gonstoll avatar Aug 31 '23 19:08 gonstoll

I'm having the same issues.

andelkocvjetkovic avatar Sep 08 '23 07:09 andelkocvjetkovic

Having the same issues.

AnthonyDugarte avatar Nov 02 '23 15:11 AnthonyDugarte

Same issues here

alevor657 avatar Nov 13 '23 01:11 alevor657

Same issue

kuator avatar Nov 14 '23 04:11 kuator

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

kuator avatar Nov 14 '23 15:11 kuator

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

drew-harris avatar Nov 21 '23 05:11 drew-harris

Same here.

sajadspeed avatar Dec 12 '23 10:12 sajadspeed

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.

stale[bot] avatar Feb 10 '24 16:02 stale[bot]