Function: js-jsx--treesit-indent-compatibility-bb1f97b

js-jsx--treesit-indent-compatibility-bb1f97b is a byte-compiled function defined in js.el.gz.

Signature

(js-jsx--treesit-indent-compatibility-bb1f97b)

Documentation

Indent rules helper, to handle different releases of tree-sitter-javascript.

Check if a node type is available, then return the right indent rules.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/js.el.gz
(defun js-jsx--treesit-indent-compatibility-bb1f97b ()
  "Indent rules helper, to handle different releases of tree-sitter-javascript.
Check if a node type is available, then return the right indent rules."
  ;; handle commit bb1f97b
  (condition-case nil
      (progn (treesit-query-capture 'javascript '((jsx_fragment) @capture))
             `(((match "<" "jsx_fragment") parent 0)
               ((parent-is "jsx_fragment") parent js-indent-level)))
    (error
     `(((match "<" "jsx_text") parent 0)
       ((parent-is "jsx_text") parent js-indent-level)))))