Variable: elixir-ts--font-lock-settings

elixir-ts--font-lock-settings is a variable defined in elixir-ts-mode.el.gz.

Value

((#<treesit-compiled-query> t elixir-definition nil)
 (#<treesit-compiled-query> t elixir-comment t)
 (#<treesit-compiled-query> t elixir-variable nil)
 (#<treesit-compiled-query> t elixir-doc nil)
 (#<treesit-compiled-query> t elixir-string nil)
 (#<treesit-compiled-query> t elixir-sigil nil)
 (#<treesit-compiled-query> t elixir-operator nil)
 (#<treesit-compiled-query> t elixir-data-type nil)
 (#<treesit-compiled-query> t elixir-keyword nil)
 (#<treesit-compiled-query> t elixir-function-call nil)
 (#<treesit-compiled-query> t elixir-string-escape t)
 (#<treesit-compiled-query> t elixir-number nil)
 (#<treesit-compiled-query> t elixir-variable nil)
 (#<treesit-compiled-query> t elixir-builtin t))

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
  (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.")