如何从VSCode中的textmate范围中删除样式

问题描述

如何删除主题在textmate范围上设置的样式?我正在使用的主题在storage.type.function范围内设置了字体粗细,我想将其删除,以使其继承自父范围。

两个关键字的最具体范围为storage.type.function,根据主题将其设置为粗体。

我使用了两个不太具体的范围meta.functionmeta.function.closure来设置常规和粗体样式,但是这两个主题都被主题设置的更具体的storage.type.function范围所覆盖。

因此,要应用我的自定义样式,我需要以某种方式删除在storage.type.function上设置的样式,以使其退回到我设置的meta值。将其设置为空白不起作用:

{
    "workbench.colorTheme": "Solarized Dark","editor.tokenColorCustomizations": {
        "textMateRules": [
            // Want to unset this style
            { "scope": "storage.type.function","settings": { "fontStyle": "" } },// Neither of these apply because the one above overrides them
            { "scope": "meta.function",{ "scope": "meta.function.closure","settings": { "fontStyle": "bold" } },]
}

如何取消设置storage.type.function以便应用meta样式?

这里有一些测试PHP可以重现问题,将其另存为example.php并在VSCode中打开它:

<?php

class Test {
  function a() {           // "function" should not be bold (meta.function)
    $b = function () {};   // "function" should be bold (meta.function.closure)
  }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...