Commit d009fe4
committed
Highlight instance vars, method defs, and keyword params distinctly
These three constructs are folded into broader shared captures, so themes
cannot color them independently:
- instance variables share `@variable.special` with `self`, `super`, and
class variables
- method definitions share `@function.method` with method calls
- keyword parameters share `@variable.parameter` with positional parameters
Give each its own dotted sub-scope, following the sub-scoping convention
already used throughout this file (e.g. `function.method.builtin`,
`keyword.control.conditional`, `string.special.symbol`):
- (instance_variable) -> @variable.special.instance
- method / singleton_method -> @function.method.definition
- keyword_parameter -> @variable.parameter.keyword
Fully backwards-compatible: Zed resolves highlight names by longest prefix,
so themes that only define `variable.special`, `function.method`, or
`variable.parameter` render these exactly as before. Themes can now opt in to
distinguishing them.1 parent 67c79df commit d009fe4
1 file changed
Lines changed: 6 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
145 | 144 | | |
146 | 145 | | |
147 | 146 | | |
| |||
0 commit comments