Variable: elixir-ts--font-lock-settings
elixir-ts--font-lock-settings is a variable defined in
elixir-ts-mode.el.gz.
Value
Large value
((((call target: (identifier) @target-identifier
(arguments
(call target: (identifier) @font-lock-function-name-face
(arguments)))
(:match
"^\\(?:de\\(?:f\\(?:delegate\\|exception\\|guardp?\\|impl\\|m\\(?:acrop?\\|odule\\)\\|np\\|overridable\\|protocol\\|struct\\|[np]\\)?\\|scribe\\)\\|test\\)$"
@target-identifier))
(call target: (identifier) @target-identifier
(arguments (identifier) @font-lock-function-name-face)
(:match
"^\\(?:de\\(?:f\\(?:delegate\\|exception\\|guardp?\\|impl\\|m\\(?:acrop?\\|odule\\)\\|np\\|overridable\\|protocol\\|struct\\|[np]\\)?\\|scribe\\)\\|test\\)$"
@target-identifier))
(call target: (identifier) @target-identifier
(arguments
(call target: (identifier) @font-lock-function-name-face
(arguments ((identifier))
@font-lock-variable-name-face)))
(:match
"^\\(?:de\\(?:f\\(?:delegate\\|exception\\|guardp?\\|impl\\|m\\(?:acrop?\\|odule\\)\\|np\\|overridable\\|protocol\\|struct\\|[np]\\)?\\|scribe\\)\\|test\\)$"
@target-identifier))
(call target: (identifier) @target-identifier
(arguments
(binary_operator left:
(call target: (identifier)
@font-lock-function-name-face)))
(:match
"^\\(?:de\\(?:f\\(?:delegate\\|exception\\|guardp?\\|impl\\|m\\(?:acrop?\\|odule\\)\\|np\\|overridable\\|protocol\\|struct\\|[np]\\)?\\|scribe\\)\\|test\\)$"
@target-identifier))
(call target: (identifier) @target-identifier
(arguments (identifier) @font-lock-function-name-face)
(do_block)
(:match
"^\\(?:de\\(?:f\\(?:delegate\\|exception\\|guardp?\\|impl\\|m\\(?:acrop?\\|odule\\)\\|np\\|overridable\\|protocol\\|struct\\|[np]\\)?\\|scribe\\)\\|test\\)$"
@target-identifier))
(call target: (identifier) @target-identifier
(arguments
(call target: (identifier) @font-lock-function-name-face
(arguments ((identifier))
@font-lock-variable-name-face)))
(do_block)
(:match
"^\\(?:de\\(?:f\\(?:delegate\\|exception\\|guardp?\\|impl\\|m\\(?:acrop?\\|odule\\)\\|np\\|overridable\\|protocol\\|struct\\|[np]\\)?\\|scribe\\)\\|test\\)$"
@target-identifier))
(call target: (identifier) @target-identifier
(arguments
(binary_operator left:
(call target: (identifier)
@font-lock-function-name-face
(arguments ((identifier))
@font-lock-variable-name-face))))
(do_block)
(:match
"^\\(?:de\\(?:f\\(?:delegate\\|exception\\|guardp?\\|impl\\|m\\(?:acrop?\\|odule\\)\\|np\\|overridable\\|protocol\\|struct\\|[np]\\)?\\|scribe\\)\\|test\\)$"
@target-identifier))
(unary_operator operator: "@"
(call
(arguments
(binary_operator left:
(call target: (identifier)
@font-lock-function-name-face))))))
t elixir-definition nil nil elixir)
(((comment) @font-lock-comment-face
((identifier) @font-lock-comment-face
(:match "^_[a-z]\\|^_$" @font-lock-comment-face)))
t elixir-comment t nil elixir)
(((call target: (identifier)
(arguments
(binary_operator
(call target: (identifier)
(arguments
((identifier) @font-lock-variable-use-face))))))
(call target: (identifier)
(arguments
(call target: (identifier)
(arguments ((identifier)) @font-lock-variable-use-face))))
(dot left: (identifier) @font-lock-variable-use-face operator: "."))
t elixir-variable nil nil elixir)
(((unary_operator operator: "@" @elixir-ts-comment-doc-attribute
operand:
(call target: (identifier)
@elixir-ts-comment-doc-identifier
(arguments
[(string) @font-lock-doc-face (charlist)
@font-lock-doc-face (sigil)
@font-lock-doc-face (boolean)
@font-lock-doc-face (keywords)
@font-lock-doc-face]))
(:match
"^\\(?:\\(?:\\(?:modul\\|typ\\)e\\)?doc\\)$"
@elixir-ts-comment-doc-identifier))
(unary_operator operator: "@" @elixir-ts-comment-doc-attribute
operand:
(call target: (identifier)
@elixir-ts-comment-doc-identifier)
(:match
"^\\(?:\\(?:\\(?:modul\\|typ\\)e\\)?doc\\)$"
@elixir-ts-comment-doc-identifier)))
t elixir-doc nil nil elixir)
(((interpolation "#{" @font-lock-escape-face "}"
@font-lock-escape-face)
(string (quoted_content) @font-lock-string-face)
(quoted_keyword (quoted_content) @font-lock-string-face)
(charlist (quoted_content) @font-lock-string-face)
["\"" "'" "\"\"\""] @font-lock-string-face)
t elixir-string nil nil elixir)
(((sigil (sigil_name) @elixir-ts-sigil-name (quoted_content)
@font-lock-string-face
(:match "^[^HF]$" @elixir-ts-sigil-name))
@font-lock-string-face
(sigil (sigil_name) @font-lock-regexp-face
(:match "^[rR]$" @font-lock-regexp-face))
@font-lock-regexp-face
(sigil "~" @font-lock-string-face (sigil_name)
@font-lock-string-face quoted_start: _
@font-lock-string-face quoted_end: _ @font-lock-string-face))
t elixir-sigil nil nil elixir)
((["!"] @font-lock-negation-char-face ["%"] @font-lock-bracket-face
["," ";"] @font-lock-operator-face
["(" ")" "[" "]" "{" "}" "<<" ">>"] @font-lock-bracket-face)
t elixir-operator nil nil elixir)
(((alias) @font-lock-type-face (atom) @elixir-ts-atom
(keywords (pair key: (keyword) @elixir-ts-keyword-key))
[(keyword) (quoted_keyword)] @elixir-ts-atom [(boolean) (nil)]
@elixir-ts-atom
(unary_operator operator: "@" @elixir-ts-attribute operand:
[(identifier) @elixir-ts-attribute
(call target: (identifier) @elixir-ts-attribute)
(boolean) @elixir-ts-attribute (nil)
@elixir-ts-attribute])
(operator_identifier) @font-lock-operator-face)
t elixir-data-type nil nil elixir)
((["when" "and" "or" "not" "in" "not in" "fn" "do" "end" "catch"
"rescue" "after" "else"]
@font-lock-keyword-face
(binary_operator operator: _ @font-lock-keyword-face
(:match
"^\\(?:a\\(?:fter\\|nd\\)\\|catch\\|do\\|e\\(?:lse\\|nd\\)\\|fn\\|in\\|not\\(?: in\\)?\\|or\\|rescue\\|when\\)$"
@font-lock-keyword-face))
(binary_operator operator: _ @font-lock-operator-face)
(call target: (identifier) @font-lock-keyword-face
(:match
"^\\(?:de\\(?:f\\(?:delegate\\|exception\\|guardp?\\|impl\\|m\\(?:acrop?\\|odule\\)\\|np\\|overridable\\|protocol\\|struct\\|[np]\\)?\\|scribe\\)\\|test\\)$"
@font-lock-keyword-face))
(call target: (identifier) @font-lock-keyword-face
(:match
"^\\(?:alias\\|c\\(?:ase\\|ond\\)\\|else\\|for\\|i\\(?:f\\|mport\\)\\|quote\\|r\\(?:\\(?:ais\\|e\\(?:ceiv\\|quir\\|rais\\)\\)e\\)\\|super\\|t\\(?:hrow\\|ry\\)\\|u\\(?:n\\(?:less\\|quote\\(?:_splicing\\)?\\)\\|se\\)\\|with\\)$"
@font-lock-keyword-face)))
t elixir-keyword nil nil elixir)
(((call target: (identifier) @font-lock-function-call-face)
(unary_operator operator: "&" @font-lock-operator-face operand:
(binary_operator left: (identifier)
@font-lock-function-call-face
operator: "/" right: (integer)))
(call target:
(dot right: (identifier) @font-lock-function-call-face))
(unary_operator operator: "&" @font-lock-variable-use-face operand:
(integer) @font-lock-variable-use-face)
(unary_operator operator: "&" @font-lock-operator-face operand:
(list)))
t elixir-function-call nil nil elixir)
(((escape_sequence) @font-lock-escape-face) t elixir-string-escape t
nil elixir)
(([(integer) (float)] @font-lock-number-face) t elixir-number nil nil
elixir)
(((binary_operator left: (identifier) @font-lock-variable-use-face)
(binary_operator right: (identifier) @font-lock-variable-use-face)
(arguments ((identifier) @font-lock-variable-use-face))
(tuple (identifier) @font-lock-variable-use-face)
(list (identifier) @font-lock-variable-use-face)
(pair value: (identifier) @font-lock-variable-use-face)
(body (identifier) @font-lock-variable-use-face)
(unary_operator operand: (identifier) @font-lock-variable-use-face)
(interpolation (identifier) @font-lock-variable-use-face)
(do_block (identifier) @font-lock-variable-use-face)
(rescue_block (identifier) @font-lock-variable-use-face)
(catch_block (identifier) @font-lock-variable-use-face)
(else_block (identifier) @font-lock-variable-use-face)
(after_block (identifier) @font-lock-variable-use-face)
(access_call target: (identifier) @font-lock-variable-use-face)
(access_call "[" key: (identifier) @font-lock-variable-use-face "]"))
t elixir-variable nil nil elixir)
((((identifier) @font-lock-builtin-face
(:match
"^\\(?:__\\(?:\\(?:CALLER\\|DIR\\|ENV\\|\\(?:MODUL\\|STACKTRAC\\)E\\)__\\)\\)$"
@font-lock-builtin-face)))
t elixir-builtin t nil elixir))
Documentation
Tree-sitter font-lock settings.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/elixir-ts-mode.el.gz
(defvar elixir-ts--font-lock-settings
(when (treesit-available-p)
(treesit-font-lock-rules
:language 'elixir
:feature 'elixir-definition
`((call target: (identifier) @target-identifier
(arguments
(call target: (identifier) @font-lock-function-name-face
(arguments)))
(:match ,elixir-ts--definition-keywords-re @target-identifier))
(call target: (identifier) @target-identifier
(arguments (identifier) @font-lock-function-name-face)
(:match ,elixir-ts--definition-keywords-re @target-identifier))
(call target: (identifier) @target-identifier
(arguments
(call target: (identifier) @font-lock-function-name-face
(arguments ((identifier)) @font-lock-variable-name-face)))
(:match ,elixir-ts--definition-keywords-re @target-identifier))
(call target: (identifier) @target-identifier
(arguments
(binary_operator
left: (call target: (identifier) @font-lock-function-name-face)))
(:match ,elixir-ts--definition-keywords-re @target-identifier))
(call target: (identifier) @target-identifier
(arguments (identifier) @font-lock-function-name-face)
(do_block)
(:match ,elixir-ts--definition-keywords-re @target-identifier))
(call target: (identifier) @target-identifier
(arguments
(call target: (identifier) @font-lock-function-name-face
(arguments ((identifier)) @font-lock-variable-name-face)))
(do_block)
(:match ,elixir-ts--definition-keywords-re @target-identifier))
(call target: (identifier) @target-identifier
(arguments
(binary_operator
left: (call target: (identifier) @font-lock-function-name-face
(arguments ((identifier)) @font-lock-variable-name-face))))
(do_block)
(:match ,elixir-ts--definition-keywords-re @target-identifier))
(unary_operator
operator: "@"
(call (arguments
(binary_operator
left: (call target: (identifier) @font-lock-function-name-face))))))
:language 'elixir
:feature 'elixir-comment
:override t
'((comment) @font-lock-comment-face
((identifier) @font-lock-comment-face
(:match "^_[a-z]\\|^_$" @font-lock-comment-face)))
:language 'elixir
:feature 'elixir-variable
`((call target: (identifier)
(arguments
(binary_operator
(call target: (identifier)
(arguments ((identifier) @font-lock-variable-use-face))))))
(call target: (identifier)
(arguments
(call target: (identifier)
(arguments ((identifier)) @font-lock-variable-use-face))))
(dot left: (identifier) @font-lock-variable-use-face operator: "." ))
:language 'elixir
:feature 'elixir-doc
`((unary_operator
operator: "@" @elixir-ts-comment-doc-attribute
operand: (call
target: (identifier) @elixir-ts-comment-doc-identifier
;; Arguments can be optional, so adding another
;; entry without arguments.
;; If we don't handle then we don't apply font
;; and the non doc fortification query will take specify
;; a more specific font which takes precedence.
(arguments
[
(string) @font-lock-doc-face
(charlist) @font-lock-doc-face
(sigil) @font-lock-doc-face
(boolean) @font-lock-doc-face
(keywords) @font-lock-doc-face
]))
(:match ,elixir-ts--doc-keywords-re
@elixir-ts-comment-doc-identifier))
(unary_operator
operator: "@" @elixir-ts-comment-doc-attribute
operand: (call
target: (identifier) @elixir-ts-comment-doc-identifier)
(:match ,elixir-ts--doc-keywords-re
@elixir-ts-comment-doc-identifier)))
:language 'elixir
:feature 'elixir-string
'((interpolation
"#{" @font-lock-escape-face
"}" @font-lock-escape-face)
(string (quoted_content) @font-lock-string-face)
(quoted_keyword (quoted_content) @font-lock-string-face)
(charlist (quoted_content) @font-lock-string-face)
["\"" "'" "\"\"\""] @font-lock-string-face)
:language 'elixir
:feature 'elixir-sigil
`((sigil
(sigil_name) @elixir-ts-sigil-name
(quoted_content) @font-lock-string-face
;; HEEx and Surface templates will handled by
;; heex-ts-mode if its available.
(:match "^[^HF]$" @elixir-ts-sigil-name))
@font-lock-string-face
(sigil
(sigil_name) @font-lock-regexp-face
(:match "^[rR]$" @font-lock-regexp-face))
@font-lock-regexp-face
(sigil
"~" @font-lock-string-face
(sigil_name) @font-lock-string-face
quoted_start: _ @font-lock-string-face
quoted_end: _ @font-lock-string-face))
:language 'elixir
:feature 'elixir-operator
`(["!"] @font-lock-negation-char-face
["%"] @font-lock-bracket-face
["," ";"] @font-lock-operator-face
["(" ")" "[" "]" "{" "}" "<<" ">>"] @font-lock-bracket-face)
:language 'elixir
:feature 'elixir-data-type
'((alias) @font-lock-type-face
(atom) @elixir-ts-atom
(keywords (pair key: (keyword) @elixir-ts-keyword-key))
[(keyword) (quoted_keyword)] @elixir-ts-atom
[(boolean) (nil)] @elixir-ts-atom
(unary_operator operator: "@" @elixir-ts-attribute
operand: [
(identifier) @elixir-ts-attribute
(call target: (identifier)
@elixir-ts-attribute)
(boolean) @elixir-ts-attribute
(nil) @elixir-ts-attribute
])
(operator_identifier) @font-lock-operator-face)
:language 'elixir
:feature 'elixir-keyword
`(,elixir-ts--reserved-keywords-vector
@font-lock-keyword-face
(binary_operator
operator: _ @font-lock-keyword-face
(:match ,elixir-ts--reserved-keywords-re @font-lock-keyword-face))
(binary_operator operator: _ @font-lock-operator-face)
(call
target: (identifier) @font-lock-keyword-face
(:match ,elixir-ts--definition-keywords-re @font-lock-keyword-face))
(call
target: (identifier) @font-lock-keyword-face
(:match ,elixir-ts--kernel-keywords-re @font-lock-keyword-face)))
:language 'elixir
:feature 'elixir-function-call
'((call target: (identifier) @font-lock-function-call-face)
(unary_operator operator: "&" @font-lock-operator-face
operand: (binary_operator
left: (identifier)
@font-lock-function-call-face
operator: "/" right: (integer)))
(call
target: (dot right: (identifier) @font-lock-function-call-face))
(unary_operator operator: "&" @font-lock-variable-use-face
operand: (integer) @font-lock-variable-use-face)
(unary_operator operator: "&" @font-lock-operator-face
operand: (list)))
:language 'elixir
:feature 'elixir-string-escape
:override t
`((escape_sequence) @font-lock-escape-face)
:language 'elixir
:feature 'elixir-number
'([(integer) (float)] @font-lock-number-face)
:language 'elixir
:feature 'elixir-variable
'((binary_operator left: (identifier) @font-lock-variable-use-face)
(binary_operator right: (identifier) @font-lock-variable-use-face)
(arguments ( (identifier) @font-lock-variable-use-face))
(tuple (identifier) @font-lock-variable-use-face)
(list (identifier) @font-lock-variable-use-face)
(pair value: (identifier) @font-lock-variable-use-face)
(body (identifier) @font-lock-variable-use-face)
(unary_operator operand: (identifier) @font-lock-variable-use-face)
(interpolation (identifier) @font-lock-variable-use-face)
(do_block (identifier) @font-lock-variable-use-face)
(rescue_block (identifier) @font-lock-variable-use-face)
(catch_block (identifier) @font-lock-variable-use-face)
(else_block (identifier) @font-lock-variable-use-face)
(after_block (identifier) @font-lock-variable-use-face)
(access_call target: (identifier) @font-lock-variable-use-face)
(access_call "[" key: (identifier) @font-lock-variable-use-face "]"))
:language 'elixir
:feature 'elixir-builtin
:override t
`(((identifier) @font-lock-builtin-face
(:match ,elixir-ts--builtin-keywords-re
@font-lock-builtin-face)))))
"Tree-sitter font-lock settings.")