简体   繁体   English

如何在 Visual Studio Code 中启用 PHP 语法突出显示?

[英]How can I enable PHP Syntax highlighting in Visual Studio Code?

I use MAMP (on windows) as a local web server and I just started to use Visual Studio Code.我使用 MAMP(在 Windows 上)作为本地 web 服务器,我刚刚开始使用 Visual Studio Code。 I set the php.exe path in the settings.json file trough "php.validate.executablePath".我在 settings.json 文件槽“php.validate.executablePath”中设置了 php.exe 路径。 It seems work, or maybe it gives me no error, so I think it's working, but the PHP syntax highlighting doesn't work.它似乎有效,或者它可能没有给我任何错误,所以我认为它有效,但 PHP 语法突出显示不起作用。 All my variables are white colored and so the functions.我所有的变量都是白色的,函数也是如此。

What could be the problem?可能是什么问题呢?

Thank you all.谢谢你们。

EDIT: Ok, this was a theme problem and the highlighting started to work properly, but my " <?php?> " tags inside the html code look the same color as other tags.编辑:好的,这是一个主题问题,突出显示开始正常工作,但 html 代码中我的“ <?php?> ”标签看起来与其他标签颜色相同。 Is there a way to fix it?有办法解决吗?

Make sure you didn't forget your确保你没有忘记你的

<?php ... ?>

tags标签

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM