[VS Code] 解决JSON文件注释提示Comments are not permitted in JSON.
问题:
打开JSON文件,发现注释中出现一堆问题提示,鼠标指示上去提示 Comments are not permitted in JSON.
解决:
1.点击右下角的JSON.
2.输入json,找到jsonc并点击。
补充:
发现把VS Code关掉后,再次打开Json文件时,文件注释又出现提示了。
解决方法时配置到Settings.json:
1.全局配置方式。
"files.associations": {
"*.json": "jsonc"
},
2.特定文件配置方式。这个没去试。
"files.associations": { "<specific file>.json": "jsonc" }