mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 18:32:56 +01:00
Run gulp generate-test-samples
This commit is contained in:
parent
d387351c5f
commit
00b766829b
1 changed files with 11 additions and 3 deletions
|
|
@ -38,9 +38,13 @@ loadEditor(function() {
|
||||||
|
|
||||||
// Configures two JSON schemas, with references.
|
// Configures two JSON schemas, with references.
|
||||||
|
|
||||||
|
var id = "foo.json";
|
||||||
|
|
||||||
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
||||||
|
validate: true,
|
||||||
schemas: [{
|
schemas: [{
|
||||||
uri: "http://myserver/foo-schema.json",
|
uri: "http://myserver/foo-schema.json",
|
||||||
|
fileMatch: [id],
|
||||||
schema: {
|
schema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
|
|
@ -54,6 +58,7 @@ monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
uri: "http://myserver/bar-schema.json",
|
uri: "http://myserver/bar-schema.json",
|
||||||
|
fileMatch: [id],
|
||||||
schema: {
|
schema: {
|
||||||
type: "object",
|
type: "object",
|
||||||
properties: {
|
properties: {
|
||||||
|
|
@ -68,15 +73,18 @@ monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
||||||
|
|
||||||
var jsonCode = [
|
var jsonCode = [
|
||||||
'{',
|
'{',
|
||||||
' "$schema": "http://myserver/foo-schema.json"',
|
' "p1": "v3",',
|
||||||
|
' "p2": false',
|
||||||
"}"
|
"}"
|
||||||
].join('\n');
|
].join('\n');
|
||||||
|
|
||||||
|
var model = monaco.editor.createModel(jsonCode, "json", id);
|
||||||
|
|
||||||
monaco.editor.create(document.getElementById("container"), {
|
monaco.editor.create(document.getElementById("container"), {
|
||||||
value: jsonCode,
|
model: model
|
||||||
language: "json"
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------SAMPLE CSS END*/
|
/*----------------------------------------SAMPLE CSS END*/
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue