How can I make Visual Studio Code recognize html, php and javascript all in one file?

I started using Visual Studio Code, and I noticed that it only recognizes one language at a time. Is there a way to change this so that I can have 3 recognized languages ​​(HTML, JavaScript, PHP) in a single .php file?

This way I can get colors and fragments, etc. for all three languages ​​simultaneously

+6
source share
2 answers

Ideally, you should use only one of them for each file, but using the PHP language, the editor supports all of these languages.

enter image description here

+1
source

From vscode 1.20 (January 2018), you can create global fragments:

{ "check": { "scope": "html,javascript,php", "prefix": "check", "body": [ "✅" ] } } 

To make it work in all languages, just omit the "scope"

0
source

All Articles