[英]How can I make visual studio highlight .php files
Hope the title explains it all, but all I'm trying to do is open some .php files in my web-site solution and have Visual studio treat them as if they are html files. 希望标题解释一切,但我想要做的就是在我的网站解决方案中打开一些.php文件,让Visual Studio将它们视为html文件。 I don't need the actual PHJP code highlighted (it's only includes). 我不需要突出显示实际的PHJP代码(它只包含)。 The HTML syntax should be parse-able, should it not? 如果不是,HTML语法应该是可解析的?
Tools -> Options -> Text Editor -> File Extension 工具 - >选项 - >文本编辑器 - >文件扩展名
in the Extension box, put .php. 在扩展框中,输入.php。 For the Editor, you can select HTML Editor. 对于编辑器,您可以选择HTML编辑器。 Click Add, then OK 单击添加,然后单击确定
You can also install the PHP Tools for Visual Studio add-in. 您还可以安装Visual Studio加载项的PHP工具。 Tools > Extension and Updates and then search for PHP online. 工具>扩展和更新,然后在线搜索PHP。 Your first result should be this add-in. 你的第一个结果应该是这个加载项。
If not, you can get it from here: 如果没有,你可以从这里得到它:
http://visualstudiogallery.msdn.microsoft.com/6eb51f05-ef01-4513-ac83-4c5f50c95fb5 http://visualstudiogallery.msdn.microsoft.com/6eb51f05-ef01-4513-ac83-4c5f50c95fb5
If you want intellisense, debug, and other advanced functionality, you could get the php ide for VS 如果你想要智能感知,调试和其他高级功能,你可以获得VS的php ide
If all you need is syntax highlighting, check out this link. 如果您只需要语法高亮显示,请查看此链接。 It's what I'm currently using, but doesn't have all the goodies of vs.php. 这是我目前正在使用的,但没有vsphp的所有好处。
安装Phalanger 。
If you're using VS2013 or older, I would recommend this extension for PHP Language support : https://visualstudiogallery.msdn.microsoft.com/2a10ba81-26c5-47d9-939b-6bcc7bbec251 如果您使用的是VS2013或更早版本,我建议使用此扩展以支持PHP语言: https ://visualstudiogallery.msdn.microsoft.com/2a10ba81-26c5-47d9-939b-6bcc7bbec251
For me Josh's solution didn't work and Miguel's solution needs PHP Tools which is free for 30 days but then you need to activate it. 对我来说, Josh的解决方案不起作用, Miguel的解决方案需要30天免费的PHP工具,但是你需要激活它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.