Drop clojure-expected-ns delegation from cider-expected-ns#3924
Merged
Conversation
Inline the path-based namespace derivation that was previously delegated to `clojure-expected-ns'. The new internal helper `cider--ns-from-path' uses `cider-project-dir' to find the project root, then applies the same drop-first-dir + path-to-ns + strip-known-prefixes algorithm clojure-mode uses (with prefixes now owned by cider via `cider-directory-prefixes'). Behavior is unchanged for files on the classpath (still preferred) and for files in a recognized project layout. Tests rewritten to assert the new behavior directly instead of the old "delegates to clojure-expected-ns" coupling.
335be71 to
6537c50
Compare
Elisp's `foo'` quoting renders correctly in `M-x describe-*` output but GitHub displays it literally. Switching the CHANGELOG entries I introduced over recent PRs to plain Markdown backticks so they render properly in the release notes view. Cosmetic only.
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.
Step 2 of the decoupling sweep. Inline the path-based namespace derivation that was previously delegated to
clojure-expected-ns.The classpath-based path is preferred (and unchanged); it already used
cider-path-to-nsand didn't touchclojure-expected-ns. The fallback now uses a small internal helpercider--ns-from-paththat:cider-project-dir(from PR Use project.el directly for project root detection #3922),cider-path-to-nsto swap/and_,cider-directory-prefixesdefcustom (mirrorsclojure-directory-prefixes).Same algorithm
clojure-expected-nsuses today, owned by cider so we don't reach into clojure-mode for it.Tests rewritten. The old ones asserted the coupling itself (
(cider-expected-ns ...) :to-equal (clojure-expected-ns ...)); the new ones assert the actual behavior we want, using acider-project-dirstub for the fallback path.