diff --git a/src/basic-languages/typescript/typescript.ts b/src/basic-languages/typescript/typescript.ts index 8c1535ed..779c9f6c 100644 --- a/src/basic-languages/typescript/typescript.ts +++ b/src/basic-languages/typescript/typescript.ts @@ -75,10 +75,11 @@ export const conf: languages.LanguageConfiguration = { }; export const language = { - // Set defaultToken to invalid to see what you do not tokenize yet defaultToken: 'invalid', tokenPostfix: '.ts', + typeKeywords: ['any', 'bigint', 'boolean', 'number', 'object', 'string', 'unknown', 'void'], + ctrlKeywords: [ 'export', 'default', @@ -107,10 +108,7 @@ export const language = { // Should match the keys of textToKeywordObj in // https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts 'abstract', - 'any', 'asserts', - 'bigint', - 'boolean', 'class', 'const', 'constructor', @@ -135,8 +133,6 @@ export const language = { 'never', 'new', 'null', - 'number', - 'object', 'out', 'package', 'private', @@ -149,7 +145,6 @@ export const language = { 'satisfies', 'set', 'static', - 'string', 'super', 'switch', 'symbol', @@ -158,9 +153,7 @@ export const language = { 'typeof', 'undefined', 'unique', - 'unknown', 'var', - 'void', 'while', 'async', 'of' @@ -291,6 +284,7 @@ export const language = { [ { cases: { + '@typeKeywords': 'type.identifier', '@ctrlKeywords': 'keyword.flow', '@keywords': 'keyword', '$1~#?[A-Z].*': 'type.identifier',