summaryrefslogtreecommitdiff
path: root/lisp/progmodes/js.el
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2023-01-17 06:30:08 +0100
committerStefan Kangas <stefankangas@gmail.com>2023-01-17 06:30:08 +0100
commitbb383a54910c3094e5d228e0af62bf70e36203ca (patch)
tree683a44f031ce95559399b4d461f9d1015514051a /lisp/progmodes/js.el
parent0bb8a011d57cb55c16ff502125b60e8e3bb3d5aa (diff)
parente8c77d9abda9c5c48de546a4ff667ffdf3d27c94 (diff)
downloademacs-bb383a54910c3094e5d228e0af62bf70e36203ca.tar.gz
Merge from origin/emacs-29
e8c77d9abda Fix hfy-exclude-file-rules (bug#60562) c1d32d9a20d CC Mode: Prevent ids in temporary "declarators" getting i... 140824dc099 ; Fix more quoting in w32fns.c. f367ba3ed03 ; Avoid byte-compiler warning in eglot.el 1b458aced72 ; * lisp/progmodes/eglot.el: Remove stray space. 7c8eac8fbcb ; * src/w32fns.c: Fix quoting. Patch by Arash Esbati <ar... 67df34c143d Fix M-x eglot prompt when connection already exists (bug#... 3d1e74c82a8 Fix tree-sitter indent preset function (bug#60270) 352e41016bc ruby-ts-mode: Support the option ruby-block-indent 44c9cb8653d Improve indentation for jsx 82ae9caaddb * lisp/subr.el (while-let): Fix docs if-let->if-let* (bug... f16bd1ead43 Revert "* lisp/subr.el (while-let): Use if-let, not if-le... c8d54809727 Bump use-package version for Emacs 29.1
Diffstat (limited to 'lisp/progmodes/js.el')
-rw-r--r--lisp/progmodes/js.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index fa3b4687ef2..28305a0b39b 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3454,13 +3454,16 @@ This function is intended for use in `after-change-functions'."
((parent-is "statement_block") parent-bol js-indent-level)
;; JSX
- ((node-is "jsx_fragment") parent typescript-ts-mode-indent-offset)
- ((node-is "jsx_element") parent typescript-ts-mode-indent-offset)
- ((node-is "jsx_expression") parent typescript-ts-mode-indent-offset)
- ((node-is "jsx_self_closing_element") parent typescript-ts-mode-indent-offset)
+ ((match "<" "jsx_fragment") parent 0)
+ ((parent-is "jsx_fragment") parent js-indent-level)
((node-is "jsx_closing_element") parent 0)
- ((node-is "/") parent 0)
- ((node-is ">") parent 0)))))
+ ((node-is "jsx_element") parent js-indent-level)
+ ((parent-is "jsx_element") parent js-indent-level)
+ ((parent-is "jsx_opening_element") parent js-indent-level)
+ ((parent-is "jsx_expression") parent-bol js-indent-level)
+ ((match "/" "jsx_self_closing_element") parent 0)
+ ((parent-is "jsx_self_closing_element") parent js-indent-level)
+ (no-node parent-bol 0)))))
(defvar js--treesit-keywords
'("as" "async" "await" "break" "case" "catch" "class" "const" "continue"