Sublime Text 2 高亮:如何区分变量声明和变量使用?

Sublime Text 2 highlighting : how to differenciate variable declaration and variable use?

有没有办法通过使用两种不同的颜色和 Sublime Text 2 语法突出显示来区分变量声明和变量使用?

这是我正在尝试做的事情的示例:(jsFiddle 的屏幕截图)

我在任何 Sublime Text 2 配色方案 xml 文件和网络上都没有发现任何有用的信息。我正在尝试做的事情是否可行?

只有在语法定义将变量声明的范围限定为与使用不同的情况下才有可能。 ST 附带的 JavaScript 语法不会这样做。 因此,除非您更改语法定义,否则无法通过更改配色方案来实现您想要的效果。

如果您升级到 ST3,您可以更新语法,以便在 it scopes the var keyword, it could push into another context where it would expect an identifier, and scope that uniquely. See the sublime-syntax documentation for details.

之后