mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52: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'
|
'type'
|
||||||
],
|
],
|
||||||
|
|
||||||
|
alwaysKeyword: ['constructor', 'super'],
|
||||||
|
|
||||||
keywords: [
|
keywords: [
|
||||||
// Should match the keys of textToKeywordObj in
|
// Should match the keys of textToKeywordObj in
|
||||||
// https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts
|
// https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts
|
||||||
|
|
@ -111,7 +113,6 @@ export const language = {
|
||||||
'asserts',
|
'asserts',
|
||||||
'class',
|
'class',
|
||||||
'const',
|
'const',
|
||||||
'constructor',
|
|
||||||
'debugger',
|
'debugger',
|
||||||
'declare',
|
'declare',
|
||||||
'delete',
|
'delete',
|
||||||
|
|
@ -145,7 +146,6 @@ export const language = {
|
||||||
'satisfies',
|
'satisfies',
|
||||||
'set',
|
'set',
|
||||||
'static',
|
'static',
|
||||||
'super',
|
|
||||||
'switch',
|
'switch',
|
||||||
'symbol',
|
'symbol',
|
||||||
'this',
|
'this',
|
||||||
|
|
@ -285,10 +285,11 @@ export const language = {
|
||||||
{
|
{
|
||||||
cases: {
|
cases: {
|
||||||
'@typeKeywords': 'type.identifier',
|
'@typeKeywords': 'type.identifier',
|
||||||
'@ctrlKeywords': 'keyword.flow',
|
'@alwaysKeyword': 'keyword',
|
||||||
'@keywords': 'keyword',
|
|
||||||
'$1~#?[A-Z].*': 'type.identifier',
|
'$1~#?[A-Z].*': 'type.identifier',
|
||||||
$2: 'method',
|
$2: 'method',
|
||||||
|
'@ctrlKeywords': 'keyword.flow',
|
||||||
|
'@keywords': 'keyword',
|
||||||
'@default': 'identifier'
|
'@default': 'identifier'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue