windwp / nvim-ts-autotag

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

How to get html tag closures within templ files? #152

Closed AnthonyPoschen closed 8 months ago

AnthonyPoschen commented 9 months ago

Templ is a templating language for use within golang. Example file hello.templ

package main

templ hello(name string) {
    <div class="">Hello, { name }</div>
}

templ foo(name string) {
    <div class="">
        @hello(name)
    </div>
}

I would like to be able to get the html tags autocompleted when they appear. i have tried the below "minified" lazy config

    {
        "windwp/nvim-ts-autotag",
        opts = {
            filetypes = {
                "templ",
            },
        },
    },

I suspected the templ format needs to become part of the internal file's html filetypes, maybe would be good if those tables could be exposed to allow easy extension.

cayo-rodrigues commented 8 months ago

This is awesome. But what about auto tag renaming? I tried it localy and the autoclose feature works like a charm ❤️ but the renaming feature still not working

AnthonyPoschen commented 8 months ago

thanks, didn't realise that was a thing I didn't attempt to implement that.

axzilla commented 4 months ago

This is awesome. But what about auto tag renaming? I tried it localy and the autoclose feature works like a charm ❤️ but the renaming feature still not working

Hey there, are there any updates on the auto renaming function?