Visual Studio Code (VS Code) has a built-in feature that allows you to associate a file extension with a specific language. This is called "language mode."
Here are the steps you can follow to associate a file extension with a specific language in VS Code:
Restart VS Code for the changes to take effect.
Alternatively, you can also make these association by editing the settings.json file, you can do that by going to Preferences: Open User Settings and then add the following to your settings.json
"*.phhtml": "php" }"files.associations": {
As the second way
1. Press ctrl + shift + p
2. Type and click "Preferences:Open User Settings Json"
3. add the following code
"intelephense.files.associations": [
"*.php",
"*.phtml"
],
"files.associations": {
"*.phhtml": "php"
},
This way, you can make your own extension behave like your target language in vscode editor with the adjustments you make.