jinliming2/vscode-go-template

Support configurable file extension

Closed this issue · 7 comments

Maybe configure like go-template-extra-file-extensions: 'gotmpl' makes files whose name matched *.gotmpl can also be identified as an go template file is really useful.

You can add your extension name to the files.associations in the settings to achieve this.
For example:

{
    "files.associations": {
        "*.gotmpl": "go-template"
    }
}

image

Will this work with file types that vscode already recognizes, like .yaml for example?

Will this work with file types that vscode already recognizes, like .yaml for example?

No, this breaks syntax highlight for internal languages.
I'm implementing a new version try to solve this, but only for keywords highlighting. It's a little bit hard to implement an embedded language due to an unresolved issue of VSCode.

I just published a new version (v0.1.0), including custom file extension config support, pls have a try and give feedback, thanks.

image

I just published a new version (v0.1.0), including custom file extension config support, pls have a try and give feedback, thanks.

image

yes, it works!

Hello, this seems promising 🤞 , but my editor doesn't recognize that it is i.e. yaml file when its name ends with .yaml.tmpl. So only the template syntax is highlighted but not yaml syntax.

Is there any solution to this please?

I'm having the same problem as above