align highlight scopes with documented scopes

imgbot
Michael Davis 3 years ago
parent c502cafecc
commit 4771cc7ee4
No known key found for this signature in database
GPG Key ID: 25D3AFE4BA2A0C49

@ -120,6 +120,8 @@ We use a similar set of scopes as
- `path` - `path`
- `url` - `url`
- `symbol` - Elixir atoms, Ruby symbols, Clojure keywords
- `comment` - Code comments - `comment` - Code comments
- `line` - Single line comments (`//`) - `line` - Single line comments (`//`)
- `block` - Block comments (e.g. (`/* */`) - `block` - Block comments (e.g. (`/* */`)

@ -23,29 +23,29 @@
; * doc string ; * doc string
(unary_operator (unary_operator
operator: "@" @comment.doc operator: "@" @comment.block.documentation
operand: (call operand: (call
target: (identifier) @comment.doc.__attribute__ target: (identifier) @comment.block.documentation.__attribute__
(arguments (arguments
[ [
(string) @comment.doc (string) @comment.block.documentation
(charlist) @comment.doc (charlist) @comment.block.documentation
(sigil (sigil
quoted_start: _ @comment.doc quoted_start: _ @comment.block.documentation
quoted_end: _ @comment.doc) @comment.doc quoted_end: _ @comment.block.documentation) @comment.block.documentation
(boolean) @comment.doc (boolean) @comment.block.documentation
])) ]))
(#match? @comment.doc.__attribute__ "^(moduledoc|typedoc|doc)$")) (#match? @comment.block.documentation.__attribute__ "^(moduledoc|typedoc|doc)$"))
; * module attribute ; * module attribute
(unary_operator (unary_operator
operator: "@" @attribute operator: "@" @variable.property
operand: [ operand: [
(identifier) @attribute (identifier) @variable.property
(call (call
target: (identifier) @attribute) target: (identifier) @variable.property)
(boolean) @attribute (boolean) @variable.property
(nil) @attribute (nil) @variable.property
]) ])
; * capture operand ; * capture operand
@ -69,10 +69,9 @@
; Literals ; Literals
[ (nil) @constant.builtin
(boolean)
(nil) (boolean) @constant.builtin.boolean
] @constant
[ [
(integer) (integer)
@ -85,20 +84,20 @@
target: (dot target: (dot
left: (atom) @type)) left: (atom) @type))
(char) @constant (char) @constant.character
; Quoted content ; Quoted content
(interpolation "#{" @punctuation.special "}" @punctuation.special) @embedded (interpolation "#{" @escape "}" @escape) @embedded
(escape_sequence) @string.escape (escape_sequence) @escape
[ [
(atom) (atom)
(quoted_atom) (quoted_atom)
(keyword) (keyword)
(quoted_keyword) (quoted_keyword)
] @tag ] @symbol
[ [
(string) (string)
@ -182,8 +181,8 @@
; * unused ; * unused
( (
(identifier) @comment.unused (identifier) @comment
(#match? @comment.unused "^_") (#match? @comment "^_")
) )
; * regular ; * regular

Loading…
Cancel
Save