每种语法都可以命名自己的范围,但它们都基于此列表。例如,您的语法可能会指定这function
是storage.type.function.js
范围。如果您的主题直接支持它,它将使用该颜色,否则它将回退到最后storage.type.function
尝试在您的主题中找到一种颜色。storage.type
storage
由于您正在创建自己的样式,因此我建议您安装ScopeStatus(CTRL+ SHIFT+ P,然后是 Install Package,然后是 ScopeStatus)。使用您想要专注的语法查看文件,执行CTRL++ ,然后“范围SHIFT:P在状态栏中显示”。现在您可以将光标移动到各种元素以查看它们提供的范围,您可以使用它们来定义颜色。
您可以检查您的主题以查看它们的作用,转到“首选项->浏览包”以打开存储包的文件夹。我安装了“主题 - Phoenix”,它下面有一个文件夹和一个“配色方案”文件夹。在其中一个主题文件中,我发现了 16 种用于各种范围的颜色:
keyword.operator.class, constant.other, source.php.embedded.line
variable, support.other.variable, string.other.link, entity.name.tag, entity.other.attribute-name, meta.tag, declaration.tag
constant.numeric, constant.language, support.constant, constant.character, variable.parameter, punctuation.section.embedded, keyword.other.unit
entity.name.class, entity.name.type.class, support.type, support.class
string, constant.other.symbol, entity.other.inherited-class, markup.heading
keyword.operator, constant.other.color
entity.name.function, meta.function-call, support.function, keyword.other.special-method, meta.block-level
keyword, storage, storage.type, entity.name.tag.css
invalid
meta.separator
invalid.deprecated
markup.inserted.diff, markup.deleted.diff, meta.diff.header.to-file, meta.diff.header.from-file
markup.inserted.diff, meta.diff.header.to-file
markup.deleted.diff, meta.diff.header.from-file
meta.diff.header.from-file, meta.diff.header.to-file
meta.diff.range
不同的主题可能有不同的设置,第一组中的keyword.operator.class可能有自己的颜色或与meta.diff.range相同。