Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support configurable file extension #3

Closed
zephyrpathsofglory opened this issue Jan 7, 2021 · 7 comments
Closed

Support configurable file extension #3

zephyrpathsofglory opened this issue Jan 7, 2021 · 7 comments

Comments

@zephyrpathsofglory
Copy link

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.

@jinliming2
Copy link
Owner

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

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

image

@danny-does-stuff
Copy link

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

@jinliming2
Copy link
Owner

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.

jinliming2 added a commit that referenced this issue Jan 12, 2021
@jinliming2
Copy link
Owner

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

image

@zephyrpathsofglory
Copy link
Author

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!

@sekaninat
Copy link

sekaninat commented Nov 25, 2021

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?

@balusarakesh
Copy link

I'm having the same problem as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants