mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-23 00:22:56 +01:00
Allow keywords to be method names, except constructor/super
This commit is contained in:
parent
e712f24618
commit
1aa7a7cfd1
1 changed files with 5 additions and 4 deletions
|
|
@ -104,6 +104,8 @@ export const language = {
|
|||
'type'
|
||||
],
|
||||
|
||||
alwaysKeyword: ['constructor', 'super'],
|
||||
|
||||
keywords: [
|
||||
// Should match the keys of textToKeywordObj in
|
||||
// https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts
|
||||
|
|
@ -111,7 +113,6 @@ export const language = {
|
|||
'asserts',
|
||||
'class',
|
||||
'const',
|
||||
'constructor',
|
||||
'debugger',
|
||||
'declare',
|
||||
'delete',
|
||||
|
|
@ -145,7 +146,6 @@ export const language = {
|
|||
'satisfies',
|
||||
'set',
|
||||
'static',
|
||||
'super',
|
||||
'switch',
|
||||
'symbol',
|
||||
'this',
|
||||
|
|
@ -285,10 +285,11 @@ export const language = {
|
|||
{
|
||||
cases: {
|
||||
'@typeKeywords': 'type.identifier',
|
||||
'@ctrlKeywords': 'keyword.flow',
|
||||
'@keywords': 'keyword',
|
||||
'@alwaysKeyword': 'keyword',
|
||||
'$1~#?[A-Z].*': 'type.identifier',
|
||||
$2: 'method',
|
||||
'@ctrlKeywords': 'keyword.flow',
|
||||
'@keywords': 'keyword',
|
||||
'@default': 'identifier'
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue