Visual Studio Code 保存语言模式(覆盖默认值) [英] Visual Studio Code save language mode (override default)

查看:31
本文介绍了Visual Studio Code 保存语言模式(覆盖默认值)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个文件夹中有一些 ASP 文件.我想使用默认的 ASP 语言模式查看其中一些,其他我更喜欢以 HTML 格式查看.

I have some ASP files in a folder. I would like to view some of them using the default ASP language mode, others I prefer to view in HTML.

如果我将文件切换为使用 HTML,下次打开 VS Code 时它不会记住该设置.

If I switch a file to use HTML, it doesn't remember that setting next time I open VS Code.

是否可以为每个文件保存此设置?

Is it possible to save this setting per file?

提前致谢.

推荐答案

您正在寻找的是 "files.associations" 设置.您可以为每个文件或完整目录指定此设置:

What you are looking for is the "files.associations" setting. You can specify this setting for each file or also for complete directories:

"files.associations": {
    "**/somefolder/*.asp": "html", // add complete folder
    "**/myfileName.asp": "html" // add a specific file 
}

这篇关于Visual Studio Code 保存语言模式(覆盖默认值)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆