我刚刚升级到TypeScript 1.5(不再是测试版),并且这样做,希望利用VS Code中的json架构助手。
配置tsconfig.json时,唯一的模块选项是commonjs
和amd
,这意味着umd
和system
基于此缺失:http://json.schemastore.org/tsconfig
我的问题是如何让VS Code刷新架构的缓存?
仅供参考,我已尝试覆盖设置中的URL并将其更改回来以及重新启动VS Code
答案 0 :(得分:2)
我的问题是如何让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仍能正常工作;)
答案 1 :(得分:0)