mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-23 00:22:56 +01:00
Add JavaScript coloring
This commit is contained in:
parent
4b1d2982ff
commit
3979a669f3
12 changed files with 711 additions and 21 deletions
|
|
@ -527,7 +527,7 @@ testTokenization('typescript', [
|
|||
|
||||
|
||||
[{
|
||||
line: '`${5 + \'x\' + (<any>)3}`',
|
||||
line: '`${5 + \'x\' + (<any>)3}a${4}`',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.ts' },
|
||||
{ startIndex: 1, type: 'delimiter.bracket.ts' },
|
||||
|
|
@ -547,6 +547,10 @@ testTokenization('typescript', [
|
|||
{ startIndex: 20, type: 'number.ts' },
|
||||
{ startIndex: 21, type: 'delimiter.bracket.ts' },
|
||||
{ startIndex: 22, type: 'string.ts' },
|
||||
{ startIndex: 23, type: 'delimiter.bracket.ts' },
|
||||
{ startIndex: 25, type: 'number.ts' },
|
||||
{ startIndex: 26, type: 'delimiter.bracket.ts' },
|
||||
{ startIndex: 27, type: 'string.ts' },
|
||||
]
|
||||
}]
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ export const conf: IRichLanguageConfiguration = {
|
|||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
export const language = {
|
||||
// Set defaultToken to invalid to see what you do not tokenize yet
|
||||
defaultToken: 'invalid',
|
||||
tokenPostfix: '.ts',
|
||||
|
|
@ -190,7 +190,7 @@ export const language = <ILanguage>{
|
|||
|
||||
string_backtick: [
|
||||
[/\$\{/, { token: 'delimiter.bracket', next: '@bracketCounting' }],
|
||||
[/[^\\`]+/, 'string'],
|
||||
[/[^\\`$]+/, 'string'],
|
||||
[/@escapes/, 'string.escape'],
|
||||
[/\\./, 'string.escape.invalid'],
|
||||
[/`/, 'string', '@pop']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue