mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 07:00:11 +01:00
Remove ES6 syntax from example
This commit is contained in:
parent
0a6d139688
commit
51fe304f01
2 changed files with 46 additions and 42 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue