mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 23:13:02 +01:00
Colorize type names as type identifiers in TypeScript.
Also, this reformatted the file. Not sure why, but it's better this way anyway.
This commit is contained in:
parent
9117a92944
commit
e712f24618
1 changed files with 3 additions and 9 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue