visual-studio-code - 有没有办法在语言扩展中为 `tokenColors` 贡献默认值
问题描述
我研究一种语言的新语法,并引入新的作用域。
我想为这些新范围定义合理的默认颜色,就像可以通过颜色贡献来完成一样
以下示例显示了它是如何完成的colors
:
{
"contributes": {
"colors": [
{
"id": "superstatus.error",
"description": "Color for error message in the status bar.",
"defaults": {
"dark": "errorForeground",
"light": "errorForeground",
"highContrast": "#010203"
}
}
]
}
}
我想tokenColors
在我的扩展中设置默认值,例如:
{
"contributes": {
"tokenColors": [
{
"scopes": ["my.warning.new.scope.waring", "my.warining.other.new.scope"],
"description": "Color for warning message in unknown .",
"defaults": {
"dark": "wariningForeground",
"light": "wariningForeground",
"highContrast": "#010203"
}
}
]
}
}
我不想创建一个继承自另一个主题的新主题,因为用户必须明确选择它。
我想为范围定义合理的默认值,因为大多数主题不会为我的新范围定义颜色。
有没有办法在不创建新主题的情况下为令牌范围定义默认令牌颜色?
解决方案
推荐阅读
- python - Google 的 App Engine:Streamlit WebRTC 的带有 sendrecv 模式的播放器一次只处理一个请求
- forms - 提交表单后的 VueJS 生命周期
- java-web-start - Java Webstart:以变量的形式将 JNLP 传递给 deployJava.launchWebStartApplication
- javascript - 画布缩放到光标无法正常工作
- c# - 从 c# 异步调用 Outlook
- c++ - 如何配置 VS 代码以在发布模式下构建(clang + macOS)
- azure - 自托管生成代理无法连接到 Azure DevOps 服务,无法建立 SSL 连接
- html - 正在访问子目录而不是同名的 html 文件
- intro.js - V3 升级问题:Intro 停止处理由 ajax 加载的元素
- json - Scala,Play Framework - “JsUndefined(“VALUE1”不是对象)” - 有没有更好的方法将 json 反序列化为 Map [String,String]?