aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--book/src/themes.md2
-rw-r--r--runtime/queries/elixir/highlights.scm45
2 files changed, 24 insertions, 23 deletions
diff --git a/book/src/themes.md b/book/src/themes.md
index a99e3a59..2d75ac57 100644
--- a/book/src/themes.md
+++ b/book/src/themes.md
@@ -120,6 +120,8 @@ We use a similar set of scopes as
- `path`
- `url`
+- `symbol` - Elixir atoms, Ruby symbols, Clojure keywords
+
- `comment` - Code comments
- `line` - Single line comments (`//`)
- `block` - Block comments (e.g. (`/* */`)
diff --git a/runtime/queries/elixir/highlights.scm b/runtime/queries/elixir/highlights.scm
index a5b3884e..82ef081d 100644
--- a/runtime/queries/elixir/highlights.scm
+++ b/runtime/queries/elixir/highlights.scm
@@ -23,29 +23,29 @@
; * doc string
(unary_operator
- operator: "@" @comment.doc
+ operator: "@" @comment.block.documentation
operand: (call
- target: (identifier) @comment.doc.__attribute__
+ target: (identifier) @comment.block.documentation.__attribute__
(arguments
[
- (string) @comment.doc
- (charlist) @comment.doc
+ (string) @comment.block.documentation
+ (charlist) @comment.block.documentation
(sigil
- quoted_start: _ @comment.doc
- quoted_end: _ @comment.doc) @comment.doc
- (boolean) @comment.doc
+ quoted_start: _ @comment.block.documentation
+ quoted_end: _ @comment.block.documentation) @comment.block.documentation
+ (boolean) @comment.block.documentation
]))
- (#match? @comment.doc.__attribute__ "^(moduledoc|typedoc|doc)$"))
+ (#match? @comment.block.documentation.__attribute__ "^(moduledoc|typedoc|doc)$"))
; * module attribute
(unary_operator
- operator: "@" @attribute
+ operator: "@" @variable.property
operand: [
- (identifier) @attribute
+ (identifier) @variable.property
(call
- target: (identifier) @attribute)
- (boolean) @attribute
- (nil) @attribute
+ target: (identifier) @variable.property)
+ (boolean) @variable.property
+ (nil) @variable.property
])
; * capture operand
@@ -69,10 +69,9 @@
; Literals
-[
- (boolean)
- (nil)
-] @constant
+(nil) @constant.builtin
+
+(boolean) @constant.builtin.boolean
[
(integer)
@@ -85,20 +84,20 @@
target: (dot
left: (atom) @type))
-(char) @constant
+(char) @constant.character
; Quoted content
-(interpolation "#{" @punctuation.special "}" @punctuation.special) @embedded
+(interpolation "#{" @escape "}" @escape) @embedded
-(escape_sequence) @string.escape
+(escape_sequence) @escape
[
(atom)
(quoted_atom)
(keyword)
(quoted_keyword)
-] @tag
+] @symbol
[
(string)
@@ -182,8 +181,8 @@
; * unused
(
- (identifier) @comment.unused
- (#match? @comment.unused "^_")
+ (identifier) @comment
+ (#match? @comment "^_")
)
; * regular