gpt4 book ai didi

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

转载 作者:技术小花猫 更新时间:2023-10-29 12:55:24 25 4
gpt4 key购买 nike

我在 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com