windwp / nvim-ts-autotag

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

Doesn't rename tags in svelte files #164

Closed SebasF1349 closed 2 months ago

SebasF1349 commented 4 months ago

The plugin does auto close html tags, but doesn't rename them in svelte files (it works on html files). This is one of the many configs I tried.

{
    "windwp/nvim-ts-autotag",
    ft = { "html", "svelte", "markdown" },
    dependencies = "nvim-treesitter/nvim-treesitter",
    config = function()
      require("nvim-ts-autotag").setup({
        enable = true,
        enable_rename = true,
        enable_close = true,
        enable_close_on_clash = true,
        filetypes = { "svelte", "html" },
      })
    end,
}

The svelte parser is installed. I also tried adding the plugin in the treesitter config with this but with the same effect:

require'nvim-treesitter.configs'.setup {
  autotag = {
    enable = true,
    enable_rename = true,
    enable_close = true,
    enable_close_on_slash = true,
    filetypes = { "html" , "xml" },
  }
}

I checked many issues here but no solution worked for me. I'm not using any nvim distro. Any suggestion?

harrisonn26 commented 4 months ago

I'm having the same issue. Renaming works fine in html and tsx files, but not svelte files. Auto closing is working fine.

roycrippen4 commented 4 months ago

+1 Same problem as you @harrisonn26. Works great for html and jsx, but only getting auto-closing for svelte files.

roycrippen4 commented 4 months ago

I just made a PR for this issue @harrisonn26 and @SebasF1349. It's a super simple one line change if you want to go change it in the meantime.

RubyHuntsman commented 3 months ago

Link to @roycrippen4 pr https://github.com/windwp/nvim-ts-autotag/pull/167

SebasF1349 commented 3 months ago

Sorry that I forgot to reply, but it works.

PriceHiller commented 2 months ago

Should be closed by #173, as that PR was integrated in that fork which is now in the process of being merged back in.

PriceHiller commented 2 months ago

173 was merged. This should be resolved now.

I'll be closing this issue -- please ping me if this is still a problem and I'll reopen and investigate.

Thanks 🙂