Remove ES6 syntax from example

pull/2103/head
KapitanOczywisty 4 years ago
parent 0a6d139688
commit 51fe304f01

@ -149,25 +149,27 @@ monaco.editor.defineTheme('myCustomTheme', {
}); });
const editor = monaco.editor.create(document.getElementById("container"), { const editor = monaco.editor.create(document.getElementById("container"), {
value: `Available token types: value: [
[comment] [string] [keyword] [number] [regexp] [operator] [namespace] 'Available token types:',
[type] [struct] [class] [interface] [enum] [typeParameter] [function] ' [comment] [string] [keyword] [number] [regexp] [operator] [namespace]',
[member] [macro] [variable] [parameter] [property] [label] ' [type] [struct] [class] [interface] [enum] [typeParameter] [function]',
' [member] [macro] [variable] [parameter] [property] [label]',
Available token modifiers: '',
[type.declaration] [type.documentation] [type.member] [type.static] 'Available token modifiers:',
[type.abstract] [type.deprecated] [type.modification] [type.async] ' [type.declaration] [type.documentation] [type.member] [type.static]',
' [type.abstract] [type.deprecated] [type.modification] [type.async]',
Some examples: '',
[class.static.token] [type.static.abstract] 'Some examples:',
[class.static.token] [type.static] ' [class.static.token] [type.static.abstract]',
' [class.static.token] [type.static]',
[struct] '',
' [struct]',
[function.private] '',
' [function.private]',
An error case: '',
[notInLegend]`, 'An error case:',
' [notInLegend]'
].join('\n'),
language: "plaintext", language: "plaintext",
theme: 'myCustomTheme', theme: 'myCustomTheme',
// semantic tokens provider is disabled by default // semantic tokens provider is disabled by default
@ -176,9 +178,9 @@ An error case:
// currently there isn't builtin token handling // currently there isn't builtin token handling
editor._themeService._knownThemes.forEach(function (theme) { editor._themeService._knownThemes.forEach(function (theme) {
theme.getTokenStyleMetadata = (type, modifiers) => { theme.getTokenStyleMetadata = function (type, modifiers) {
// use theme rules match // use theme rules match
const style = theme._tokenTheme._root.match([type, ...modifiers].join('.')); const style = theme._tokenTheme._root.match([type].concat(modifiers).join('.'));
return { return {
foreground: style._foreground, foreground: style._foreground,
italic: style._fontStyle & 1, italic: style._fontStyle & 1,

@ -112,25 +112,27 @@ monaco.editor.defineTheme('myCustomTheme', {
}); });
const editor = monaco.editor.create(document.getElementById("container"), { const editor = monaco.editor.create(document.getElementById("container"), {
value: `Available token types: value: [
[comment] [string] [keyword] [number] [regexp] [operator] [namespace] 'Available token types:',
[type] [struct] [class] [interface] [enum] [typeParameter] [function] ' [comment] [string] [keyword] [number] [regexp] [operator] [namespace]',
[member] [macro] [variable] [parameter] [property] [label] ' [type] [struct] [class] [interface] [enum] [typeParameter] [function]',
' [member] [macro] [variable] [parameter] [property] [label]',
Available token modifiers: '',
[type.declaration] [type.documentation] [type.member] [type.static] 'Available token modifiers:',
[type.abstract] [type.deprecated] [type.modification] [type.async] ' [type.declaration] [type.documentation] [type.member] [type.static]',
' [type.abstract] [type.deprecated] [type.modification] [type.async]',
Some examples: '',
[class.static.token] [type.static.abstract] 'Some examples:',
[class.static.token] [type.static] ' [class.static.token] [type.static.abstract]',
' [class.static.token] [type.static]',
[struct] '',
' [struct]',
[function.private] '',
' [function.private]',
An error case: '',
[notInLegend]`, 'An error case:',
' [notInLegend]'
].join('\n'),
language: "plaintext", language: "plaintext",
theme: 'myCustomTheme', theme: 'myCustomTheme',
// semantic tokens provider is disabled by default // semantic tokens provider is disabled by default
@ -139,9 +141,9 @@ An error case:
// currently there isn't builtin token handling // currently there isn't builtin token handling
editor._themeService._knownThemes.forEach(function (theme) { editor._themeService._knownThemes.forEach(function (theme) {
theme.getTokenStyleMetadata = (type, modifiers) => { theme.getTokenStyleMetadata = function (type, modifiers) {
// use theme rules match // use theme rules match
const style = theme._tokenTheme._root.match([type, ...modifiers].join('.')); const style = theme._tokenTheme._root.match([type].concat(modifiers).join('.'));
return { return {
foreground: style._foreground, foreground: style._foreground,
italic: style._fontStyle & 1, italic: style._fontStyle & 1,

Loading…
Cancel
Save