VS代码编辑器没有显示正确的主题。有时起作用,有时不起作用,我想不出怎么复制它。我卸载了VS代码并重新安装了它,但是我仍然无法调试我自己的主题。
我创建了一个新的颜色主题
$ yo code我选择了new color theme并选择了blank dark one。
现在,当我启动调试器时,它会用我的主题加载一个新编辑器。我可以在preferences和color theme的菜单中选择它。
然后,有时它不应用所选的更改。
但是,当我从tokenColors: [...]中删除所有内容时,它允许我再次选择颜色主题,但是当我在tokenColors中键入一些新主题并重新加载它时,它不会应用新的样式。
我的猜测是VS代码在某处缓存样式,并且不会覆盖它。
问题是,如果不能调试,我如何开发一个新的颜色主题?
如何重新加载主题?
{
"name": "T",
"type": "dark",
"colors": {
"editorGroup.background": "#2b303b",
"editorGroup.border": "#c0c5ce",
"editor.background": "#2b303b",
"editor.foreground": "#c0c5ce",
"activityBarBadge.background": "#2b303b",
"sideBar.background": "#1c1f26",
"sideBar.foreground": "#c0c5ce",
"list.hoverBackground": "#2b303b",
"list.hoverForeground": "#c0c5ce",
"list.activeSelectionForeground": "#c0c5ce",
"list.inactiveSelectionForeground": "#c0c5ce",
"list.activeSelectionBackground": "#2b303b",
"list.inactiveSelectionBackground": "#2b303b",
"sideBarTitle.foreground": "#c0c5ce",
"sideBarSectionHeader.background": "#2b303b",
"statusBar.background": "#1c1f26",
"statusBar.foreground": "#c0c5ce",
"tab.activeBackground": "#2b303b",
"tab.inactiveBackground": "#1c1f26",
"terminal.background": "#2b303b",
"activityBar.border": "#1c1f26",
"activityBar.background": "#2b303b",
"sideBar.border": "#1c1f26",
"tab.activeForeground": "#c0c5ce"
},
"tokenColors": [
{
// const, let, if, else, async, await, try, catch
"name": "j",
"scope": [
"storage.type.js.jsx",
"storage.modifier.async.js.jsx",
"keyword.control.flow.js.jsx",
"keyword.control.conditional.js.jsx",
"keyword.control.trycatch.js.jsx"
],
"settings": {
"foreground": "#b48ead",
"fontStyle": "italic"
}
}
]
}发布于 2019-05-17 03:30:24
您实际上可以使用VS代码调试器。
.vscode/文件夹不存在,则创建它launch.json文件,并在该文件中创建该文件{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "extensionHost",
"request": "launch",
"name": "Launch Extension",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
},
]
}单独问题
虽然上面提到的通常是如何调试的,但这个问题尤其可能是,在tokenColors中添加的新作用域只是被覆盖(被更高优先级的作用域覆盖)而没有出现。在不了解更多情况的情况下,很难说。我不认为VS代码是缓存任何地方的变化,一个完整的窗口重新加载应该总是从零开始。
https://stackoverflow.com/questions/50332859
复制相似问题