"editor.tokenColorCustomizations": { "[One Dark Pro]": { "textMateRules": [ { "scope": ["text.html entity.name.tag", "text.html punctuation.tag"], "settings": { "fontStyle": "bold", "editor.fontSize": 20 } } ] } } 帮我修改成可以生效的
时间: 2023-07-22 07:09:05 浏览: 63
对于 `editor.fontSize` 的设置,它不应该在 `editor.tokenColorCustomizations` 中使用。你可以将其移出 `settings` 对象,并将其作为单独的设置。
以下是修改后的代码,使其能够生效:
```json
"editor.tokenColorCustomizations": {
"[One Dark Pro]": {
"textMateRules": [
{
"scope": [
"text.html entity.name.tag",
"text.html punctuation.tag"
],
"settings": {
"fontStyle": "bold"
}
}
]
}
},
"editor.fontSize": 20
```
将这段代码添加到你的 `settings.json` 文件中,并确保你正在使用 One Dark Pro 主题。保存后,重新加载 VSCode 编辑器,你应该能够看到对应的字体大小和样式生效。
相关问题
"editor.tokenColorCustomizations": { "[One Dark Pro]": { "textMateRules": [ { "scope": [ "text.html entity.name.tag", "text.html punctuation.tag" ], "settings": { "fontStyle": "bold" } } ] } }, "editor.fontSize": 20 我只想让 这个 text html 生效 其他的不生效 字体大小
如果你只想让 `text.html` 的字体大小生,而其他部分保持默认字体大小,你可以使用以下代码:
```json
"editor.tokenColorCustomizations": {
"[One Dark Pro]": {
"textMateRules": [
{
"scope": ["text.html entity.name.tag", "text.html punctuation.tag"],
"settings": {
"fontStyle": "bold"
}
}
]
}
},
"editor.tokenColorCustomizationsOverr
"editor.tokenColorCustomizations": { "[One Dark Pro]": { "textMateRules": [ { "scope": ["text.html entity.name.tag", "text.html punctuation.tag"], "settings": { "fontStyle": "bold", "editor.fontSize": 20 } } ] } } 为什么 我这样控制 对应字体不行
在 VSCode 中,`editor.fontSize` 设置是应用于个编辑器的字体大小。但是,`editor.fontSize` 设置无法在 `editor.tokenColorCustomizations` 中使用,因为 `editor.fontSize` 是全局设置,而 `editor.tokenColorCustomizations` 是用于自定义代码语法高亮的颜色和样式。
如果你想针对特定的代码语法实体或标点符号修改字体大小,可以尝试使用其他插件或主题来实现。一些主题插件可能提供更多的自定义选项来调整字体大小。你可以在 VSCode 插件市场中搜索适合你需求的插件或主题。