Repository navigation
Fix the offline ns sort doing nothing in clojure-ts-mode - #603
Merged
Merged
Conversation
clojure-ts-mode installs a tree-sitter forward-sexp-function, which turns clojure-sort-ns's syntax-table-based walk into a silent no-op: cljr-clean-ns without a REPL reported success while leaving the ns form untouched (same for cljr-auto-sort-ns). Force the default sexp movement around the sort. The proper fix belongs in clojure-sort-ns itself; this shields our two call sites until that lands.
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.
In a clojure-ts-mode buffer the offline ns-form sort (
cljr-clean-nswithout a REPL, andcljr-auto-sort-ns) reported success while changing nothing: clojure-ts-mode's tree-sitterforward-sexp-functionsilently breaksclojure-sort-ns's syntax-table-based walk. Force the default sexp movement around the sort - the same idiom clojure-mode uses internally inclojure-forward-logical-sexp. The proper fix probably belongs inclojure-sort-nsitself; this shields our call sites until that lands.Verified in a live clojure-ts-mode buffer (with the grammar installed); the test simulates the hostile
forward-sexp-functionsince CI has no tree-sitter grammars.make compile)make test)