I am using Visual Studio Code on a Mac to work on WordPress applications.
Is there a way to make Visual Studio Code recognize HTML and use it's features (mainly autocompletion) inside PHP files?
I've searched for this answer before but just get told to Go to Visual Studio Code Settings: File >> Preferences >> User Settings
// Place your settings in this file to overwrite the default settings { // Configure file associations to languages (e.g. "*.extension": "html"). These have precedence over the default associations of the languages installed. "files.associations": {"*.php": "html"} }
But doing this makes you lose all PHP support and autocompletion.
I wish Microsoft would realize that PHP developers commonly use PHP and HTML together when creating applications/websites. I would love to use VS Code instead of the magnificent but expensive PHP storm if possible.
As far as I can tell, it does. Take a look at this php
file I have created in VS Code (no extensions), with HTML inside the file with syntax highlighting for both languages.
There is a button (It should say the word PHP) in the bottom right corner of the screen that allows you to switch the syntax highlighting and autocompletion to another language, and while this does temporarily turn off PHP syntax, it will allow you to code in HTML a lot easier.
You can install this plugin intellisense-plugin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With