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

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

Loading…
Cancel
Save