我刚刚升级到TypeScript 1.5(不再是beta),在此过程中,我想利用VS Code中的json模式帮助器。
在配置tsconfig.json时,仅有的模块选项为commonjs
,amd
含义是umd
,system
基于以下内容,这些模块选项已丢失:http : //json.schemastore.org/tsconfig
我的问题是如何获取VS Code来刷新其架构缓存?
仅供参考,我尝试覆盖设置中的URL并将其改回,以及重新启动VS Code
我的问题是如何获取VS Code来刷新其架构缓存?
该模式实际上是硬编码在一个名为的文件中jsonWorker.js
(我的文件路径是C:\Users\basaratsyed\AppData\Local\Code\app-0.1.2\resources\app\client\vs\languages\json\jsonWorker.js
),该文件已缩小。这是由atom-beautify https://atom.io/packages/atom-beautify美化的相关代码:
this.addPreloadedFileSchema("http://json.schemastore.org/tsconfig", {
title: n.localize("vs_languages_json_jsonSchemaService", 110),
$schema: "http://json-schema.org/draft-04/schema#",
type: "object",
default: {
compilerOptions: {
target: "ES5",
module: "commonjs"
}
},
properties: {
compilerOptions: {
type: "object",
description: n.localize("vs_languages_json_jsonSchemaService", 111),
properties: {
charset: {
description: n.localize("vs_languages_json_jsonSchemaService", 112),
type: "string"
},
declaration: {
description: n.localize("vs_languages_json_jsonSchemaService", 113),
type: "boolean"
},
diagnostics: {
description: n.localize("vs_languages_json_jsonSchemaService", 114),
type: "boolean"
},
emitBOM: {
description: n.localize("vs_languages_json_jsonSchemaService", 115),
type: "boolean"
},
inlineSourceMap: {
description: n.localize("vs_languages_json_jsonSchemaService", 116),
type: "number"
},
inlineSources: {
description: n.localize("vs_languages_json_jsonSchemaService", 117),
type: "number"
},
listFiles: {
description: n.localize("vs_languages_json_jsonSchemaService", 118),
type: "boolean"
},
locale: {
description: n.localize("vs_languages_json_jsonSchemaService", 119),
type: "string"
},
mapRoot: {
description: n.localize("vs_languages_json_jsonSchemaService", 120),
type: "string",
format: "uri"
},
module: {
description: n.localize("vs_languages_json_jsonSchemaService", 121),
enum: ["commonjs", "amd"]
},
newLine: {
description: n.localize("vs_languages_json_jsonSchemaService", 122),
type: "boolean"
},
noEmit: {
description: n.localize("vs_languages_json_jsonSchemaService", 123),
type: "boolean"
},
noEmitOnError: {
description: n.localize("vs_languages_json_jsonSchemaService", 124),
type: "boolean"
},
noEmitHelpers: {
description: n.localize("vs_languages_json_jsonSchemaService", 125),
type: "boolean"
},
noImplicitAny: {
description: n.localize("vs_languages_json_jsonSchemaService", 126),
type: "boolean"
},
noLib: {
description: n.localize("vs_languages_json_jsonSchemaService", 127),
type: "boolean"
},
noResolve: {
type: "boolean"
},
out: {
description: n.localize("vs_languages_json_jsonSchemaService", 128),
type: "string",
format: "uri"
},
outDir: {
description: n.localize("vs_languages_json_jsonSchemaService", 129),
type: "string",
format: "uri"
},
preserveConstEnums: {
description: n.localize("vs_languages_json_jsonSchemaService", 130),
type: "boolean"
},
removeComments: {
description: n.localize("vs_languages_json_jsonSchemaService", 131),
type: "boolean"
},
rootDir: {
description: n.localize("vs_languages_json_jsonSchemaService", 132),
type: "boolean"
},
sourceMap: {
description: n.localize("vs_languages_json_jsonSchemaService", 133),
type: "boolean"
},
sourceRoot: {
description: n.localize("vs_languages_json_jsonSchemaService", 134),
type: "string",
format: "uri"
},
suppressImplicitAnyIndexErrors: {
description: n.localize("vs_languages_json_jsonSchemaService", 135),
type: "boolean"
},
target: {
description: n.localize("vs_languages_json_jsonSchemaService", 136),
enum: ["ES3", "ES5", "ES6", "es3", "es5", "es6"],
default: "ES3"
}
}
},
files: {
type: "array",
description: n.localize("vs_languages_json_jsonSchemaService", 137),
items: {
type: "string",
format: "uri"
}
}
}
})
还有一点更多的关注点:
module: {
description: n.localize("vs_languages_json_jsonSchemaService", 121),
enum: ["commonjs", "amd"]
},
如果你改变它
module: {
description: n.localize("vs_languages_json_jsonSchemaService", 121),
enum: ["commonjs", "amd", "umd", "system"]
},
然后重启vs代码就可以了
请注意,在美化了js文件后,VS Code仍然可以正常工作;)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句