【问题标题】:Visual Studio Code php in htmlhtml 中的 Visual Studio Code php
【发布时间】:2018-05-25 02:26:03
【问题描述】:

如何在 vscode 的 HTML 文件中启用 PHP 语法和 PHP 自动完成功能?

默认 vscode 在 HTML 文件中看不到 PHP。

【问题讨论】:

    标签: php html visual-studio-code


    【解决方案1】:

    PHP Intelephense 扩展将在 <?php ?> 之外时将请求转发到 vscode html 语言服务器,并在 <?php ?> 内时提供 php 智能感知,您必须处于 php 语言模式。

    *免责声明 - 我是作者

    【讨论】:

      【解决方案2】:

      当你用 html、php 和 js 混合匹配时会出现问题。他们可能会修复。同时,您必须寻找其他工具。 issue - https://github.com/Microsoft/vscode/issues/6616

      有一些工具可以做到这一点。在谷歌上搜索它们。

      其中一种是

      https://marketplace.visualstudio.com/items?itemName=HvyIndustries.crane

      【讨论】:

      • 没有。 PHP智能感知我有,但他不支持html。
      • html、php、js混合匹配时出现问题。他们可能会修复。同时,您必须寻找其他工具。 github.com/Microsoft/vscode/issues/6616
      猜你喜欢
      • 2019-10-06
      • 2015-11-21
      • 1970-01-01
      • 1970-01-01
      • 2017-08-11
      • 2017-12-05
      • 1970-01-01
      • 2017-05-28
      • 1970-01-01
      相关资源
      最近更新 更多