mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 07:00:11 +01:00
Fixes samples
This commit is contained in:
parent
0e4a7a5d4d
commit
1394deb1c2
2 changed files with 5 additions and 5 deletions
|
|
@ -4,14 +4,14 @@
|
||||||
// to the system and how the compiler is told to use ES6 (target=2).
|
// to the system and how the compiler is told to use ES6 (target=2).
|
||||||
|
|
||||||
// validation settings
|
// validation settings
|
||||||
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
|
monaco.typescript.javascriptDefaults.setDiagnosticsOptions({
|
||||||
noSemanticValidation: true,
|
noSemanticValidation: true,
|
||||||
noSyntaxValidation: false,
|
noSyntaxValidation: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
// compiler options
|
// compiler options
|
||||||
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
|
monaco.typescript.javascriptDefaults.setCompilerOptions({
|
||||||
target: monaco.languages.typescript.ScriptTarget.ES2015,
|
target: monaco.typescript.ScriptTarget.ES2015,
|
||||||
allowNonTsExtensions: true,
|
allowNonTsExtensions: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ var libSource = [
|
||||||
"}",
|
"}",
|
||||||
].join("\n");
|
].join("\n");
|
||||||
var libUri = "ts:filename/facts.d.ts";
|
var libUri = "ts:filename/facts.d.ts";
|
||||||
monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, libUri);
|
monaco.typescript.javascriptDefaults.addExtraLib(libSource, libUri);
|
||||||
// When resolving definitions and references, the editor will try to use created models.
|
// When resolving definitions and references, the editor will try to use created models.
|
||||||
// Creating a model for the library allows "peek definition/references" commands to work with the library.
|
// Creating a model for the library allows "peek definition/references" commands to work with the library.
|
||||||
monaco.editor.createModel(libSource, "typescript", monaco.Uri.parse(libUri));
|
monaco.editor.createModel(libSource, "typescript", monaco.Uri.parse(libUri));
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ var modelUri = monaco.Uri.parse("a://b/foo.json"); // a made up unique URI for o
|
||||||
var model = monaco.editor.createModel(jsonCode, "json", modelUri);
|
var model = monaco.editor.createModel(jsonCode, "json", modelUri);
|
||||||
|
|
||||||
// configure the JSON language support with schemas and schema associations
|
// configure the JSON language support with schemas and schema associations
|
||||||
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
monaco.json.jsonDefaults.setDiagnosticsOptions({
|
||||||
validate: true,
|
validate: true,
|
||||||
schemas: [
|
schemas: [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue