on master help sign in
align highlight scopes with documented scopes
4771cc7Michael Davis
book/src/themes.md+2
@@ -120,6 +120,8 @@ We use a similar set of scopes as
120 - `path`
120 - `path`
121 - `url`
121 - `url`
122
122
123+- `symbol` - Elixir atoms, Ruby symbols, Clojure keywords
124+
123- `comment` - Code comments
125- `comment` - Code comments
124 - `line` - Single line comments (`//`)
126 - `line` - Single line comments (`//`)
125 - `block` - Block comments (e.g. (`/* */`)
127 - `block` - Block comments (e.g. (`/* */`)
runtime/queries/elixir/highlights.scm+22−23
@@ -23,29 +23,29 @@
23
23
24; * doc string
24; * doc string
25(unary_operator
25(unary_operator
26− operator: "@" @comment.doc
26+ operator: "@" @comment.block.documentation
27 operand: (call
27 operand: (call
28− target: (identifier) @comment.doc.__attribute__
28+ target: (identifier) @comment.block.documentation.__attribute__
29 (arguments
29 (arguments
30 [
30 [
31− (string) @comment.doc
31+ (string) @comment.block.documentation
32− (charlist) @comment.doc
32+ (charlist) @comment.block.documentation
33 (sigil
33 (sigil
34− quoted_start: _ @comment.doc
34+ quoted_start: _ @comment.block.documentation
35− quoted_end: _ @comment.doc) @comment.doc
35+ quoted_end: _ @comment.block.documentation) @comment.block.documentation
36− (boolean) @comment.doc
36+ (boolean) @comment.block.documentation
37 ]))
37 ]))
38− (#match? @comment.doc.__attribute__ "^(moduledoc|typedoc|doc)$"))
38+ (#match? @comment.block.documentation.__attribute__ "^(moduledoc|typedoc|doc)$"))
39
39
40; * module attribute
40; * module attribute
41(unary_operator
41(unary_operator
42− operator: "@" @attribute
42+ operator: "@" @variable.property
43 operand: [
43 operand: [
44− (identifier) @attribute
44+ (identifier) @variable.property
45 (call
45 (call
46− target: (identifier) @attribute)
46+ target: (identifier) @variable.property)
47− (boolean) @attribute
47+ (boolean) @variable.property
48− (nil) @attribute
48+ (nil) @variable.property
49 ])
49 ])
50
50
51; * capture operand
51; * capture operand
@@ -69,10 +69,9 @@
69
69
70; Literals
70; Literals
71
71
72−[
72+(nil) @constant.builtin
73− (boolean)
73+
74− (nil)
75−] @constant
74+(boolean) @constant.builtin.boolean
76
75
77[
76[
78 (integer)
77 (integer)
@@ -85,20 +84,20 @@
85 target: (dot
84 target: (dot
86 left: (atom) @type))
85 left: (atom) @type))
87
86
88−(char) @constant
87+(char) @constant.character
89
88
90; Quoted content
89; Quoted content
91
90
92−(interpolation "#{" @punctuation.special "}" @punctuation.special) @embedded
91+(interpolation "#{" @escape "}" @escape) @embedded
93
92
94−(escape_sequence) @string.escape
93+(escape_sequence) @escape
95
94
96[
95[
97 (atom)
96 (atom)
98 (quoted_atom)
97 (quoted_atom)
99 (keyword)
98 (keyword)
100 (quoted_keyword)
99 (quoted_keyword)
101−] @tag
100+] @symbol
102
101
103[
102[
104 (string)
103 (string)
@@ -182,8 +181,8 @@
182
181
183; * unused
182; * unused
184(
183(
185− (identifier) @comment.unused
184+ (identifier) @comment
186− (#match? @comment.unused "^_")
185+ (#match? @comment "^_")
187)
186)
188
187
189; * regular
188; * regular