提交 736ff0bd 编写于 作者: M Martin Aeschlimann

[json] move schema associations to extensions

上级 89824341
......@@ -14,6 +14,10 @@
"language": "csharp",
"scopeName": "source.cs",
"path": "./syntaxes/csharp.json"
}],
"jsonValidation": [{
"fileMatch": "project.json",
"url": "http://json.schemastore.org/project"
}]
}
}
\ No newline at end of file
......@@ -2,37 +2,86 @@
"name": "javascript",
"version": "0.1.0",
"publisher": "vscode",
"engines": { "vscode": "*" },
"engines": {
"vscode": "*"
},
"contributes": {
"languages": [{
"id": "javascriptreact",
"aliases": ["JavaScript React","jsx"],
"extensions": [".jsx"],
"configuration": "./javascript.configuration.json"
},{
"id": "javascript",
"aliases": ["JavaScript", "javascript", "js"],
"extensions": [".js", ".es6"],
"filenames": ["jakefile"],
"firstLine": "^#!.*\\bnode",
"mimetypes": ["text/javascript"]
}],
"grammars": [{
"language": "javascriptreact",
"scopeName": "source.jsx",
"path": "./syntaxes/JavaScriptReact.tmLanguage"
},{
"language": "javascript",
"scopeName": "source.js",
"path": "./syntaxes/JavaScript.tmLanguage"
},{
// referenced by other grammars
"scopeName": "source.js.regexp",
"path": "./syntaxes/Regular Expressions (JavaScript).tmLanguage"
}],
"snippets": [{
"language": "javascript",
"path": "./snippets/javascript.json"
}]
"languages": [
{
"id": "javascriptreact",
"aliases": [
"JavaScript React",
"jsx"
],
"extensions": [
".jsx"
],
"configuration": "./javascript.configuration.json"
},
{
"id": "javascript",
"aliases": [
"JavaScript",
"javascript",
"js"
],
"extensions": [
".js",
".es6"
],
"filenames": [
"jakefile"
],
"firstLine": "^#!.*\\bnode",
"mimetypes": [
"text/javascript"
]
}
],
"grammars": [
{
"language": "javascriptreact",
"scopeName": "source.jsx",
"path": "./syntaxes/JavaScriptReact.tmLanguage"
},
{
"language": "javascript",
"scopeName": "source.js",
"path": "./syntaxes/JavaScript.tmLanguage"
},
{
// referenced by other grammars
"scopeName": "source.js.regexp",
"path": "./syntaxes/Regular Expressions (JavaScript).tmLanguage"
}
],
"snippets": [
{
"language": "javascript",
"path": "./snippets/javascript.json"
}
],
"jsonValidation": [
{
"fileMatch": "package.json",
"url": "http://json.schemastore.org/project"
},
{
"fileMatch": "bower.json",
"url": "http://json.schemastore.org/bower"
},
{
"fileMatch": ".bower.json",
"url": "http://json.schemastore.org/bower"
},
{
"fileMatch": ".bowerrc",
"url": "http://json.schemastore.org/bowerrc"
},
{
"fileMatch": "jsconfig.json",
"url": "./schemas/jsconfig.schema.json"
}
]
}
}
\ No newline at end of file
{
"title": "JSON schema for the JavaScript configuration file",
"type": "object",
"default": {
"compilerOptions": {
"target": "ES5"
}
},
"properties": {
"compilerOptions": {
"type": "object",
"description": "Instructs the JavaScript language service how to validate .js files",
"properties": {
"charset": {
"description": "The character set of the input files",
"type": "string"
},
"diagnostics": {
"description": "Show diagnostic information.",
"type": "boolean"
},
"locale": {
"description": "The locale to use to show error messages, e.g. en-us.",
"type": "string"
},
"mapRoot": {
"description": "Specifies the location where debugger should locate map files instead of generated locations",
"type": "string",
"format": "uri"
},
"module": {
"description": "Module code generation to resolve against: 'commonjs', 'amd', 'system', or 'umd'.",
"enum": [
"commonjs",
"amd",
"system",
"umd"
]
},
"noLib": {
"description": "Do not include the default library file (lib.d.ts).",
"type": "boolean"
},
"target": {
"description": "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental).",
"enum": [
"ES3",
"ES5",
"ES6",
"es3",
"es5",
"es6"
],
"default": "ES3"
},
"experimentalDecorators": {
"description": "Enables experimental support for ES7 decorators.",
"type": "boolean"
}
}
},
"files": {
"type": "array",
"description": "If no 'files' property is present in a jsconfig.json, the language service defaults to including all files the containing directory and subdirectories. When a 'files' property is specified, only those files are included.",
"items": {
"type": "string",
"format": "uri"
}
},
"exclude": {
"type": "array",
"description": "List files and folders that should not be included. This property is not honored when the 'files' property is present.",
"items": {
"type": "string",
"format": "uri"
}
}
}
}
\ No newline at end of file
......@@ -2,18 +2,41 @@
"name": "json",
"version": "0.1.0",
"publisher": "vscode",
"engines": { "vscode": "*" },
"engines": {
"vscode": "*"
},
"contributes": {
"languages": [{
"id": "json",
"aliases": ["JSON", "json"],
"extensions": [".json", ".bowerrc", ".jshintrc", ".jscsrc", ".eslintrc"],
"mimetypes": ["application/json"]
}],
"grammars": [{
"language": "json",
"scopeName": "source.json",
"path": "./syntaxes/JSON.tmLanguage"
}]
"languages": [
{
"id": "json",
"aliases": [
"JSON",
"json"
],
"extensions": [
".json",
".bowerrc",
".jshintrc",
".jscsrc",
".eslintrc"
],
"mimetypes": [
"application/json"
]
}
],
"grammars": [
{
"language": "json",
"scopeName": "source.json",
"path": "./syntaxes/JSON.tmLanguage"
}
],
"jsonValidation": [
{
"fileMatch": "*.schema.json",
"url": "http://json-schema.org/draft-04/schema#"
}
]
}
}
\ No newline at end of file
......@@ -101,6 +101,12 @@
"language": "typescriptreact",
"path": "./snippets/typescriptreact.json"
}
],
"jsonValidation": [
{
"fileMatch": "tsconfig.json",
"url": "http://json.schemastore.org/tsconfig"
}
]
}
}
\ No newline at end of file
......@@ -71,7 +71,11 @@ export class JSONValidationExtensionPoint {
collector.error(nls.localize('invalid.url.schema', "'configuration.jsonValidation.url' must start with 'http:', 'https:' or './' to reference schemas located in the extension"));
return;
}
schemaRegistry.addSchemaFileAssociation(extension.fileMatch, uri);
var fileMatch = extension.fileMatch;
if (!strings.startsWith(extension.fileMatch, '/')) {
fileMatch = '/' + fileMatch;
}
schemaRegistry.addSchemaFileAssociation(fileMatch, uri);
});
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册