You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Django templates which have a .html extension, exactly like other html files that are not django templates.
I want to use specific formatters for these two kinds of files:
Prettier for normal html files (VS Code Language mode: HTML)
Djhtml for django templates (VS Code Language mode: Django HTML)
Now, obviously, my normal html files are first auto formatted by Prettier, then by djhtml. This is not what I want.
I think a way to fix this would be runonsave allowing me to match files in a specific language mode, rather than just by a regex.
What do you think?
The text was updated successfully, but these errors were encountered:
ddahan
changed the title
Use VS Code Language mode rather than regex to filter files?
Use VS Code Language mode in addition to regex to filter files?
May 4, 2022
For now, my workaround is to use: "match": ".*/templates/.*\\.html$" to target specific Django html files. It's not a real solution but it does the job.
I like the idea of adding languageid support. One option that comes to mind is using vscode settings [languageid] settings to isolate. I'll definitely consider adding this one.
I'm using Django templates which have a
.html
extension, exactly like other html files that are not django templates.I want to use specific formatters for these two kinds of files:
I wrote a runonsave config:
Now, obviously, my normal html files are first auto formatted by Prettier, then by djhtml. This is not what I want.
I think a way to fix this would be runonsave allowing me to match files in a specific language mode, rather than just by a regex.
What do you think?
The text was updated successfully, but these errors were encountered: