我在哪里可以找到 tm-themes 的所有可能键的列表以进行语法高亮显示? [英] Where can I find a list of all possible keys for tm-themes for syntax highlighting?

查看:14
本文介绍了我在哪里可以找到 tm-themes 的所有可能键的列表以进行语法高亮显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我当前文本编辑器的 tmTheme 文件中有许多选项,包括下面代码中的选项.是否有某个列表定义了可以包含在此列表中的所有可能的标签(例如,backgroundinactiveSelectionfindHighlight 等)?

<key>背景</key><string>#1a1a1a</string><key>插入符号</key><string>#B6ECF9AF</string><key>前景</key><string>#ecf0f1</string><key>隐形</key><string>#F3FFB51A</string><key>lineHighlight</key><string>#2a2a2a</string><key>选择</key><string>#e74c3c55</string><key>selectionForeground</key><string>#ffffff</string><key>findHighlight</key><string>#e74c3c</string><key>inactiveSelection</key><string>#e74c3c77</string><key>装订线</key><string>#2a2a2a</string><key>gutterForeground</key><string>#ffffff</string><key>指南</key><string>#222222</string><key>activeGuide</key><string>#ffffff</string></dict>

另一个带有更多标签的例子: 扩展类似的事情,但在悬停时(我个人更喜欢可用性方面).但是,它只列出作用域名称,不包括 VSCode 的内置检查器具有的任何附加信息.

In the tmTheme file for my current text editor there are a number of options, including the ones in the code below. Is there a list somewhere that defines all possible tags that could be included in this list (eg. background, inactiveSelection, findHighlight, etc)?

<dict>

<key>background</key>
<string>#1a1a1a</string>

<key>caret</key>
<string>#B6ECF9AF</string>

<key>foreground</key>
<string>#ecf0f1</string>

<key>invisibles</key>
<string>#F3FFB51A</string>

<key>lineHighlight</key>
<string>#2a2a2a</string>

<key>selection</key>
<string>#e74c3c55</string>

<key>selectionForeground</key>
<string>#ffffff</string>

<key>findHighlight</key>
<string>#e74c3c</string>

<key>inactiveSelection</key>
<string>#e74c3c77</string>

<key>gutter</key>
<string>#2a2a2a</string>

<key>gutterForeground</key>
<string>#ffffff</string>

<key>guide</key>
<string>#222222</string>

<key>activeGuide</key>
<string>#ffffff</string>

</dict>

Another example with even more tags: Other Theme

If it's relevant, I'm using VSCode.

解决方案

tmLanguage scope names are based on convention, so there's no definitive list. The "Naming Conventions" section at the bottom of this TextMate Manual page is fairly comprehensive though.

You can also check what scopes are highlighted by VSCode's default themes, see for instance dark_plus.json and dark_vs.json (which the former is based on / includes).

Finally, as of VSCode 1.9.0, there is a builtin command to inspect tmLanguage scopes (Developer: Inspect Editor Tokens and Scopes). It will give you a lot of information over how the token at the cursor location is scoped / highlighted:

There is also a Scope Info extension which does a very similar thing, but on hover (which I personally prefer usability-wise). However, it only lists the scope names, not including any of the additional info that VSCode's built-in inspector has.

这篇关于我在哪里可以找到 tm-themes 的所有可能键的列表以进行语法高亮显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆