Danial Ahmed
Danial Ahmed

Reputation: 866

Any way to integrate HTML snippets with django snippets?

I have two extensions installed one is Django (Baptiste Darthenay) and other is HTML Snippets (Mohamed Abusaid). By default every .html file was getting detecting as django-html and it had no intellisense so I changed the file.associations to following: enter image description here

this has solved problem for html files which are not inside **/tempaltes/**/* but anything in side it doesnt have any intellisense at all. enter image description here

enter image description here

Upvotes: 1

Views: 1050

Answers (1)

GriceTurrble
GriceTurrble

Reputation: 58

You can tell Emmet (which is what's used for these snippets; details here) to use one language's snippets in another. To enable the html snippets in the django-html language, add the following to your VS Code settings (in the settings JSON editor):

"emmet.includeLanguages": {
  "django-html": "html"
},

In the Settings UI mode, you can find this as Emmet: Include Languages. Click "Add Item", set "Key" to django-html and "Value" to html, then click "OK"

Upvotes: 4

Related Questions