Ice*_*per 9 typescript tsconfig visual-studio-code
我想在 VS Code 中使用名为“tsconfig.custom.json”的自定义 tsconfig,但它似乎只识别名为“tsconfig.json”的 tsconfig 文件。有办法改变吗?
正如评论中已经提到的,在撰写本文时,VS Code 中尚未完全支持名为“tsconfig.json”以外的任何名称的 tsconfig文件。请参阅 VS Code GitHub 存储库上的此问题:允许显式指定 tsconfig.json 文件名 #12463。有趣的注意:请参阅线程的末尾,了解为什么您不应该在问题单中用非建设性的“我也是”评论来困扰项目维护者:P
不过,您至少可以通过告诉 VS Code 文件使用什么 JSON 架构来自动完成字段填写。使用json.schemas
如下设置:
"json.schemas": [
{
"fileMatch": [ "*tsconfig*.json" ],
"url": "http://json.schemastore.org/tsconfig",
}
],
Run Code Online (Sandbox Code Playgroud)
根据需要调整全局模式。
如果您的顶级 tsconfig 名为 tsconfig.json 并且它扩展了未命名为“tsconfig.json”的其他 tsconfig,则基于继承的配置设置对 IntelliSense 的支持应该可以正常工作(我很确定原因是因为该功能是由 ts-server 处理,而不是直接由 VS Code 处理)。
归档时间: |
|
查看次数: |
4285 次 |
最近记录: |