简体   繁体   English

如何使Visual Studio Code在一个文件中识别html,php和javascript?

[英]How can I make Visual Studio Code recognize html, php and javascript all in one file?

I started using Visual Studio Code and I have noticed that it recognizes only one language at a time. 我开始使用Visual Studio Code,我注意到它一次只能识别一种语言。 Is there a way to change that so that I can have 3 recognized languages (HTML, JavaScript, PHP) all in the same .php file? 有没有一种方法可以更改,以便我可以在同一.php文件中全部使用3种公认的语言(HTML,JavaScript,PHP)?

So I can get colors and snippets and such for all 3 languages at the same time 这样我就可以同时获取所有三种语言的颜色和摘要

Ideally you would use only one of them per file, but using the PHP language the editor supports all these languages. 理想情况下,每个文件只使用其中一种,但是使用PHP语言,编辑器支持所有这些语言。

在此处输入图片说明

From vscode 1.20 (Jan 2018) it's possible to create Global snippets : 从vscode 1.20(2018年1月)起 ,可以创建Global片段

{
    "check": {
        "scope": "html,javascript,php",
        "prefix": "check",
        "body": [
            "✅"
        ]
    }
}

To make it work in all languages simply omit the "scope" 要使其适用于所有语言,只需忽略"scope"

暂无
暂无

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

相关问题 有没有办法让 Visual Studio Code 识别 PHP 文件中的 HTML 语法 - Is there a way to make Visual Studio Code recognize HTML syntax in PHP files 如何配置Visual Studio Code以将扩展名为.js以外的文件识别为Javascript - How can I configure Visual Studio Code to recognize files with extensions other than .js as Javascript 有没有办法让Visual Studio代码识别EJS文件中的HTML语法 - Is there a way to make Visual Studio Code recognize HTML syntax in EJS files Visual Studio Code 无法识别 HTML 文件 - Visual Studio Code don't recognize HTML file 如何在类似 Unix 的 Visual Studio Code 中的所有文件中制作所有行结尾 (EOL)? - How can I make all line endings (EOLs) in all files in Visual Studio Code, Unix-like? 我在哪里可以找到带有 PHP 用户片段的扩展程序或网站,以在 HTML 文件中使用? (Visual Studio 代码) - Where can I find an extension or website with PHP user snippets to be used in an HTML file? (Visual Studio Code) Visual Studio 代码 React 无法识别 html - visual studio code React does not recognize html 如何在 Visual Studio Code 中使用 HTML 标记格式化 PHP 文件? - How can I format PHP files with HTML markup in Visual Studio Code? 如何在 Visual Studio Code 中为 CSS 文件和 html 或 PHP 文件提供空格? - How can I have spaces for CSS files and tabs for html or PHP files in Visual Studio Code? Visual Studio Code 无法将术语“php”识别为命令 - Visual Studio Code not recognize the term "php" as a command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM