this extention inherit from https://github.com/vscode-django/vscode-django, thanks.
- syntax highlight;
- html, css, javascript syntax highlight;
- format and pretty code;
- auto completion for html tags, attributes, css, javascript;
- some error/problem tips when formatting;
- formatted by prettier, can automatic search prettier config file in the dirs, such as .prettierrc, .prettier.json...;
.django
.dj
"files.associations": {
"**/views/**/*.html": "django-html",
"*.tpl": "django-html"
},
- shortcut:
shift+alt+f
- context menu:
Format Document
- set formatting on saving files:
"[django-html]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "junstyle.vscode-django-support"
},
When you are not happy with how Prettier formats a certain element or section in the code, you can tell it to leave it in peace:
{# prettier-ignore #}
<div class="weird-formatting" >This will not be re-formatted</div>
<div class="weird-formatting" >But this will be</div>
You can also tell Prettier to leave entire regions as they are:
{# prettier-ignore-start #}
...
{# prettier-ignore-end #}