VSCode Typescript 语法突出显示中类型的标记名称是什么?
What is the token name for types in VSCode Typescript syntax highlighting?
我想更改 VSCode 语法突出显示的样式,以便我可以区分类型和 类。
class Thing; // should be one color
type ThingT; // should be another color
我需要指定的代币名称是什么?我需要 TODO Highlight 吗?
class
的前景色使用范围entity.name.type.class.ts
。 type
使用 entity.name.type.alias.ts
.
更新: 如果在 settings.json
中覆盖,请使用:
"editor.semanticTokenColorCustomizations": {
"enabled": true,
"rules": {
"type": {
"foreground": "#ff0000" // color here
}
}
}
仅供参考,您可以使用 Developer: Inspect Editor Tokens and Scopes
命令查看作用域。例如,我为我的 TypeScript class:
language
typescript
standard token type
Other
foreground
#FFCB6B
background
#0F0F0F
contrast ratio
12.78
---
---
textmate scopes
entity.name.type.class.ts
meta.class.ts
source.ts
foreground
entity.name.type.class
{ "foreground": "#FFCB6B" }
您也可以使用 Developer: Generate Color Theme From Current Settings
命令:
我想更改 VSCode 语法突出显示的样式,以便我可以区分类型和 类。
class Thing; // should be one color
type ThingT; // should be another color
我需要指定的代币名称是什么?我需要 TODO Highlight 吗?
class
的前景色使用范围entity.name.type.class.ts
。 type
使用 entity.name.type.alias.ts
.
更新: 如果在 settings.json
中覆盖,请使用:
"editor.semanticTokenColorCustomizations": {
"enabled": true,
"rules": {
"type": {
"foreground": "#ff0000" // color here
}
}
}
仅供参考,您可以使用 Developer: Inspect Editor Tokens and Scopes
命令查看作用域。例如,我为我的 TypeScript class:
language | typescript |
standard token type | Other |
foreground | #FFCB6B |
background | #0F0F0F |
contrast ratio | 12.78 |
--- | --- |
textmate scopes | entity.name.type.class.ts meta.class.ts source.ts |
foreground | entity.name.type.class { "foreground": "#FFCB6B" } |
您也可以使用 Developer: Generate Color Theme From Current Settings
命令: