php - 有没有办法让 Visual Studio Code 识别 PHP 文件中的 HTML 语法

标签 php html autocomplete visual-studio-code

我在 Mac 上使用 Visual Studio Code 来处理 WordPress 应用程序。

有没有办法让 Visual Studio Code 识别 HTML 并在 PHP 文件中使用它的功能(主要是自动完成)?

我之前搜索过这个答案,但只是被告知转到 Visual Studio Code 设置:文件 >> 首选项 >> 用户设置

// 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"}     
 }

但这样做会使您失去所有 PHP 支持和自动完成功能。

我希望 Microsoft 能够意识到 PHP 开发人员在创建应用程序/网站时通常会同时使用 PHP 和 HTML。如果可能的话,我很乐意使用 VS Code 而不是华丽但昂贵的 PHP Storm 。

最佳答案

你可以安装这个插件: PHP Intelephense

关于php - 有没有办法让 Visual Studio Code 识别 PHP 文件中的 HTML 语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45947972/

相关文章:

php - 使用 php 设置 firebase v3 自定义身份验证

html - 具有固定位置的可调整大小的居中 div 标签

javascript - 未捕获的类型错误 : Object [object Object] has no method 'autocomplete' (maybe not a conflict issue)

java - Java 的 Vim omnicompletion

angularjs - 使用 typeahead 和 Angularjs 像 Outlook 一样自动完成

php - 实现Zend Framework是否需要修改现有的MySQL数据库?

PHP 包含多个文件试图合并 SQL 查询

php - 从javascript调用php文件

html - 带有 2 个图像的 CSS 水平菜单;悬停状态和位置

html - `float: left;` 问题