mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
2 lines
No EOL
1.4 KiB
JavaScript
2 lines
No EOL
1.4 KiB
JavaScript
"use strict";(self.webpackChunkmy_application=self.webpackChunkmy_application||[]).push([[4260],{4260:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});const o='// Configures two JSON schemas, with references.\n\nvar jsonCode = ["{", \' "p1": "v3",\', \' "p2": false\', "}"].join("\\n");\nvar modelUri = monaco.Uri.parse("a://b/foo.json"); // a made up unique URI for our model\nvar model = monaco.editor.createModel(jsonCode, "json", modelUri);\n\n// configure the JSON language support with schemas and schema associations\nmonaco.languages.json.jsonDefaults.setDiagnosticsOptions({\n\tvalidate: true,\n\tschemas: [\n\t\t{\n\t\t\turi: "http://myserver/foo-schema.json", // id of the first schema\n\t\t\tfileMatch: [modelUri.toString()], // associate with our model\n\t\t\tschema: {\n\t\t\t\ttype: "object",\n\t\t\t\tproperties: {\n\t\t\t\t\tp1: {\n\t\t\t\t\t\tenum: ["v1", "v2"],\n\t\t\t\t\t},\n\t\t\t\t\tp2: {\n\t\t\t\t\t\t$ref: "http://myserver/bar-schema.json", // reference the second schema\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\turi: "http://myserver/bar-schema.json", // id of the second schema\n\t\t\tschema: {\n\t\t\t\ttype: "object",\n\t\t\t\tproperties: {\n\t\t\t\t\tq1: {\n\t\t\t\t\t\tenum: ["x1", "x2"],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n});\n\nmonaco.editor.create(document.getElementById("container"), {\n\tmodel: model,\n});\n'}}]);
|
|
//# sourceMappingURL=4260.js.map
|