mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-06-09 09:31:25 +00:00
Merge pull request #2 from lujjjh/fix-test
Update development instruction and fix the test
This commit is contained in:
commit
63bca4922f
2 changed files with 25 additions and 71 deletions
|
|
@ -19,7 +19,7 @@ TODO: Document exact distribution method
|
||||||
|
|
||||||
* `git clone https://github.com/kpdecker/monaco-yaml`
|
* `git clone https://github.com/kpdecker/monaco-yaml`
|
||||||
* `cd monaco-yaml`
|
* `cd monaco-yaml`
|
||||||
* `npm install .`
|
* `yarn`
|
||||||
* `npm run watch`
|
* `npm run watch`
|
||||||
* open `$/monaco-yaml/test/index.html` in your favorite browser.
|
* open `$/monaco-yaml/test/index.html` in your favorite browser.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
var require = {
|
var require = {
|
||||||
paths: {
|
paths: {
|
||||||
'vs/basic-languages': '../node_modules/monaco-languages/release',
|
'vs/basic-languages': '../node_modules/monaco-languages/release',
|
||||||
'vs/language/yaml': '../release/dev',
|
'vs/languages/yaml': '../release/dev',
|
||||||
'vs': '../node_modules/monaco-editor-core/dev/vs'
|
'vs': '../node_modules/monaco-editor-core/dev/vs'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -27,78 +27,32 @@
|
||||||
<script>
|
<script>
|
||||||
require([
|
require([
|
||||||
'vs/basic-languages/src/monaco.contribution',
|
'vs/basic-languages/src/monaco.contribution',
|
||||||
'vs/language/yaml/monaco.contribution'
|
'vs/languages/yaml/monaco.contribution'
|
||||||
], function() {
|
], function() {
|
||||||
|
monaco.languages.yaml.yamlDefaults.setDiagnosticsOptions({
|
||||||
|
validate: true,
|
||||||
|
schemas: [{
|
||||||
|
fileMatch: ['*'],
|
||||||
|
schema: {
|
||||||
|
title: 'Person',
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
name: { type: 'string' },
|
||||||
|
age: {
|
||||||
|
description: 'Age in years',
|
||||||
|
type: 'integer',
|
||||||
|
minimum: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
required: ['name']
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
|
||||||
var editor = monaco.editor.create(document.getElementById('container'), {
|
var editor = monaco.editor.create(document.getElementById('container'), {
|
||||||
value: [
|
value: [
|
||||||
'{',
|
'name: Apple',
|
||||||
' "type": "team",',
|
'age: 18.0'
|
||||||
' "test": {',
|
|
||||||
' "testPage": "tools/testing/run-tests.htm",',
|
|
||||||
' "enabled": true',
|
|
||||||
' },',
|
|
||||||
' "search": {',
|
|
||||||
' "excludeFolders": [',
|
|
||||||
' ".git",',
|
|
||||||
' "node_modules",',
|
|
||||||
' "tools/bin",',
|
|
||||||
' "tools/counts",',
|
|
||||||
' "tools/policheck",',
|
|
||||||
' "tools/tfs_build_extensions",',
|
|
||||||
' "tools/testing/jscoverage",',
|
|
||||||
' "tools/testing/qunit",',
|
|
||||||
' "tools/testing/chutzpah",',
|
|
||||||
' "server.net"',
|
|
||||||
' ]',
|
|
||||||
' },',
|
|
||||||
' "languages": {',
|
|
||||||
' "vs.languages.typescript": {',
|
|
||||||
' "validationSettings": [{',
|
|
||||||
' "scope":"/",',
|
|
||||||
' "noImplicitAny":true,',
|
|
||||||
' "noLib":false,',
|
|
||||||
' "extraLibs":[],',
|
|
||||||
' "semanticValidation":true,',
|
|
||||||
' "syntaxValidation":true,',
|
|
||||||
' "codeGenTarget":"ES5",',
|
|
||||||
' "moduleGenTarget":"",',
|
|
||||||
' "lint": {',
|
|
||||||
' "emptyBlocksWithoutComment": "warning",',
|
|
||||||
' "curlyBracketsMustNotBeOmitted": "warning",',
|
|
||||||
' "comparisonOperatorsNotStrict": "warning",',
|
|
||||||
' "missingSemicolon": "warning",',
|
|
||||||
' "unknownTypeOfResults": "warning",',
|
|
||||||
' "semicolonsInsteadOfBlocks": "warning",',
|
|
||||||
' "functionsInsideLoops": "warning",',
|
|
||||||
' "functionsWithoutReturnType": "warning",',
|
|
||||||
' "tripleSlashReferenceAlike": "warning",',
|
|
||||||
' "unusedImports": "warning",',
|
|
||||||
' "unusedVariables": "warning",',
|
|
||||||
' "unusedFunctions": "warning",',
|
|
||||||
' "unusedMembers": "warning"',
|
|
||||||
' }',
|
|
||||||
' },',
|
|
||||||
' {',
|
|
||||||
' "scope":"/client",',
|
|
||||||
' "baseUrl":"/client",',
|
|
||||||
' "moduleGenTarget":"amd"',
|
|
||||||
' },',
|
|
||||||
' {',
|
|
||||||
' "scope":"/server",',
|
|
||||||
' "moduleGenTarget":"commonjs"',
|
|
||||||
' },',
|
|
||||||
' {',
|
|
||||||
' "scope":"/build",',
|
|
||||||
' "moduleGenTarget":"commonjs"',
|
|
||||||
' },',
|
|
||||||
' {',
|
|
||||||
' "scope":"/node_modules/nake",',
|
|
||||||
' "moduleGenTarget":"commonjs"',
|
|
||||||
' }],',
|
|
||||||
' "allowMultipleWorkers": true',
|
|
||||||
' }',
|
|
||||||
' }',
|
|
||||||
'}',
|
|
||||||
].join('\n'),
|
].join('\n'),
|
||||||
language: 'yaml'
|
language: 'yaml'
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue