Use indent-according-to-mode in cider-maybe-insert-multiline-comment#3925
Merged
Conversation
`clojure-indent-line' was the only direct indent-function call in cider tied to a specific major mode. Replacing it with `indent-according-to-mode' dispatches via the active mode's `indent-line-function', so the call works identically in `clojure-mode' (the function happens to be `clojure-indent-line') and in `clojure-ts-mode' (where it's the tree-sitter-driven `clojure-ts-indent-line'), without cider having to know which mode is active.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
clojure-indent-linewas the only direct indent-function call in cider tied to a specific major mode. Replacing it withindent-according-to-modedispatches via the active mode'sindent-line-function, so the call works identically inclojure-mode(where it lands onclojure-indent-line) and inclojure-ts-mode(where it's the tree-sitter-drivenclojure-ts-indent-line), without cider having to know which mode is active.One-line change. Continues the small decoupling sweep from PRs #3922 and #3924.