Variable: elixir-ts-mode-abbrev-table

elixir-ts-mode-abbrev-table is a variable defined in elixir-ts-mode.el.gz.

Value

#<obarray n=1>

Documentation

Abbrev table for elixir-ts-mode.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/elixir-ts-mode.el.gz
;;;###autoload
(define-derived-mode elixir-ts-mode prog-mode "Elixir"
  "Major mode for editing Elixir, powered by tree-sitter."
  :group 'elixir-ts
  :syntax-table elixir-ts--syntax-table

  ;; Comments.
  (setq-local comment-start "# ")
  (setq-local comment-start-skip
              (rx "#" (* (syntax whitespace))))

  (setq-local comment-end "")
  (setq-local comment-end-skip
              (rx (* (syntax whitespace))
                  (group (or (syntax comment-end) "\n"))))

  ;; Compile.
  (setq-local compile-command "mix")

  ;; Electric pair.
  (add-hook 'post-self-insert-hook
            #'elixir-ts--electric-pair-string-delimiter 'append t)

  (when (treesit-ready-p 'elixir)
    ;; The HEEx parser has to be created first for elixir to ensure elixir
    ;; is the first language when looking for treesit ranges.
    (when (treesit-ready-p 'heex)
      ;; Require heex-ts-mode only when we load elixir-ts-mode
      ;; so that we don't get a tree-sitter compilation warning for
      ;; elixir-ts-mode.
      (require 'heex-ts-mode)
      (treesit-parser-create 'heex))

    (setq-local treesit-primary-parser
                (treesit-parser-create 'elixir))

    (setq-local treesit-language-at-point-function
                'elixir-ts--treesit-language-at-point)

    ;; Font-lock.
    (setq-local treesit-font-lock-settings elixir-ts--font-lock-settings)
    (setq-local treesit-font-lock-feature-list
                '(( elixir-comment elixir-doc elixir-definition)
                  ( elixir-string elixir-keyword elixir-data-type)
                  ( elixir-sigil elixir-builtin elixir-string-escape)
                  ( elixir-function-call elixir-variable elixir-operator elixir-number )))


    ;; Imenu.
    (setq-local treesit-simple-imenu-settings
                '((nil "\\`call\\'" elixir-ts--defun-p nil)))

    ;; Indent.
    (setq-local treesit-simple-indent-rules elixir-ts--indent-rules)

    ;; Navigation.
    (setq-local forward-sexp-function #'elixir-ts--forward-sexp)
    (setq-local treesit-defun-type-regexp
                '("call" . elixir-ts--defun-p))

    (setq-local treesit-defun-name-function #'elixir-ts--defun-name)

    ;; Embedded Heex.
    (when (treesit-ready-p 'heex)
      (setq-local treesit-range-settings elixir-ts--treesit-range-rules)

      (setq-local treesit-font-lock-settings
                  (append treesit-font-lock-settings
                          heex-ts--font-lock-settings))

      (setq-local treesit-simple-indent-rules
                  (append treesit-simple-indent-rules
                          heex-ts--indent-rules))

      (setq-local treesit-font-lock-feature-list
                  '(( elixir-comment elixir-doc elixir-definition
                      heex-comment heex-keyword heex-doctype )
                    ( elixir-string elixir-keyword elixir-data-type
                      heex-component heex-tag heex-attribute heex-string )
                    ( elixir-sigil elixir-builtin elixir-string-escape)
                    ( elixir-function-call elixir-variable elixir-operator elixir-number ))))

    (treesit-major-mode-setup)
    (setq-local syntax-propertize-function #'elixir-ts--syntax-propertize)))