Allow keywords to be method names, except constructor/super

This commit is contained in:
sdegutis 2024-08-23 11:49:07 -05:00
parent e712f24618
commit 1aa7a7cfd1

View file

@ -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'
} }
}, },