VS Code Multiple Language highlighters in one File

拥有回忆 提交于 2019-12-12 15:13:43

问题


First of all, I have just migrated to VS Code for Sublime Text couple of days back.

what I want is to Multiple Language highlighters in one Language extension.

eg: I want to highlight the proper ending tags of HTML,PHP and Javascript inside .php file.

The only method I could find out was in the settings I added this following code:

"files.associations": {
        "*.php":"html, php"
 }

When I tried this the .php file only highlights the HTML syntax.

So is there any extension or any other way of achieving the result I want.?


回答1:


I have found a long way (always welcomes a better answers)

The only way I came across is to change the language according to our need using shortcuts and after working change it back.

eg:

If we are working on .php file and you have to check the html syntax then.

Click - ctrl+K and after a little time click - M

this will bring a Search Bar just type the language you need in my case, html and this will make the default language html so html syntax highlighting will work fine after working you can do the same and change it back.

This can be done other way, just click on the language(PHP) you see at the bottom of the VS code editor then the Search Bar will come and then follow the steps above.

Hoping this would be Helpful for you.'

One more time - a better answer is always welcome



来源:https://stackoverflow.com/questions/48437559/vs-code-multiple-language-highlighters-in-one-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!