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-ensure-installed 'elixir)
    (setq-local treesit-primary-parser
                (treesit-parser-create 'elixir))

    ;; Font-lock.
    (setq-local treesit-font-lock-settings elixir-ts--font-lock-settings)
    (setq-local treesit-font-lock-feature-list
                elixir-ts--font-lock-feature-list)

    ;; 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 treesit-thing-settings
                `((elixir ,@elixir-ts--thing-settings)))
    (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-ensure-installed 'heex)
      (require 'heex-ts-mode)
      (treesit-parser-create 'heex)

      (setq-local treesit-range-settings
                  (append elixir-ts--range-rules
                          ;; Leave only local parsers from heex
                          ;; for elixir->heex->elixir embedding.
                          (seq-filter (lambda (r) (nth 2 r))
                                      heex-ts--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
                  (treesit-merge-font-lock-feature-list
                   treesit-font-lock-feature-list
                   heex-ts--font-lock-feature-list))

      (setq-local treesit-thing-settings
                  (append treesit-thing-settings
                          `((heex ,@heex-ts--thing-settings)))))

    (treesit-major-mode-setup)

    (setq-local syntax-propertize-function #'elixir-ts--syntax-propertize)

    ;; Enable the 'sexp' navigation by default
    (setq-local forward-sexp-function #'treesit-forward-sexp
                treesit-sexp-thing 'sexp
                ;; But still use 'list' for `down-list' and `up-list'
                treesit-sexp-thing-down-list 'list
                treesit-sexp-thing-up-list 'list
                hs-treesit-things '(or defun sexp))))