branch: elpa/cider
commit 2139682ba1234aa5d3cef5bb0f57802db8b2b8ad
Author: Roman Rudakov <rruda...@fastmail.com>
Commit: Bozhidar Batsov <bozhi...@batsov.dev>

    Enable dynamic indentation for clojure-ts-mode
---
 CHANGELOG.md  | 1 +
 cider-mode.el | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0f2167d38f..ee94a638ea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@
 - [#3789](https://github.com/clojure-emacs/cider/issues/3789): Refactor and 
simplify exception handling.
 - [#3789](https://github.com/clojure-emacs/cider/issues/3796): Completion: 
disable client-side sorting (defer to backend-provided candidate order).
 - [#3797](https://github.com/clojure-emacs/cider/issues/3797): Completion: 
enable `cider-completion-style` by default (this enables richer completion 
suggestions where candidates don't have to strictly match the prefix).
+- [#3803](https://github.com/clojure-emacs/cider/pull/3803): Enable dynamic 
indentation for `clojure-ts-mode`.
 
 ## 1.17.1 (2025-02-25)
 
diff --git a/cider-mode.el b/cider-mode.el
index 8e5af6c2d0..3aee2d142a 100644
--- a/cider-mode.el
+++ b/cider-mode.el
@@ -1094,7 +1094,10 @@ property."
         ;; `tooltip' has variable-width by default, which looks terrible.
         (set-face-attribute 'tooltip nil :inherit 'unspecified)
         (when cider-dynamic-indentation
-          (setq-local clojure-get-indent-function #'cider--get-symbol-indent))
+          (setq-local clojure-get-indent-function #'cider--get-symbol-indent)
+          (with-suppressed-warnings ((free-vars 
clojure-ts-get-indent-function))
+            (setq-local clojure-ts-get-indent-function
+                        #'cider--get-symbol-indent)))
         (setq-local clojure-expected-ns-function #'cider-expected-ns)
         (when cider-use-xref
           (add-hook 'xref-backend-functions #'cider--xref-backend 
cider-xref-fn-depth 'local))
@@ -1104,7 +1107,8 @@ property."
     (mapc #'kill-local-variable '(next-error-function
                                   x-gtk-use-system-tooltips
                                   font-lock-fontify-region-function
-                                  clojure-get-indent-function))
+                                  clojure-get-indent-function
+                                  clojure-ts-get-indent-function))
     (remove-hook 'completion-at-point-functions #'cider-complete-at-point t)
     (when cider-use-xref
       (remove-hook 'xref-backend-functions #'cider--xref-backend 'local))

Reply via email to