【发布时间】:2017-05-24 07:26:14
【问题描述】:
我正在为 vscode 1.12.2 编写一个扩展,我正在尝试确定默认主题。 Atom Editor 有一个不错的API for accessing config values,例如:
atom.config.defaultSettings.core.themes[0]
"one-dark-ui"
atom.config.defaultSettings.core.themes[1]
"one-dark-syntax"
vscode 中有类似的东西吗?
我可以在~/AppData/Roaming/Code/User/settings.json 中看到值“workbench.colorTheme”:
// "terminal.integrated.shell.windows": "/Program Files/Git/bin/bash.exe"
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k",
"C:\\Program Files\\Git\\bin\\bash.exe"
],
"workbench.colorTheme": "Default Light+" <-- here
但是,我宁愿不采用自定义解决方案,直接将配置文件读取为 JSON,特别是因为它允许非默认 JSON 值(例如 cmets),我大概必须预先解析出来。
虽然这个问题只针对确定主题,但它确实适用于任何配置参数。我在vscode html api 或浏览打字文件/c/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/vscode.d.ts 中没有看到任何内容
【问题讨论】:
标签: visual-studio-code vscode-extensions