monaco-editor/monaco-json/test/index.html

121 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link
rel="stylesheet"
data-name="vs/editor/editor.main"
href="../node_modules/monaco-editor-core/dev/vs/editor/editor.main.css"
/>
</head>
<body>
<h2>Monaco Editor JSON test page</h2>
<div id="container" style="width: 800px; height: 600px; border: 1px solid grey"></div>
<script>
// Loading basic-languages to get the json language definition
var paths = {
'vs/basic-languages': '../node_modules/monaco-languages/release/dev',
'vs/language/json': '../release/dev',
vs: '../node_modules/monaco-editor-core/dev/vs'
};
if (document.location.protocol === 'http:') {
// Add support for running local http server
let testIndex = document.location.pathname.indexOf('/test/');
if (testIndex !== -1) {
let prefix = document.location.pathname.substr(0, testIndex);
paths['vs/language/json'] = prefix + '/release/dev';
}
}
var require = {
paths: paths
};
</script>
<script src="../node_modules/monaco-editor-core/dev/vs/loader.js"></script>
<script src="../node_modules/monaco-editor-core/dev/vs/editor/editor.main.nls.js"></script>
<script src="../node_modules/monaco-editor-core/dev/vs/editor/editor.main.js"></script>
<script>
require([
'vs/basic-languages/monaco.contribution',
'vs/language/json/monaco.contribution'
], function () {
var editor = monaco.editor.create(document.getElementById('container'), {
value: [
'{',
' "type": "team",',
' "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'),
language: 'json'
});
});
</script>
</body>
</html>