gpt4 book ai didi

xml - 如何更改 Sublime Text2 中 JSON `Key` 的颜色

转载 作者:数据小太阳 更新时间:2023-10-29 02:23:57 57 4
gpt4 key购买 nike

所以我添加了:

    <dict>
<key>name</key>
<string>JSON Key</string>
<key>scope</key>
<string>meta.structure.dictionary.json string2.quoted.double.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#00FF00</string>
</dict>
</dict>

我的配色方案 custom.tmTheme 并且我添加了:

    <key>string2</key>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string2.begin.json</string>
</dict>
</dict>
<key>end</key>
<string>"\s.:</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string2.end.json</string>
</dict>
</dict>
<key>name</key>
<string>string2.quoted.double.json</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(?x: # turn on extended mode
\\ # a literal backslash
(?: # ...followed by...
["\\/bfnrt] # one of these characters
| # ...or...
u # a u
[0-9a-fA-F]{4} # and four hex digits
)
)</string>
<key>name</key>
<string>constant.character.escape.json</string>
</dict>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>invalid.illegal.unrecognized-string-escape.json</string>
</dict>
</array>
</dict>

到我的包文件夹中的 JSON-test.tmLanguage 文件,但我仍然没有看到绿色键。

有人知道我哪里出错了吗?

最佳答案

您无需创建或修改.tmLanguage 文件,只需使用JavaScript -> JSON 语法即可。像这样修改你的 .tmTheme:

<dict>
<key>name</key>
<string>JSON Key</string>
<key>scope</key>
<string>meta.structure.dictionary.json string.quoted.double.json -meta.structure.dictionary.value.json</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#00FF00</string>
</dict>
</dict>

您应该准备就绪。它会突出显示 JSON 字典中包含的所有字符串,但如果范围包含 meta.structure.dictionary.value.json 则不会,因此它只会突出显示键。

关于xml - 如何更改 Sublime Text2 中 JSON `Key` 的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23416098/

57 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com