Simplify paths in metadata.js

This commit is contained in:
Alex Dima 2021-11-08 16:32:06 +01:00
parent a155838b58
commit 1a21834a97
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
33 changed files with 1267 additions and 1198 deletions

View file

@ -1,9 +1,9 @@
const gulp = require('gulp'); const gulp = require('gulp');
/** /**
* @typedef { { src:string; 'npm/dev':string; 'npm/min':string; built:string; releaseDev:string; releaseMin:string; } ICorePaths } * @typedef { { src:string; 'npm/dev':string; 'npm/min':string; built:string; releaseDev:string; releaseMin:string; } } ICorePaths
* @typedef { { src:string; dev:string; min:string; esm: string; } IPluginPaths } * @typedef { { src:string; dev:string; min:string; esm: string; } } IPluginPaths
* @typedef { { name:string; contrib:string; modulePrefix:string; rootPath:string; paths:IPluginPaths } IPlugin } * @typedef { { name:string; contrib:string; modulePrefix:string; rootPath:string; paths:IPluginPaths } } IPlugin
* @typedef { { METADATA: {CORE:ICorePaths; PLUGINS:IPlugin[];} } IMetadata } * @typedef { { METADATA: {CORE:{paths:ICorePaths}; PLUGINS:IPlugin[];} } } IMetadata
* @type { IMetadata } * @type { IMetadata }
*/ */
const metadata = require('./monaco-editor/metadata'); const metadata = require('./monaco-editor/metadata');
@ -19,7 +19,7 @@ const uncss = require('uncss');
const File = require('vinyl'); const File = require('vinyl');
const ts = require('typescript'); const ts = require('typescript');
const WEBSITE_GENERATED_PATH = path.join(__dirname, 'website/playground/new-samples'); const WEBSITE_GENERATED_PATH = path.join(__dirname, 'monaco-editor/website/playground/new-samples');
const MONACO_EDITOR_VERSION = (function () { const MONACO_EDITOR_VERSION = (function () {
const packageJsonPath = path.join(__dirname, 'package.json'); const packageJsonPath = path.join(__dirname, 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString()); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString());
@ -156,7 +156,7 @@ function pluginStreams(type, destinationPath) {
* @returns {NodeJS.ReadWriteStream} * @returns {NodeJS.ReadWriteStream}
*/ */
function pluginStream(plugin, type, destinationPath) { function pluginStream(plugin, type, destinationPath) {
const pluginPath = plugin.paths[type]; // dev or min const pluginPath = path.join(plugin.rootPath, plugin.paths[type]); // dev or min
const contribPath = const contribPath =
path.join(pluginPath, plugin.contrib.substr(plugin.modulePrefix.length)) + '.js'; path.join(pluginPath, plugin.contrib.substr(plugin.modulePrefix.length)) + '.js';
return gulp return gulp
@ -216,7 +216,7 @@ function addPluginContribs(type) {
metadata.METADATA.PLUGINS.forEach(function (plugin) { metadata.METADATA.PLUGINS.forEach(function (plugin) {
allPluginsModuleIds.push(plugin.contrib); allPluginsModuleIds.push(plugin.contrib);
const pluginPath = plugin.paths[type]; // dev or min const pluginPath = path.join(plugin.rootPath, plugin.paths[type]); // dev or min
const contribPath = const contribPath =
path.join(__dirname, pluginPath, plugin.contrib.substr(plugin.modulePrefix.length)) + path.join(__dirname, pluginPath, plugin.contrib.substr(plugin.modulePrefix.length)) +
'.js'; '.js';
@ -294,7 +294,7 @@ function ESM_pluginStreams(destinationPath) {
*/ */
function ESM_pluginStream(plugin, destinationPath) { function ESM_pluginStream(plugin, destinationPath) {
const DESTINATION = path.join(__dirname, destinationPath); const DESTINATION = path.join(__dirname, destinationPath);
const pluginPath = plugin.paths[`esm`]; const pluginPath = path.join(plugin.rootPath, plugin.paths['esm']);
return gulp return gulp
.src([pluginPath + '/**/*']) .src([pluginPath + '/**/*'])
.pipe( .pipe(
@ -830,9 +830,9 @@ gulp.task('prepare-website-branch', async function () {
}); });
const generateTestSamplesTask = function () { const generateTestSamplesTask = function () {
var sampleNames = fs.readdirSync(path.join(__dirname, 'test/samples')); var sampleNames = fs.readdirSync(path.join(__dirname, 'monaco-editor/test/samples'));
var samples = sampleNames.map(function (sampleName) { var samples = sampleNames.map(function (sampleName) {
var samplePath = path.join(__dirname, 'test/samples', sampleName); var samplePath = path.join(__dirname, 'monaco-editor/test/samples', sampleName);
var sampleContent = fs.readFileSync(samplePath).toString(); var sampleContent = fs.readFileSync(samplePath).toString();
return { return {
name: sampleName, name: sampleName,
@ -843,7 +843,7 @@ const generateTestSamplesTask = function () {
'//This is a generated file via gulp generate-test-samples\ndefine([], function() { return'; '//This is a generated file via gulp generate-test-samples\ndefine([], function() { return';
var suffix = '; });'; var suffix = '; });';
fs.writeFileSync( fs.writeFileSync(
path.join(__dirname, 'test/samples-all.generated.js'), path.join(__dirname, 'monaco-editor/test/samples-all.generated.js'),
prefix + JSON.stringify(samples, null, '\t') + suffix prefix + JSON.stringify(samples, null, '\t') + suffix
); );
@ -904,7 +904,7 @@ const generateTestSamplesTask = function () {
'</html>' '</html>'
]; ];
fs.writeFileSync( fs.writeFileSync(
path.join(__dirname, 'test/playground.generated/' + sampleId + '.html'), path.join(__dirname, 'monaco-editor/test/playground.generated/' + sampleId + '.html'),
result.join('\n') result.join('\n')
); );
locations.push({ locations.push({
@ -939,7 +939,7 @@ const generateTestSamplesTask = function () {
'</body>', '</body>',
'</html>' '</html>'
]; ];
fs.writeFileSync(path.join(__dirname, 'test/playground.generated/index.html'), index.join('\n')); fs.writeFileSync(path.join(__dirname, 'monaco-editor/test/playground.generated/index.html'), index.join('\n'));
}; };
function createSimpleServer(rootDir, port) { function createSimpleServer(rootDir, port) {
@ -962,7 +962,7 @@ gulp.task('generate-test-samples', taskSeries(generateTestSamplesTask));
gulp.task( gulp.task(
'simpleserver', 'simpleserver',
taskSeries(generateTestSamplesTask, function () { taskSeries(generateTestSamplesTask, function () {
const SERVER_ROOT = path.normalize(path.join(__dirname, '../../')); const SERVER_ROOT = path.normalize(path.join(__dirname, '../'));
createSimpleServer(SERVER_ROOT, 8080); createSimpleServer(SERVER_ROOT, 8080);
createSimpleServer(SERVER_ROOT, 8088); createSimpleServer(SERVER_ROOT, 8088);
}) })

View file

@ -17,13 +17,10 @@
modulePrefix: 'vs/language/typescript', modulePrefix: 'vs/language/typescript',
rootPath: './monaco-typescript', rootPath: './monaco-typescript',
paths: { paths: {
// use ./ to indicate it is relative to the repository root // use ./ to indicate it is relative to the `rootPath`
src: './monaco-typescript/release/dev', dev: './release/dev',
dev: './monaco-typescript/release/dev', min: './release/min',
min: './monaco-typescript/release/min', esm: './release/esm'
'npm/dev': 'node_modules/monaco-typescript/release/dev',
'npm/min': 'node_modules/monaco-typescript/release/min',
esm: './monaco-typescript/release/esm'
} }
}, },
{ {
@ -32,13 +29,10 @@
modulePrefix: 'vs/language/css', modulePrefix: 'vs/language/css',
rootPath: './monaco-css', rootPath: './monaco-css',
paths: { paths: {
// use ./ to indicate it is relative to the repository root // use ./ to indicate it is relative to the `rootPath`
src: './monaco-css/release/dev', dev: './release/dev',
dev: './monaco-css/release/dev', min: './release/min',
min: './monaco-css/release/min', esm: './release/esm'
'npm/dev': 'node_modules/monaco-css/release/dev',
'npm/min': 'node_modules/monaco-css/release/min',
esm: './monaco-css/release/esm'
} }
}, },
{ {
@ -47,13 +41,10 @@
modulePrefix: 'vs/language/json', modulePrefix: 'vs/language/json',
rootPath: './monaco-json', rootPath: './monaco-json',
paths: { paths: {
// use ./ to indicate it is relative to the repository root // use ./ to indicate it is relative to the `rootPath`
src: './monaco-json/release/dev', dev: './release/dev',
dev: './monaco-json/release/dev', min: './release/min',
min: './monaco-json/release/min', esm: './release/esm'
'npm/dev': 'node_modules/monaco-json/release/dev',
'npm/min': 'node_modules/monaco-json/release/min',
esm: './monaco-json/release/esm'
} }
}, },
{ {
@ -62,13 +53,10 @@
modulePrefix: 'vs/language/html', modulePrefix: 'vs/language/html',
rootPath: './monaco-html', rootPath: './monaco-html',
paths: { paths: {
// use ./ to indicate it is relative to the repository root // use ./ to indicate it is relative to the `rootPath`
src: './monaco-html/release/dev', dev: './release/dev',
dev: './monaco-html/release/dev', min: './release/min',
min: './monaco-html/release/min', esm: './release/esm'
'npm/dev': 'node_modules/monaco-html/release/dev',
'npm/min': 'node_modules/monaco-html/release/min',
esm: './monaco-html/release/esm'
} }
}, },
{ {
@ -77,13 +65,10 @@
modulePrefix: 'vs/basic-languages', modulePrefix: 'vs/basic-languages',
rootPath: './monaco-languages', rootPath: './monaco-languages',
paths: { paths: {
// use ./ to indicate it is relative to the repository root // use ./ to indicate it is relative to the `rootPath`
src: './monaco-languages/release/dev', dev: './release/dev',
dev: './monaco-languages/release/dev', min: './release/min',
min: './monaco-languages/release/min', esm: './release/esm'
'npm/dev': 'node_modules/monaco-languages/release/dev',
'npm/min': 'node_modules/monaco-languages/release/min',
esm: './monaco-languages/release/esm'
} }
} }
] ]

View file

@ -35,7 +35,7 @@
let result = {}; let result = {};
result['editor'] = overwrites['editor'] || 'npm/dev'; result['editor'] = overwrites['editor'] || 'npm/dev';
METADATA.PLUGINS.map(function (plugin) { METADATA.PLUGINS.map(function (plugin) {
result[plugin.name] = overwrites[plugin.name] || 'npm/dev'; result[plugin.name] = overwrites[plugin.name] || 'dev';
}); });
return result; return result;
})(); })();
@ -55,10 +55,11 @@
); );
} }
function Component(name, modulePrefix, paths, contrib) { function Component(name, modulePrefix, paths, rootPath, contrib) {
this.name = name; this.name = name;
this.modulePrefix = modulePrefix; this.modulePrefix = modulePrefix;
this.paths = paths; this.paths = paths;
this.rootPath = rootPath;
this.contrib = contrib; this.contrib = contrib;
this.selectedPath = LOADER_OPTS[name]; this.selectedPath = LOADER_OPTS[name];
} }
@ -68,11 +69,11 @@
Component.prototype.getResolvedPath = function (PATH_PREFIX) { Component.prototype.getResolvedPath = function (PATH_PREFIX) {
let resolvedPath = this.paths[this.selectedPath]; let resolvedPath = this.paths[this.selectedPath];
if (/\.\//.test(resolvedPath)) { if (/\.\//.test(resolvedPath)) {
// starts with ./ => treat as relative to repo root // starts with ./ => treat as relative to the root path
if (IS_FILE_PROTOCOL) { if (IS_FILE_PROTOCOL) {
resolvedPath = DIRNAME + '/../' + resolvedPath; resolvedPath = DIRNAME + '/../' + this.rootPath + '/' + resolvedPath;
} else { } else {
resolvedPath = PATH_PREFIX + '/monaco-editor/' + resolvedPath; resolvedPath = PATH_PREFIX + '/monaco-editor/' + this.rootPath + '/' + resolvedPath;
} }
} else if ( } else if (
this.selectedPath === 'npm/dev' || this.selectedPath === 'npm/dev' ||
@ -141,7 +142,7 @@
let RESOLVED_CORE = new Component('editor', 'vs', METADATA.CORE.paths); let RESOLVED_CORE = new Component('editor', 'vs', METADATA.CORE.paths);
self.RESOLVED_CORE_PATH = RESOLVED_CORE.getResolvedPath(''); self.RESOLVED_CORE_PATH = RESOLVED_CORE.getResolvedPath('');
let RESOLVED_PLUGINS = METADATA.PLUGINS.map(function (plugin) { let RESOLVED_PLUGINS = METADATA.PLUGINS.map(function (plugin) {
return new Component(plugin.name, plugin.modulePrefix, plugin.paths, plugin.contrib); return new Component(plugin.name, plugin.modulePrefix, plugin.paths, plugin.rootPath, plugin.contrib);
}); });
METADATA = null; METADATA = null;

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -35,10 +35,10 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
loadEditor(function() { loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
var originalModel = monaco.editor.createModel("heLLo world!", "text/plain"); var originalModel = monaco.editor.createModel('heLLo world!', 'text/plain');
var modifiedModel = monaco.editor.createModel("hello orlando!", "text/plain"); var modifiedModel = monaco.editor.createModel('hello orlando!', 'text/plain');
var diffEditor = monaco.editor.createDiffEditor(document.getElementById("container")); var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'));
diffEditor.setModel({ diffEditor.setModel({
original: originalModel, original: originalModel,
modified: modifiedModel modified: modifiedModel

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -35,10 +35,16 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
loadEditor(function() { loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
var originalModel = monaco.editor.createModel("This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text", "text/plain"); var originalModel = monaco.editor.createModel(
var modifiedModel = monaco.editor.createModel("just some text\nabcz\nzzzzefgh\nSome more text\nThis line is removed on the left.", "text/plain"); 'This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text',
'text/plain'
);
var modifiedModel = monaco.editor.createModel(
'just some text\nabcz\nzzzzefgh\nSome more text\nThis line is removed on the left.',
'text/plain'
);
var diffEditor = monaco.editor.createDiffEditor(document.getElementById("container"), { var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'), {
// You can optionally disable the resizing // You can optionally disable the resizing
enableSplitViewResizing: false, enableSplitViewResizing: false,

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -35,10 +35,16 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
loadEditor(function() { loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
var originalModel = monaco.editor.createModel("This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text", "text/plain"); var originalModel = monaco.editor.createModel(
var modifiedModel = monaco.editor.createModel("just some text\nabcz\nzzzzefgh\nSome more text.\nThis line is removed on the left.", "text/plain"); 'This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text',
'text/plain'
);
var modifiedModel = monaco.editor.createModel(
'just some text\nabcz\nzzzzefgh\nSome more text.\nThis line is removed on the left.',
'text/plain'
);
var diffEditor = monaco.editor.createDiffEditor(document.getElementById("container"), { var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'), {
// You can optionally disable the resizing // You can optionally disable the resizing
enableSplitViewResizing: false enableSplitViewResizing: false
}); });

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -36,11 +36,16 @@ loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
// The diff editor offers a navigator to jump between changes. Once the diff is computed the <em>next()</em> and <em>previous()</em> method allow navigation. By default setting the selection in the editor manually resets the navigation state. // The diff editor offers a navigator to jump between changes. Once the diff is computed the <em>next()</em> and <em>previous()</em> method allow navigation. By default setting the selection in the editor manually resets the navigation state.
var originalModel = monaco.editor.createModel("just some text\n\nHello World\n\nSome more text", "text/plain"); var originalModel = monaco.editor.createModel(
var modifiedModel = monaco.editor.createModel("just some Text\n\nHello World\n\nSome more changes", "text/plain"); 'just some text\n\nHello World\n\nSome more text',
'text/plain'
);
var modifiedModel = monaco.editor.createModel(
'just some Text\n\nHello World\n\nSome more changes',
'text/plain'
);
var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'));
var diffEditor = monaco.editor.createDiffEditor(document.getElementById("container"));
diffEditor.setModel({ diffEditor.setModel({
original: originalModel, original: originalModel,
modified: modifiedModel modified: modifiedModel

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -39,19 +39,19 @@ loadEditor(function() {
// Here are a few examples of config options that can be passed to the editor. // Here are a few examples of config options that can be passed to the editor.
// You can also call editor.updateOptions at any time to change the options. // You can also call editor.updateOptions at any time to change the options.
var editor = monaco.editor.create(document.getElementById("container"), { var editor = monaco.editor.create(document.getElementById('container'), {
value: "// First line\nfunction hello() {\n\talert('Hello world!');\n}\n// Last line", value: "// First line\nfunction hello() {\n\talert('Hello world!');\n}\n// Last line",
language: "javascript", language: 'javascript',
lineNumbers: "off", lineNumbers: 'off',
roundedSelection: false, roundedSelection: false,
scrollBeyondLastLine: false, scrollBeyondLastLine: false,
readOnly: false, readOnly: false,
theme: "vs-dark", theme: 'vs-dark'
}); });
setTimeout(function () { setTimeout(function () {
editor.updateOptions({ editor.updateOptions({
lineNumbers: "on" lineNumbers: 'on'
}); });
}, 2000); }, 2000);

File diff suppressed because one or more lines are too long

View file

@ -11,7 +11,6 @@
/*----------------------------------------SAMPLE CSS END*/ /*----------------------------------------SAMPLE CSS END*/
</style> </style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/> <a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
@ -23,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -41,9 +40,9 @@ loadEditor(function() {
// Two members of the literal are "value" and "language". // Two members of the literal are "value" and "language".
// The editor takes the full size of its container. // The editor takes the full size of its container.
monaco.editor.create(document.getElementById("container"), { monaco.editor.create(document.getElementById('container'), {
value: "function hello() {\n\talert('Hello world!');\n}", value: "function hello() {\n\talert('Hello world!');\n}",
language: "javascript" language: 'javascript'
}); });

View file

@ -11,7 +11,6 @@
/*----------------------------------------SAMPLE CSS END*/ /*----------------------------------------SAMPLE CSS END*/
</style> </style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/> <a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
@ -23,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<pre id="code" data-lang="text/css" style="width:500px;"> <pre id="code" data-lang="text/css" style="width: 500px">
/* Some example CSS */ /* Some example CSS */
@import url("something.css"); @import url("something.css");

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -53,130 +53,130 @@ monaco.editor.defineTheme('myTheme', {
}); });
monaco.editor.setTheme('myTheme'); monaco.editor.setTheme('myTheme');
monaco.editor.create(document.getElementById("container"), { monaco.editor.create(document.getElementById('container'), {
value: "My to-do list:\n* buy milk\n* buy coffee\n* write awesome code", value: 'My to-do list:\n* buy milk\n* buy coffee\n* write awesome code',
language: "text/plain", language: 'text/plain',
fontFamily: "Arial", fontFamily: 'Arial',
fontSize: 20 fontSize: 20
}); });
// A list of color names: // A list of color names:
'foreground' // Overall foreground color. This color is only used if not overridden by a component. ('foreground'); // Overall foreground color. This color is only used if not overridden by a component.
'errorForeground' // Overall foreground color for error messages. This color is only used if not overridden by a component. ('errorForeground'); // Overall foreground color for error messages. This color is only used if not overridden by a component.
'descriptionForeground' // Foreground color for description text providing additional information, for example for a label. ('descriptionForeground'); // Foreground color for description text providing additional information, for example for a label.
'focusBorder' // Overall border color for focused elements. This color is only used if not overridden by a component. ('focusBorder'); // Overall border color for focused elements. This color is only used if not overridden by a component.
'contrastBorder' // An extra border around elements to separate them from others for greater contrast. ('contrastBorder'); // An extra border around elements to separate them from others for greater contrast.
'contrastActiveBorder' // An extra border around active elements to separate them from others for greater contrast. ('contrastActiveBorder'); // An extra border around active elements to separate them from others for greater contrast.
'selection.background' // The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor. ('selection.background'); // The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.
'textSeparator.foreground' // Color for text separators. ('textSeparator.foreground'); // Color for text separators.
'textLink.foreground' // Foreground color for links in text. ('textLink.foreground'); // Foreground color for links in text.
'textLink.activeForeground' // Foreground color for active links in text. ('textLink.activeForeground'); // Foreground color for active links in text.
'textPreformat.foreground' // Foreground color for preformatted text segments. ('textPreformat.foreground'); // Foreground color for preformatted text segments.
'textBlockQuote.background' // Background color for block quotes in text. ('textBlockQuote.background'); // Background color for block quotes in text.
'textBlockQuote.border' // Border color for block quotes in text. ('textBlockQuote.border'); // Border color for block quotes in text.
'textCodeBlock.background' // Background color for code blocks in text. ('textCodeBlock.background'); // Background color for code blocks in text.
'widget.shadow' // Shadow color of widgets such as find/replace inside the editor. ('widget.shadow'); // Shadow color of widgets such as find/replace inside the editor.
'input.background' // Input box background. ('input.background'); // Input box background.
'input.foreground' // Input box foreground. ('input.foreground'); // Input box foreground.
'input.border' // Input box border. ('input.border'); // Input box border.
'inputOption.activeBorder' // Border color of activated options in input fields. ('inputOption.activeBorder'); // Border color of activated options in input fields.
'input.placeholderForeground' // Input box foreground color for placeholder text. ('input.placeholderForeground'); // Input box foreground color for placeholder text.
'inputValidation.infoBackground' // Input validation background color for information severity. ('inputValidation.infoBackground'); // Input validation background color for information severity.
'inputValidation.infoBorder' // Input validation border color for information severity. ('inputValidation.infoBorder'); // Input validation border color for information severity.
'inputValidation.warningBackground' // Input validation background color for information warning. ('inputValidation.warningBackground'); // Input validation background color for information warning.
'inputValidation.warningBorder' // Input validation border color for warning severity. ('inputValidation.warningBorder'); // Input validation border color for warning severity.
'inputValidation.errorBackground' // Input validation background color for error severity. ('inputValidation.errorBackground'); // Input validation background color for error severity.
'inputValidation.errorBorder' // Input validation border color for error severity. ('inputValidation.errorBorder'); // Input validation border color for error severity.
'dropdown.background' // Dropdown background. ('dropdown.background'); // Dropdown background.
'dropdown.foreground' // Dropdown foreground. ('dropdown.foreground'); // Dropdown foreground.
'dropdown.border' // Dropdown border. ('dropdown.border'); // Dropdown border.
'list.focusBackground' // List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not. ('list.focusBackground'); // List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.
'list.focusForeground' // List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not. ('list.focusForeground'); // List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.
'list.activeSelectionBackground' // List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not. ('list.activeSelectionBackground'); // List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.
'list.activeSelectionForeground' // List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not. ('list.activeSelectionForeground'); // List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.
'list.inactiveSelectionBackground' // List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not. ('list.inactiveSelectionBackground'); // List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.
'list.inactiveSelectionForeground' // List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not. ('list.inactiveSelectionForeground'); // List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.
'list.hoverBackground' // List/Tree background when hovering over items using the mouse. ('list.hoverBackground'); // List/Tree background when hovering over items using the mouse.
'list.hoverForeground' // List/Tree foreground when hovering over items using the mouse. ('list.hoverForeground'); // List/Tree foreground when hovering over items using the mouse.
'list.dropBackground' // List/Tree drag and drop background when moving items around using the mouse. ('list.dropBackground'); // List/Tree drag and drop background when moving items around using the mouse.
'list.highlightForeground' // List/Tree foreground color of the match highlights when searching inside the list/tree. ('list.highlightForeground'); // List/Tree foreground color of the match highlights when searching inside the list/tree.
'pickerGroup.foreground' // Quick picker color for grouping labels. ('pickerGroup.foreground'); // Quick picker color for grouping labels.
'pickerGroup.border' // Quick picker color for grouping borders. ('pickerGroup.border'); // Quick picker color for grouping borders.
'button.foreground' // Button foreground color. ('button.foreground'); // Button foreground color.
'button.background' // Button background color. ('button.background'); // Button background color.
'button.hoverBackground' // Button background color when hovering. ('button.hoverBackground'); // Button background color when hovering.
'badge.background' // Badge background color. Badges are small information labels, e.g. for search results count. ('badge.background'); // Badge background color. Badges are small information labels, e.g. for search results count.
'badge.foreground' // Badge foreground color. Badges are small information labels, e.g. for search results count. ('badge.foreground'); // Badge foreground color. Badges are small information labels, e.g. for search results count.
'scrollbar.shadow' // Scrollbar shadow to indicate that the view is scrolled. ('scrollbar.shadow'); // Scrollbar shadow to indicate that the view is scrolled.
'scrollbarSlider.background' // Slider background color. ('scrollbarSlider.background'); // Slider background color.
'scrollbarSlider.hoverBackground' // Slider background color when hovering. ('scrollbarSlider.hoverBackground'); // Slider background color when hovering.
'scrollbarSlider.activeBackground' // Slider background color when active. ('scrollbarSlider.activeBackground'); // Slider background color when active.
'progressBar.background' // Background color of the progress bar that can show for long running operations. ('progressBar.background'); // Background color of the progress bar that can show for long running operations.
'editor.background' // Editor background color. ('editor.background'); // Editor background color.
'editor.foreground' // Editor default foreground color. ('editor.foreground'); // Editor default foreground color.
'editorWidget.background' // Background color of editor widgets, such as find/replace. ('editorWidget.background'); // Background color of editor widgets, such as find/replace.
'editorWidget.border' // Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget. ('editorWidget.border'); // Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.
'editor.selectionBackground' // Color of the editor selection. ('editor.selectionBackground'); // Color of the editor selection.
'editor.selectionForeground' // Color of the selected text for high contrast. ('editor.selectionForeground'); // Color of the selected text for high contrast.
'editor.inactiveSelectionBackground' // Color of the selection in an inactive editor. ('editor.inactiveSelectionBackground'); // Color of the selection in an inactive editor.
'editor.selectionHighlightBackground' // Color for regions with the same content as the selection. ('editor.selectionHighlightBackground'); // Color for regions with the same content as the selection.
'editor.findMatchBackground' // Color of the current search match. ('editor.findMatchBackground'); // Color of the current search match.
'editor.findMatchHighlightBackground' // Color of the other search matches. ('editor.findMatchHighlightBackground'); // Color of the other search matches.
'editor.findRangeHighlightBackground' // Color the range limiting the search. ('editor.findRangeHighlightBackground'); // Color the range limiting the search.
'editor.hoverHighlightBackground' // Highlight below the word for which a hover is shown. ('editor.hoverHighlightBackground'); // Highlight below the word for which a hover is shown.
'editorHoverWidget.background' // Background color of the editor hover. ('editorHoverWidget.background'); // Background color of the editor hover.
'editorHoverWidget.border' // Border color of the editor hover. ('editorHoverWidget.border'); // Border color of the editor hover.
'editorLink.activeForeground' // Color of active links. ('editorLink.activeForeground'); // Color of active links.
'diffEditor.insertedTextBackground' // Background color for text that got inserted. ('diffEditor.insertedTextBackground'); // Background color for text that got inserted.
'diffEditor.removedTextBackground' // Background color for text that got removed. ('diffEditor.removedTextBackground'); // Background color for text that got removed.
'diffEditor.insertedTextBorder' // Outline color for the text that got inserted. ('diffEditor.insertedTextBorder'); // Outline color for the text that got inserted.
'diffEditor.removedTextBorder' // Outline color for text that got removed. ('diffEditor.removedTextBorder'); // Outline color for text that got removed.
'editorOverviewRuler.currentContentForeground' // Current overview ruler foreground for inline merge-conflicts. ('editorOverviewRuler.currentContentForeground'); // Current overview ruler foreground for inline merge-conflicts.
'editorOverviewRuler.incomingContentForeground' // Incoming overview ruler foreground for inline merge-conflicts. ('editorOverviewRuler.incomingContentForeground'); // Incoming overview ruler foreground for inline merge-conflicts.
'editorOverviewRuler.commonContentForeground' // Common ancestor overview ruler foreground for inline merge-conflicts. ('editorOverviewRuler.commonContentForeground'); // Common ancestor overview ruler foreground for inline merge-conflicts.
'editor.lineHighlightBackground' // Background color for the highlight of line at the cursor position. ('editor.lineHighlightBackground'); // Background color for the highlight of line at the cursor position.
'editor.lineHighlightBorder' // Background color for the border around the line at the cursor position. ('editor.lineHighlightBorder'); // Background color for the border around the line at the cursor position.
'editor.rangeHighlightBackground' // Background color of highlighted ranges, like by quick open and find features. ('editor.rangeHighlightBackground'); // Background color of highlighted ranges, like by quick open and find features.
'editorCursor.foreground' // Color of the editor cursor. ('editorCursor.foreground'); // Color of the editor cursor.
'editorWhitespace.foreground' // Color of whitespace characters in the editor. ('editorWhitespace.foreground'); // Color of whitespace characters in the editor.
'editorIndentGuide.background' // Color of the editor indentation guides. ('editorIndentGuide.background'); // Color of the editor indentation guides.
'editorLineNumber.foreground' // Color of editor line numbers. ('editorLineNumber.foreground'); // Color of editor line numbers.
'editorLineNumber.activeForeground' // Color of editor active line number. ('editorLineNumber.activeForeground'); // Color of editor active line number.
'editorRuler.foreground' // Color of the editor rulers. ('editorRuler.foreground'); // Color of the editor rulers.
'editorCodeLens.foreground' // Foreground color of editor code lenses ('editorCodeLens.foreground'); // Foreground color of editor code lenses
'editorInlayHint.foreground' // Foreground color of editor inlay hints ('editorInlayHint.foreground'); // Foreground color of editor inlay hints
'editorInlayHint.background' // Background color of editor inlay hints ('editorInlayHint.background'); // Background color of editor inlay hints
'editorBracketMatch.background' // Background color behind matching brackets ('editorBracketMatch.background'); // Background color behind matching brackets
'editorBracketMatch.border' // Color for matching brackets boxes ('editorBracketMatch.border'); // Color for matching brackets boxes
'editorOverviewRuler.border' // Color of the overview ruler border. ('editorOverviewRuler.border'); // Color of the overview ruler border.
'editorGutter.background' // Background color of the editor gutter. The gutter contains the glyph margins and the line numbers. ('editorGutter.background'); // Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.
'editorError.foreground' // Foreground color of error squigglies in the editor. ('editorError.foreground'); // Foreground color of error squigglies in the editor.
'editorError.border' // Border color of error squigglies in the editor. ('editorError.border'); // Border color of error squigglies in the editor.
'editorWarning.foreground' // Foreground color of warning squigglies in the editor. ('editorWarning.foreground'); // Foreground color of warning squigglies in the editor.
'editorWarning.border' // Border color of warning squigglies in the editor. ('editorWarning.border'); // Border color of warning squigglies in the editor.
'editorMarkerNavigationError.background' // Editor marker navigation widget error color. ('editorMarkerNavigationError.background'); // Editor marker navigation widget error color.
'editorMarkerNavigationWarning.background' // Editor marker navigation widget warning color. ('editorMarkerNavigationWarning.background'); // Editor marker navigation widget warning color.
'editorMarkerNavigation.background' // Editor marker navigation widget background. ('editorMarkerNavigation.background'); // Editor marker navigation widget background.
'editorSuggestWidget.background' // Background color of the suggest widget. ('editorSuggestWidget.background'); // Background color of the suggest widget.
'editorSuggestWidget.border' // Border color of the suggest widget. ('editorSuggestWidget.border'); // Border color of the suggest widget.
'editorSuggestWidget.foreground' // Foreground color of the suggest widget. ('editorSuggestWidget.foreground'); // Foreground color of the suggest widget.
'editorSuggestWidget.selectedBackground' // Background color of the selected entry in the suggest widget. ('editorSuggestWidget.selectedBackground'); // Background color of the selected entry in the suggest widget.
'editorSuggestWidget.highlightForeground' // Color of the match highlights in the suggest widget. ('editorSuggestWidget.highlightForeground'); // Color of the match highlights in the suggest widget.
'editor.wordHighlightBackground' // Background color of a symbol during read-access, like reading a variable. ('editor.wordHighlightBackground'); // Background color of a symbol during read-access, like reading a variable.
'editor.wordHighlightStrongBackground' // Background color of a symbol during write-access, like writing to a variable. ('editor.wordHighlightStrongBackground'); // Background color of a symbol during write-access, like writing to a variable.
'peekViewTitle.background' // Background color of the peek view title area. ('peekViewTitle.background'); // Background color of the peek view title area.
'peekViewTitleLabel.foreground' // Color of the peek view title. ('peekViewTitleLabel.foreground'); // Color of the peek view title.
'peekViewTitleDescription.foreground' // Color of the peek view title info. ('peekViewTitleDescription.foreground'); // Color of the peek view title info.
'peekView.border' // Color of the peek view borders and arrow. ('peekView.border'); // Color of the peek view borders and arrow.
'peekViewResult.background' // Background color of the peek view result list. ('peekViewResult.background'); // Background color of the peek view result list.
'peekViewResult.lineForeground' // Foreground color for line nodes in the peek view result list. ('peekViewResult.lineForeground'); // Foreground color for line nodes in the peek view result list.
'peekViewResult.fileForeground' // Foreground color for file nodes in the peek view result list. ('peekViewResult.fileForeground'); // Foreground color for file nodes in the peek view result list.
'peekViewResult.selectionBackground' // Background color of the selected entry in the peek view result list. ('peekViewResult.selectionBackground'); // Background color of the selected entry in the peek view result list.
'peekViewResult.selectionForeground' // Foreground color of the selected entry in the peek view result list. ('peekViewResult.selectionForeground'); // Foreground color of the selected entry in the peek view result list.
'peekViewEditor.background' // Background color of the peek view editor. ('peekViewEditor.background'); // Background color of the peek view editor.
'peekViewEditorGutter.background' // Background color of the gutter in the peek view editor. ('peekViewEditorGutter.background'); // Background color of the gutter in the peek view editor.
'peekViewResult.matchHighlightBackground' // Match highlight color in the peek view result list. ('peekViewResult.matchHighlightBackground'); // Match highlight color in the peek view result list.
'peekViewEditor.matchHighlightBackground' // Match highlight color in the peek view editor. ('peekViewEditor.matchHighlightBackground'); // Match highlight color in the peek view editor.
/* /*
var colors = require('vs/platform/registry/common/platform').Registry.data.get('base.contributions.colors').colorSchema.properties var colors = require('vs/platform/registry/common/platform').Registry.data.get('base.contributions.colors').colorSchema.properties

View file

@ -32,7 +32,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -46,12 +46,14 @@ loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
// Remember to check out the CSS too! // Remember to check out the CSS too!
var htmlCode = "<html><!--long linelong linelong linelong linelong linelong linelong linelong linelong linelong line-->\n<head>\n <!-- HTML comment -->\n <style type=\"text/css\">\n /* CSS comment */\n </style>\n <script type=\"javascript\">\n // JavaScript comment\n </"+"script>\n</head>\n<body></body>\n</html>"; var htmlCode =
'<html><!--long linelong linelong linelong linelong linelong linelong linelong linelong linelong line-->\n<head>\n <!-- HTML comment -->\n <style type="text/css">\n /* CSS comment */\n </style>\n <script type="javascript">\n // JavaScript comment\n </' +
'script>\n</head>\n<body></body>\n</html>';
monaco.editor.create(document.getElementById("container"), { monaco.editor.create(document.getElementById('container'), {
value: htmlCode, value: htmlCode,
language: "text/html", language: 'text/html',
theme: "vs", theme: 'vs',
scrollbar: { scrollbar: {
// Subtle shadows to the left & top. Defaults to true. // Subtle shadows to the left & top. Defaults to true.
useShadows: false, useShadows: false,

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -35,7 +35,6 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
loadEditor(function() { loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
// Theme matching (i.e. applying a style to a token) happens in JavaScript. // Theme matching (i.e. applying a style to a token) happens in JavaScript.
// We must therefore register the theme rules in JavaScript. // We must therefore register the theme rules in JavaScript.
@ -57,14 +56,17 @@ monaco.editor.defineTheme('myCustomTheme', {
] ]
}); });
monaco.editor.create(document.getElementById("container"), { monaco.editor.create(document.getElementById('container'), {
value: getCode(), value: getCode(),
language: "text/html", language: 'text/html',
theme: "myCustomTheme" theme: 'myCustomTheme'
}); });
function getCode() { function getCode() {
return "<html><!-- // !!! Tokens can be inspected using F1 > Developer: Inspect Tokens !!! -->\n<head>\n <!-- HTML comment -->\n <style type=\"text/css\">\n /* CSS comment */\n </style>\n <script type=\"javascript\">\n // JavaScript comment\n </"+"script>\n</head>\n<body></body>\n</html>"; return (
'<html><!-- // !!! Tokens can be inspected using F1 > Developer: Inspect Tokens !!! -->\n<head>\n <!-- HTML comment -->\n <style type="text/css">\n /* CSS comment */\n </style>\n <script type="javascript">\n // JavaScript comment\n </' +
'script>\n</head>\n<body></body>\n</html>'
);
} }

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -35,16 +35,19 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
loadEditor(function() { loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
var editor = monaco.editor.create(document.getElementById("container"), { var editor = monaco.editor.create(document.getElementById('container'), {
value: "{\n\t\"dependencies\": {\n\t\t\n\t}\n}\n", value: '{\n\t"dependencies": {\n\t\t\n\t}\n}\n',
language: "json" language: 'json'
}); });
var commandId = editor.addCommand(0, function () { var commandId = editor.addCommand(
0,
function () {
// services available in `ctx` // services available in `ctx`
alert('my command is executing!'); alert('my command is executing!');
},
}, ''); ''
);
monaco.languages.registerCodeLensProvider('json', { monaco.languages.registerCodeLensProvider('json', {
provideCodeLenses: function (model, token) { provideCodeLenses: function (model, token) {
@ -57,10 +60,10 @@ monaco.languages.registerCodeLensProvider('json', {
endLineNumber: 2, endLineNumber: 2,
endColumn: 1 endColumn: 1
}, },
id: "First Line", id: 'First Line',
command: { command: {
id: commandId, id: commandId,
title: "First Line" title: 'First Line'
} }
} }
], ],

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -36,16 +36,16 @@ loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
monaco.languages.register({ monaco.languages.register({
id: "colorLanguage" id: 'colorLanguage'
}) });
monaco.editor.create(document.getElementById("container"), { monaco.editor.create(document.getElementById('container'), {
value: "red\nblue\ngreen", value: 'red\nblue\ngreen',
language: "colorLanguage", language: 'colorLanguage',
colorDecorators: true colorDecorators: true
}); });
monaco.languages.registerColorProvider("colorLanguage", { monaco.languages.registerColorProvider('colorLanguage', {
provideColorPresentations: (model, colorInfo) => { provideColorPresentations: (model, colorInfo) => {
var color = colorInfo.color; var color = colorInfo.color;
var red256 = Math.round(color.red * 255); var red256 = Math.round(color.red * 255);
@ -53,9 +53,9 @@ monaco.languages.registerColorProvider("colorLanguage", {
var blue256 = Math.round(color.blue * 255); var blue256 = Math.round(color.blue * 255);
var label; var label;
if (color.alpha === 1) { if (color.alpha === 1) {
label = "rgb(" + red256 + ", " + green256 + ", " + blue256 + ")"; label = 'rgb(' + red256 + ', ' + green256 + ', ' + blue256 + ')';
} else { } else {
label = "rgba(" + red256 + ", " + green256 + ", " + blue256 + ", " + color.alpha + ")"; label = 'rgba(' + red256 + ', ' + green256 + ', ' + blue256 + ', ' + color.alpha + ')';
} }
return [ return [
@ -94,10 +94,10 @@ monaco.languages.registerColorProvider("colorLanguage", {
endColumn: 0 endColumn: 0
} }
} }
] ];
} }
});
})
/*----------------------------------------SAMPLE JS END*/ /*----------------------------------------SAMPLE JS END*/
}); });

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -42,28 +42,28 @@ function createDependencyProposals(range) {
{ {
label: '"lodash"', label: '"lodash"',
kind: monaco.languages.CompletionItemKind.Function, kind: monaco.languages.CompletionItemKind.Function,
documentation: "The Lodash library exported as Node.js modules.", documentation: 'The Lodash library exported as Node.js modules.',
insertText: '"lodash": "*"', insertText: '"lodash": "*"',
range: range range: range
}, },
{ {
label: '"express"', label: '"express"',
kind: monaco.languages.CompletionItemKind.Function, kind: monaco.languages.CompletionItemKind.Function,
documentation: "Fast, unopinionated, minimalist web framework", documentation: 'Fast, unopinionated, minimalist web framework',
insertText: '"express": "*"', insertText: '"express": "*"',
range: range range: range
}, },
{ {
label: '"mkdirp"', label: '"mkdirp"',
kind: monaco.languages.CompletionItemKind.Function, kind: monaco.languages.CompletionItemKind.Function,
documentation: "Recursively mkdir, like <code>mkdir -p</code>", documentation: 'Recursively mkdir, like <code>mkdir -p</code>',
insertText: '"mkdirp": "*"', insertText: '"mkdirp": "*"',
range: range range: range
}, },
{ {
label: '"my-third-party-library"', label: '"my-third-party-library"',
kind: monaco.languages.CompletionItemKind.Function, kind: monaco.languages.CompletionItemKind.Function,
documentation: "Describe your library here", documentation: 'Describe your library here',
insertText: '"${1:my-third-party-library}": "${2:1.2.3}"', insertText: '"${1:my-third-party-library}": "${2:1.2.3}"',
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
range: range range: range
@ -71,12 +71,18 @@ function createDependencyProposals(range) {
]; ];
} }
monaco.languages.registerCompletionItemProvider('json', { monaco.languages.registerCompletionItemProvider('json', {
provideCompletionItems: function (model, position) { provideCompletionItems: function (model, position) {
// find out if we are completing a property in the 'dependencies' object. // find out if we are completing a property in the 'dependencies' object.
var textUntilPosition = model.getValueInRange({startLineNumber: 1, startColumn: 1, endLineNumber: position.lineNumber, endColumn: position.column}); var textUntilPosition = model.getValueInRange({
var match = textUntilPosition.match(/"dependencies"\s*:\s*\{\s*("[^"]*"\s*:\s*"[^"]*"\s*,\s*)*([^"]*)?$/); startLineNumber: 1,
startColumn: 1,
endLineNumber: position.lineNumber,
endColumn: position.column
});
var match = textUntilPosition.match(
/"dependencies"\s*:\s*\{\s*("[^"]*"\s*:\s*"[^"]*"\s*,\s*)*([^"]*)?$/
);
if (!match) { if (!match) {
return { suggestions: [] }; return { suggestions: [] };
} }
@ -93,9 +99,9 @@ monaco.languages.registerCompletionItemProvider('json', {
} }
}); });
monaco.editor.create(document.getElementById("container"), { monaco.editor.create(document.getElementById('container'), {
value: "{\n\t\"dependencies\": {\n\t\t\n\t}\n}\n", value: '{\n\t"dependencies": {\n\t\t\n\t}\n}\n',
language: "json" language: 'json'
}); });

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -59,7 +59,7 @@ var libSource = [
' * Returns the next fact', ' * Returns the next fact',
' */', ' */',
' static next():string', ' static next():string',
'}', '}'
].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.languages.typescript.javascriptDefaults.addExtraLib(libSource, libUri);

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -37,49 +37,48 @@ loadEditor(function() {
// Configures two JSON schemas, with references. // Configures two JSON schemas, with references.
var jsonCode = [ var jsonCode = ['{', ' "p1": "v3",', ' "p2": false', '}'].join('\n');
'{', var modelUri = monaco.Uri.parse('a://b/foo.json'); // a made up unique URI for our model
' "p1": "v3",', var model = monaco.editor.createModel(jsonCode, 'json', modelUri);
' "p2": false',
"}"
].join('\n');
var modelUri = monaco.Uri.parse("a://b/foo.json"); // a made up unique URI for our model
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.languages.json.jsonDefaults.setDiagnosticsOptions({
validate: true, validate: true,
schemas: [{ schemas: [
uri: "http://myserver/foo-schema.json", // id of the first schema {
uri: 'http://myserver/foo-schema.json', // id of the first schema
fileMatch: [modelUri.toString()], // associate with our model fileMatch: [modelUri.toString()], // associate with our model
schema: { schema: {
type: "object", type: 'object',
properties: { properties: {
p1: { p1: {
enum: ["v1", "v2"] enum: ['v1', 'v2']
}, },
p2: { p2: {
$ref: "http://myserver/bar-schema.json" // reference the second schema $ref: 'http://myserver/bar-schema.json' // reference the second schema
} }
} }
} }
}, { },
uri: "http://myserver/bar-schema.json", // id of the second schema {
uri: 'http://myserver/bar-schema.json', // id of the second schema
schema: { schema: {
type: "object", type: 'object',
properties: { properties: {
q1: { q1: {
enum: ["x1", "x2"] enum: ['x1', 'x2']
} }
} }
} }
}] }
]
}); });
monaco.editor.create(document.getElementById("container"), { monaco.editor.create(document.getElementById('container'), {
model: model model: model
}); });
/*----------------------------------------SAMPLE JS END*/ /*----------------------------------------SAMPLE JS END*/
}); });
</script> </script>

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -42,10 +42,10 @@ monaco.languages.register({ id: 'mySpecialLanguage' });
monaco.languages.setMonarchTokensProvider('mySpecialLanguage', { monaco.languages.setMonarchTokensProvider('mySpecialLanguage', {
tokenizer: { tokenizer: {
root: [ root: [
[/\[error.*/, "custom-error"], [/\[error.*/, 'custom-error'],
[/\[notice.*/, "custom-notice"], [/\[notice.*/, 'custom-notice'],
[/\[info.*/, "custom-info"], [/\[info.*/, 'custom-info'],
[/\[[a-zA-Z 0-9:]+\]/, "custom-date"], [/\[[a-zA-Z 0-9:]+\]/, 'custom-date']
] ]
} }
}); });
@ -58,40 +58,38 @@ monaco.editor.defineTheme('myCoolTheme', {
{ token: 'custom-info', foreground: '808080' }, { token: 'custom-info', foreground: '808080' },
{ token: 'custom-error', foreground: 'ff0000', fontStyle: 'bold' }, { token: 'custom-error', foreground: 'ff0000', fontStyle: 'bold' },
{ token: 'custom-notice', foreground: 'FFA500' }, { token: 'custom-notice', foreground: 'FFA500' },
{ token: 'custom-date', foreground: '008800' }, { token: 'custom-date', foreground: '008800' }
] ]
}); });
// Register a completion item provider for the new language // Register a completion item provider for the new language
monaco.languages.registerCompletionItemProvider('mySpecialLanguage', { monaco.languages.registerCompletionItemProvider('mySpecialLanguage', {
provideCompletionItems: () => { provideCompletionItems: () => {
var suggestions = [{ var suggestions = [
{
label: 'simpleText', label: 'simpleText',
kind: monaco.languages.CompletionItemKind.Text, kind: monaco.languages.CompletionItemKind.Text,
insertText: 'simpleText' insertText: 'simpleText'
}, { },
{
label: 'testing', label: 'testing',
kind: monaco.languages.CompletionItemKind.Keyword, kind: monaco.languages.CompletionItemKind.Keyword,
insertText: 'testing(${1:condition})', insertText: 'testing(${1:condition})',
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet
}, { },
{
label: 'ifelse', label: 'ifelse',
kind: monaco.languages.CompletionItemKind.Snippet, kind: monaco.languages.CompletionItemKind.Snippet,
insertText: [ insertText: ['if (${1:condition}) {', '\t$0', '} else {', '\t', '}'].join('\n'),
'if (${1:condition}) {',
'\t$0',
'} else {',
'\t',
'}'
].join('\n'),
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
documentation: 'If-Else Statement' documentation: 'If-Else Statement'
}]; }
];
return { suggestions: suggestions }; return { suggestions: suggestions };
} }
}); });
monaco.editor.create(document.getElementById("container"), { monaco.editor.create(document.getElementById('container'), {
theme: 'myCoolTheme', theme: 'myCoolTheme',
value: getCode(), value: getCode(),
language: 'mySpecialLanguage' language: 'mySpecialLanguage'
@ -107,7 +105,7 @@ function getCode() {
'[Sun Mar 7 17:13:50 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 17:13:50 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:21:44 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 17:21:44 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:23:53 2004] statistics: Use of uninitialized value in concatenation (.) or string at /home/httpd/twiki/lib/TWiki.pm line 528.', '[Sun Mar 7 17:23:53 2004] statistics: Use of uninitialized value in concatenation (.) or string at /home/httpd/twiki/lib/TWiki.pm line 528.',
'[Sun Mar 7 17:23:53 2004] statistics: Can\'t create file /home/httpd/twiki/data/Main/WebStatistics.txt - Permission denied', "[Sun Mar 7 17:23:53 2004] statistics: Can't create file /home/httpd/twiki/data/Main/WebStatistics.txt - Permission denied",
'[Sun Mar 7 17:27:37 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 17:27:37 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:31:39 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 17:31:39 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:58:00 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Sun Mar 7 17:58:00 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
@ -148,8 +146,8 @@ function getCode() {
'[Mon Mar 8 05:24:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 05:24:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 05:31:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed', '[Mon Mar 8 05:31:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'<11>httpd[31628]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_inf.html in 29-Mar 15:18:20.50 from xx.xx.xx.xx', '<11>httpd[31628]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_inf.html in 29-Mar 15:18:20.50 from xx.xx.xx.xx',
'<11>httpd[25859]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_bin/shtml.exe/_vti_rpc in 29-Mar 15:18:20.54 from xx.xx.xx.xx', '<11>httpd[25859]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_bin/shtml.exe/_vti_rpc in 29-Mar 15:18:20.54 from xx.xx.xx.xx'
].join('\n');; ].join('\n');
} }

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -36,11 +36,10 @@ loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
monaco.languages.register({ monaco.languages.register({
id: "foldLanguage" id: 'foldLanguage'
}); });
var value = var value = `1. Hit F1 to bring up the Command Palette
`1. Hit F1 to bring up the Command Palette
2. Type 'fold' 2. Type 'fold'
3. Choose 'Fold All Block Comments' or 'Fold All Regions' 3. Choose 'Fold All Block Comments' or 'Fold All Regions'
@ -68,14 +67,14 @@ var value =
27. region2 27. region2
28. region2 28. region2
29. region2` 29. region2`;
monaco.editor.create(document.getElementById("container"), { monaco.editor.create(document.getElementById('container'), {
value: value, value: value,
language: "foldLanguage" language: 'foldLanguage'
}); });
monaco.languages.registerFoldingRangeProvider("foldLanguage", { monaco.languages.registerFoldingRangeProvider('foldLanguage', {
provideFoldingRanges: function (model, context, token) { provideFoldingRanges: function (model, context, token) {
return [ return [
// comment1 // comment1
@ -111,6 +110,7 @@ monaco.languages.registerFoldingRangeProvider("foldLanguage", {
} }
}); });
/*----------------------------------------SAMPLE JS END*/ /*----------------------------------------SAMPLE JS END*/
}); });
</script> </script>

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -35,34 +35,41 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
loadEditor(function() { loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
monaco.languages.register({ id: 'mySpecialLanguage' }); monaco.languages.register({ id: 'mySpecialLanguage' });
monaco.languages.registerHoverProvider('mySpecialLanguage', { monaco.languages.registerHoverProvider('mySpecialLanguage', {
provideHover: function (model, position) { provideHover: function (model, position) {
return xhr('../playground.html').then(function (res) { return xhr('../playground.html').then(function (res) {
return { return {
range: new monaco.Range(1, 1, model.getLineCount(), model.getLineMaxColumn(model.getLineCount())), range: new monaco.Range(
1,
1,
model.getLineCount(),
model.getLineMaxColumn(model.getLineCount())
),
contents: [ contents: [
{ value: '**SOURCE**' }, { value: '**SOURCE**' },
{ value: '```html\n' + res.responseText.substring(0, 200) + '\n```' } { value: '```html\n' + res.responseText.substring(0, 200) + '\n```' }
] ]
} };
}); });
} }
}); });
monaco.editor.create(document.getElementById("container"), { monaco.editor.create(document.getElementById('container'), {
value: '\n\nHover over this text', value: '\n\nHover over this text',
language: 'mySpecialLanguage' language: 'mySpecialLanguage'
}); });
function xhr(url) { function xhr(url) {
var req = null; var req = null;
return new Promise(function (c, e) { return new Promise(
function (c, e) {
req = new XMLHttpRequest(); req = new XMLHttpRequest();
req.onreadystatechange = function () { req.onreadystatechange = function () {
if (req._canceled) { return; } if (req._canceled) {
return;
}
if (req.readyState === 4) { if (req.readyState === 4) {
if ((req.status >= 200 && req.status < 300) || req.status === 1223) { if ((req.status >= 200 && req.status < 300) || req.status === 1223) {
@ -74,14 +81,16 @@ function xhr(url) {
} }
}; };
req.open("GET", url, true); req.open('GET', url, true);
req.responseType = ""; req.responseType = '';
req.send(null); req.send(null);
}, function () { },
function () {
req._canceled = true; req._canceled = true;
req.abort(); req.abort();
}); }
);
} }

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -38,13 +38,36 @@ loadEditor(function() {
/** @type {monaco.languages.SemanticTokensLegend} */ /** @type {monaco.languages.SemanticTokensLegend} */
const legend = { const legend = {
tokenTypes: [ tokenTypes: [
'comment', 'string', 'keyword', 'number', 'regexp', 'operator', 'namespace', 'comment',
'type', 'struct', 'class', 'interface', 'enum', 'typeParameter', 'function', 'string',
'member', 'macro', 'variable', 'parameter', 'property', 'label' 'keyword',
'number',
'regexp',
'operator',
'namespace',
'type',
'struct',
'class',
'interface',
'enum',
'typeParameter',
'function',
'member',
'macro',
'variable',
'parameter',
'property',
'label'
], ],
tokenModifiers: [ tokenModifiers: [
'declaration', 'documentation', 'readonly', 'static', 'abstract', 'deprecated', 'declaration',
'modification', 'async' 'documentation',
'readonly',
'static',
'abstract',
'deprecated',
'modification',
'async'
] ]
}; };
@ -90,15 +113,13 @@ monaco.languages.registerDocumentSemanticTokensProvider('plaintext', {
for (let i = 0; i < lines.length; i++) { for (let i = 0; i < lines.length; i++) {
const line = lines[i]; const line = lines[i];
for (let match = null; match = tokenPattern.exec(line);) { for (let match = null; (match = tokenPattern.exec(line)); ) {
// translate token and modifiers to number representations // translate token and modifiers to number representations
let type = getType(match[1]); let type = getType(match[1]);
if (type === -1) { if (type === -1) {
continue; continue;
} }
let modifier = match[2].length let modifier = match[2].length ? getModifier(match[2].split('.').slice(1)) : 0;
? getModifier(match[2].split('.').slice(1))
: 0;
data.push( data.push(
// translate line to deltaLine // translate line to deltaLine
@ -152,7 +173,7 @@ monaco.editor.defineTheme('myCustomTheme', {
] ]
}); });
const editor = monaco.editor.create(document.getElementById("container"), { const editor = monaco.editor.create(document.getElementById('container'), {
value: [ value: [
'Available token types:', 'Available token types:',
' [comment] [string] [keyword] [number] [regexp] [operator] [namespace]', ' [comment] [string] [keyword] [number] [regexp] [operator] [namespace]',
@ -174,15 +195,13 @@ const editor = monaco.editor.create(document.getElementById("container"), {
'An error case:', 'An error case:',
' [notInLegend]' ' [notInLegend]'
].join('\n'), ].join('\n'),
language: "plaintext", language: 'plaintext',
theme: 'myCustomTheme', theme: 'myCustomTheme',
// semantic tokens provider is disabled by default // semantic tokens provider is disabled by default
'semanticHighlighting.enabled': true 'semanticHighlighting.enabled': true
}); });
/*----------------------------------------SAMPLE JS END*/ /*----------------------------------------SAMPLE JS END*/
}); });
</script> </script>

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -47,7 +47,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'File', name: 'File',
kind: 0, kind: 0,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -65,7 +65,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Module', name: 'Module',
kind: 1, kind: 1,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -83,7 +83,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Namespace', name: 'Namespace',
kind: 2, kind: 2,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -101,7 +101,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Package', name: 'Package',
kind: 3, kind: 3,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -119,7 +119,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Class', name: 'Class',
kind: 4, kind: 4,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -137,7 +137,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Method', name: 'Method',
kind: 5, kind: 5,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -155,7 +155,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Property', name: 'Property',
kind: 6, kind: 6,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -173,7 +173,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Field', name: 'Field',
kind: 7, kind: 7,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -191,7 +191,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Constructor', name: 'Constructor',
kind: 8, kind: 8,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -209,7 +209,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Enum', name: 'Enum',
kind: 9, kind: 9,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -227,7 +227,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Interface', name: 'Interface',
kind: 10, kind: 10,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -245,7 +245,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Function', name: 'Function',
kind: 11, kind: 11,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -263,7 +263,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Variable', name: 'Variable',
kind: 12, kind: 12,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -281,7 +281,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Constant', name: 'Constant',
kind: 13, kind: 13,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -299,7 +299,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'String', name: 'String',
kind: 14, kind: 14,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -317,7 +317,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Number', name: 'Number',
kind: 15, kind: 15,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -335,7 +335,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Boolean', name: 'Boolean',
kind: 16, kind: 16,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -353,7 +353,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Array', name: 'Array',
kind: 17, kind: 17,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -371,7 +371,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Object', name: 'Object',
kind: 18, kind: 18,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -389,7 +389,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Key', name: 'Key',
kind: 19, kind: 19,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -407,7 +407,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Null', name: 'Null',
kind: 20, kind: 20,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -425,7 +425,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'EnumMember', name: 'EnumMember',
kind: 21, kind: 21,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -443,7 +443,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Struct', name: 'Struct',
kind: 22, kind: 22,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -461,7 +461,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Event', name: 'Event',
kind: 23, kind: 23,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -479,7 +479,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'Operator', name: 'Operator',
kind: 24, kind: 24,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -497,7 +497,7 @@ monaco.languages.registerDocumentSymbolProvider('json', {
}, },
name: 'TypeParameter', name: 'TypeParameter',
kind: 25, kind: 25,
detail: "", detail: '',
tags: [], tags: [],
selectionRange: { selectionRange: {
startLineNumber: 1, startLineNumber: 1,
@ -505,17 +505,18 @@ monaco.languages.registerDocumentSymbolProvider('json', {
endLineNumber: 2, endLineNumber: 2,
endColumn: 1 endColumn: 1
} }
}, }
]; ];
} }
}); });
// press Ctrl+Shift+O to show the symbols in the editor // press Ctrl+Shift+O to show the symbols in the editor
monaco.editor.create(document.getElementById("container"), { monaco.editor.create(document.getElementById('container'), {
value: "{\n\t\"dependencies\": {\n\t\t\n\t}\n}\n", value: '{\n\t"dependencies": {\n\t\t\n\t}\n}\n',
language: "json" language: 'json'
}); });
/*----------------------------------------SAMPLE JS END*/ /*----------------------------------------SAMPLE JS END*/
}); });
</script> </script>

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -47,19 +47,22 @@ var jsCode = [
'};' '};'
].join('\n'); ].join('\n');
var editor = monaco.editor.create(document.getElementById("container"), { var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCode, value: jsCode,
language: "javascript" language: 'javascript'
}); });
var myCondition1 = editor.createContextKey(/*key name*/ 'myCondition1', /*default value*/ false); var myCondition1 = editor.createContextKey(/*key name*/ 'myCondition1', /*default value*/ false);
var myCondition2 = editor.createContextKey(/*key name*/ 'myCondition2', /*default value*/ false); var myCondition2 = editor.createContextKey(/*key name*/ 'myCondition2', /*default value*/ false);
editor.addCommand(monaco.KeyCode.Tab, function() { editor.addCommand(
monaco.KeyCode.Tab,
function () {
// services available in `ctx` // services available in `ctx`
alert('my command is executing!'); alert('my command is executing!');
},
}, 'myCondition1 && myCondition2') 'myCondition1 && myCondition2'
);
myCondition1.set(true); myCondition1.set(true);
@ -69,6 +72,7 @@ setTimeout(function() {
// you can use myCondition2.reset() to go back to the default // you can use myCondition2.reset() to go back to the default
}, 2000); }, 2000);
/*----------------------------------------SAMPLE JS END*/ /*----------------------------------------SAMPLE JS END*/
}); });
</script> </script>

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -35,7 +35,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
loadEditor(function() { loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
var editor = monaco.editor.create(document.getElementById("container"), { var editor = monaco.editor.create(document.getElementById('container'), {
value: [ value: [
'', '',
'class Example {', 'class Example {',
@ -46,7 +46,7 @@ var editor = monaco.editor.create(document.getElementById("container"), {
'\t}', '\t}',
'}' '}'
].join('\n'), ].join('\n'),
language: "typescript" language: 'typescript'
}); });
// Explanation: // Explanation:
@ -65,7 +65,10 @@ editor.addAction({
keybindings: [ keybindings: [
monaco.KeyMod.CtrlCmd | monaco.KeyCode.F10, monaco.KeyMod.CtrlCmd | monaco.KeyCode.F10,
// chord // chord
monaco.KeyMod.chord(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyK, monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyM) monaco.KeyMod.chord(
monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyK,
monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyM
)
], ],
// A precondition for this action. // A precondition for this action.

View file

@ -11,7 +11,6 @@
/*----------------------------------------SAMPLE CSS END*/ /*----------------------------------------SAMPLE CSS END*/
</style> </style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/> <a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
@ -56,9 +55,9 @@ var jsCode = [
'};' '};'
].join('\n'); ].join('\n');
var editor = monaco.editor.create(document.getElementById("container"), { var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCode, value: jsCode,
language: "javascript", language: 'javascript',
lineNumbers: lineNumbersFunc lineNumbers: lineNumbersFunc
}); });

View file

@ -23,6 +23,7 @@
margin-left: 3px; margin-left: 3px;
} }
/*----------------------------------------SAMPLE CSS END*/ /*----------------------------------------SAMPLE CSS END*/
</style> </style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/> <a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
@ -34,7 +35,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -59,15 +60,27 @@ var jsCode = [
'};' '};'
].join('\n'); ].join('\n');
var editor = monaco.editor.create(document.getElementById("container"), { var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCode, value: jsCode,
language: "javascript" language: 'javascript'
}); });
var decorations = editor.deltaDecorations([], [ var decorations = editor.deltaDecorations(
{ range: new monaco.Range(3,1,5,1), options: { isWholeLine: true, linesDecorationsClassName: 'myLineDecoration' }}, [],
{ range: new monaco.Range(7,1,7,24), options: { inlineClassName: 'myInlineDecoration' }}, [
]); {
range: new monaco.Range(3, 1, 5, 1),
options: {
isWholeLine: true,
linesDecorationsClassName: 'myLineDecoration'
}
},
{
range: new monaco.Range(7, 1, 7, 24),
options: { inlineClassName: 'myInlineDecoration' }
}
]
);
/*----------------------------------------SAMPLE JS END*/ /*----------------------------------------SAMPLE JS END*/

View file

@ -11,7 +11,6 @@
/*----------------------------------------SAMPLE CSS END*/ /*----------------------------------------SAMPLE CSS END*/
</style> </style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/> <a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
@ -36,9 +35,9 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
loadEditor(function() { loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/ /*----------------------------------------SAMPLE JS START*/
var editor = monaco.editor.create(document.getElementById("container"), { var editor = monaco.editor.create(document.getElementById('container'), {
value: "function hello() {\n\talert('Hello world!');\n}", value: "function hello() {\n\talert('Hello world!');\n}",
language: "javascript" language: 'javascript'
}); });
var myBinding = editor.addCommand(monaco.KeyCode.F9, function () { var myBinding = editor.addCommand(monaco.KeyCode.F9, function () {

View file

@ -28,9 +28,11 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="output" style="height:29%;font-family:'Courier New', monospace;">Last 3 events:<br/></div> <div id="output" style="height: 29%; font-family: 'Courier New', monospace">
Last 3 events:<br />
</div>
<div style="background: #ccc; height: 1%"></div> <div style="background: #ccc; height: 1%"></div>
<div id="container" style="height:70%;"></div> <div id="container" style="height: 70%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -55,14 +57,16 @@ var jsCode = [
'};' '};'
].join('\n'); ].join('\n');
var editor = monaco.editor.create(document.getElementById("container"), { var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCode, value: jsCode,
language: "javascript", language: 'javascript',
glyphMargin: true, glyphMargin: true,
contextmenu: false contextmenu: false
}); });
var decorations = editor.deltaDecorations([], [ var decorations = editor.deltaDecorations(
[],
[
{ {
range: new monaco.Range(3, 1, 3, 1), range: new monaco.Range(3, 1, 3, 1),
options: { options: {
@ -71,7 +75,8 @@ var decorations = editor.deltaDecorations([], [
glyphMarginClassName: 'myGlyphMarginClass' glyphMarginClassName: 'myGlyphMarginClass'
} }
} }
]); ]
);
// Add a zone to make hit testing more interesting // Add a zone to make hit testing more interesting
var viewZoneId = null; var viewZoneId = null;
@ -105,7 +110,10 @@ var contentWidget = {
lineNumber: 7, lineNumber: 7,
column: 8 column: 8
}, },
preference: [monaco.editor.ContentWidgetPositionPreference.ABOVE, monaco.editor.ContentWidgetPositionPreference.BELOW] preference: [
monaco.editor.ContentWidgetPositionPreference.ABOVE,
monaco.editor.ContentWidgetPositionPreference.BELOW
]
}; };
} }
}; };
@ -142,8 +150,6 @@ function showEvent(str) {
output.appendChild(document.createElement('br')); output.appendChild(document.createElement('br'));
} }
editor.onMouseMove(function (e) { editor.onMouseMove(function (e) {
showEvent('mousemove - ' + e.target.toString()); showEvent('mousemove - ' + e.target.toString());
}); });

View file

@ -28,7 +28,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -53,13 +53,15 @@ var jsCode = [
'};' '};'
].join('\n'); ].join('\n');
var editor = monaco.editor.create(document.getElementById("container"), { var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCode, value: jsCode,
language: "javascript", language: 'javascript',
glyphMargin: true glyphMargin: true
}); });
var decorations = editor.deltaDecorations([], [ var decorations = editor.deltaDecorations(
[],
[
{ {
range: new monaco.Range(3, 1, 3, 1), range: new monaco.Range(3, 1, 3, 1),
options: { options: {
@ -68,7 +70,8 @@ var decorations = editor.deltaDecorations([], [
glyphMarginClassName: 'myGlyphMarginClass' glyphMarginClassName: 'myGlyphMarginClass'
} }
} }
]); ]
);
// You can now use `decorations` to change or remove the decoration // You can now use `decorations` to change or remove the decoration

View file

@ -22,7 +22,7 @@ THIS IS A GENERATED FILE VIA gulp generate-test-samples
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey"> <div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START--> <!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height:100%;"></div> <div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END--> <!-- ----------------------------------------SAMPLE HTML END-->
@ -54,11 +54,12 @@ jsCodeArr = jsCodeArr.concat(jsCodeArr.slice(0));
jsCodeArr = jsCodeArr.concat(jsCodeArr.slice(0)); jsCodeArr = jsCodeArr.concat(jsCodeArr.slice(0));
jsCodeArr = jsCodeArr.concat(jsCodeArr.slice(0)); jsCodeArr = jsCodeArr.concat(jsCodeArr.slice(0));
jsCodeArr[49] += 'And this is some long line. And this is some long line. And this is some long line. And this is some long line. And this is some long line. '; jsCodeArr[49] +=
'And this is some long line. And this is some long line. And this is some long line. And this is some long line. And this is some long line. ';
var editor = monaco.editor.create(document.getElementById("container"), { var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCodeArr.join('\n'), value: jsCodeArr.join('\n'),
language: "javascript" language: 'javascript'
}); });
editor.revealPositionInCenter({ lineNumber: 50, column: 120 }); editor.revealPositionInCenter({ lineNumber: 50, column: 120 });

View file

@ -14,7 +14,7 @@ define([], function() { return[
}, },
{ {
"name": "run-editor-js-validationParticipant.js", "name": "run-editor-js-validationParticipant.js",
"content": "define([\r\n\t'vs/base/common/severity'\r\n], function(severity) {\r\n\t'use strict';\r\n\tfunction ValidateParticipant() {\r\n\r\n\t}\r\n\r\n\tValidateParticipant.ID = 'doc.validateParticipant';\r\n\tValidateParticipant.prototype.validate = function(mirrorModel, markerService) {\r\n\r\n\t\tvar marker = {\r\n\t\t\tseverity: severity.Error,\r\n\t\t\tmessage: [\r\n\t\t\t\t{ isText: true, text: '\\u2188 ' },\r\n\t\t\t\t{ tagName: 'span', style: 'color:red', text: 'I AM' },\r\n\t\t\t\t{ isText: true, text: ' A VALIDATION PARTICIPANT \\u2188' }\r\n\t\t\t],\r\n\t\t\tstartLineNumber: 1,\r\n\t\t\tstartColumn: 1,\r\n\t\t\tendLineNumber: 1,\r\n\t\t\tendColumn: 3\r\n\t\t};\r\n\r\n\t\tmarkerService.changeOne(ValidateParticipant.ID, mirrorModel.getAssociatedResource(), [marker]);\r\n\t};\r\n\treturn {\r\n\t\tValidateParticipant: ValidateParticipant\r\n\t};\r\n});" "content": "define(['vs/base/common/severity'], function (severity) {\n\t'use strict';\n\tfunction ValidateParticipant() {}\n\n\tValidateParticipant.ID = 'doc.validateParticipant';\n\tValidateParticipant.prototype.validate = function (mirrorModel, markerService) {\n\t\tvar marker = {\n\t\t\tseverity: severity.Error,\n\t\t\tmessage: [\n\t\t\t\t{ isText: true, text: '\\u2188 ' },\n\t\t\t\t{ tagName: 'span', style: 'color:red', text: 'I AM' },\n\t\t\t\t{ isText: true, text: ' A VALIDATION PARTICIPANT \\u2188' }\n\t\t\t],\n\t\t\tstartLineNumber: 1,\n\t\t\tstartColumn: 1,\n\t\t\tendLineNumber: 1,\n\t\t\tendColumn: 3\n\t\t};\n\n\t\tmarkerService.changeOne(ValidateParticipant.ID, mirrorModel.getAssociatedResource(), [marker]);\n\t};\n\treturn {\n\t\tValidateParticipant: ValidateParticipant\n\t};\n});\n"
}, },
{ {
"name": "run-editor-korean.txt", "name": "run-editor-korean.txt",