branch: master
commit df3f97ff3e9b05ab4bcda028a792a857390b116e
Author: Jackson Ray Hamilton <[email protected]>
Commit: Jackson Ray Hamilton <[email protected]>
Add js2-jsx-mode
---
js2-mode.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/js2-mode.el b/js2-mode.el
index 643e921..dd97aba 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -11373,6 +11373,17 @@ Selecting an error will jump it to the corresponding
source-buffer error.
(js2-reparse))
+;; We may eventually want js2-jsx-mode to derive from js-jsx-mode, but that'd
be
+;; a bit more complicated and it doesn't net us much yet.
+;;;###autoload
+(define-derived-mode js2-jsx-mode js2-mode "JSX-IDE"
+ "Major mode for editing JSX code.
+Like `js-jsx-mode', which see.
+Indentation support requires Emacs 25+ (or the latest js.el)."
+ ;; Feature-detect JSX indentation support (in js-mode from Emacs 25+).
+ (if (fboundp 'js-jsx-indent-line)
+ (set (make-local-variable 'indent-line-function) #'js-jsx-indent-line)))
+
(defun js2-mode-exit ()
"Exit `js2-mode' and clean up."
(interactive)