on master help sign in
align highlight scopes with documented scopes
commit4771cc7ee49ebf59f837a6899a6b1d7e044c011a authorMichael Davis <mcarsondavis@gmail.com> dateThu 14 Oct 2021, 13:45 (5 years ago) parentc502caf
2 files changed+24−23
book/src/themes.md+2 runtime/queries/elixir/highlights.scm+22−23
book/src/themes.md+2
@@ -120,6 +120,8 @@ We use a similar set of scopes as
120120 - `path`
121121 - `url`
122122
123+- `symbol` - Elixir atoms, Ruby symbols, Clojure keywords
124+
123125- `comment` - Code comments
124126 - `line` - Single line comments (`//`)
125127 - `block` - Block comments (e.g. (`/* */`)
runtime/queries/elixir/highlights.scm+22−23
@@ -23,29 +23,29 @@
2323
2424; * doc string
2525(unary_operator
26− operator: "@" @comment.doc
26+ operator: "@" @comment.block.documentation
2727 operand: (call
28− target: (identifier) @comment.doc.__attribute__
28+ target: (identifier) @comment.block.documentation.__attribute__
2929 (arguments
3030 [
31− (string) @comment.doc
32− (charlist) @comment.doc
31+ (string) @comment.block.documentation
32+ (charlist) @comment.block.documentation
3333 (sigil
34− quoted_start: _ @comment.doc
35− quoted_end: _ @comment.doc) @comment.doc
36− (boolean) @comment.doc
34+ quoted_start: _ @comment.block.documentation
35+ quoted_end: _ @comment.block.documentation) @comment.block.documentation
36+ (boolean) @comment.block.documentation
3737 ]))
38− (#match? @comment.doc.__attribute__ "^(moduledoc|typedoc|doc)$"))
38+ (#match? @comment.block.documentation.__attribute__ "^(moduledoc|typedoc|doc)$"))
3939
4040; * module attribute
4141(unary_operator
42− operator: "@" @attribute
42+ operator: "@" @variable.property
4343 operand: [
44− (identifier) @attribute
44+ (identifier) @variable.property
4545 (call
46− target: (identifier) @attribute)
47− (boolean) @attribute
48− (nil) @attribute
46+ target: (identifier) @variable.property)
47+ (boolean) @variable.property
48+ (nil) @variable.property
4949 ])
5050
5151; * capture operand
@@ -69,10 +69,9 @@
6969
7070; Literals
7171
72−[
73− (boolean)
74− (nil)
75−] @constant
72+(nil) @constant.builtin
73+
74+(boolean) @constant.builtin.boolean
7675
7776[
7877 (integer)
@@ -85,20 +84,20 @@
8584 target: (dot
8685 left: (atom) @type))
8786
88−(char) @constant
87+(char) @constant.character
8988
9089; Quoted content
9190
92−(interpolation "#{" @punctuation.special "}" @punctuation.special) @embedded
91+(interpolation "#{" @escape "}" @escape) @embedded
9392
94−(escape_sequence) @string.escape
93+(escape_sequence) @escape
9594
9695[
9796 (atom)
9897 (quoted_atom)
9998 (keyword)
10099 (quoted_keyword)
101−] @tag
100+] @symbol
102101
103102[
104103 (string)
@@ -182,8 +181,8 @@
182181
183182; * unused
184183(
185− (identifier) @comment.unused
186− (#match? @comment.unused "^_")
184+ (identifier) @comment
185+ (#match? @comment "^_")
187186)
188187
189188; * regular