Skip to content

Customizable jump between test-/impl ns #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Customizable jump between test-/impl ns #196

wants to merge 1 commit into from

Conversation

instilled
Copy link

Hello,

This pull request is to address the issue of non-configurable src and test directory paths in clojure-mode and clojure-test-mode, that is, the path components used by the functions clojure-test-for-fn and clojure-test-implementation-for. These are used to resolve a source to its corresponding test ns and vice-versa.

Leiningen does support customization of clojure src and test directories in project.clj and thus should clojure-mode.

Because I've been working on a project that was organized 'the maven way' I was lacking the functionality of configurable src and test directories in clojure-mode above.

Thought: Alternatively source and test directory location could be extracted from project.clj. I strongly advise against it though, because clojure-mode would then depend on Leiningen enabled projects and would not work for, e.g. mavenized projects.

Cheers,
Fabio

@technomancy
Copy link
Contributor

I actually completely regret including test toggling functionality in clojure-mode; in retrospect it was a mistake. Toggling between tests and implementation has nothing to do with Clojure; this functionality is provided by a couple separate libraries that do a much better job of it and focus on doing one thing well. We probably can't remove this functionality any time soon, but I suggest using one of those of those other libraries instead.

@instilled
Copy link
Author

I agree with your reasoning. May I then suggest to announce the removal or point people to alternatives? In the README maybe? If prelude [1] would ship with a replacement I think the process could be accelerated considerably
BTW. What libraries have you had in mind, e.g. [2]?

[1] https://github.com/bbatsov/prelude/
[2] https://github.com/rags/toggle-test

@technomancy
Copy link
Contributor

The one I'm more familiar with is http://www.emacswiki.org/emacs/toggle.el, but that's older and predates Marmalade, so it hasn't seen a proper release. The one you linked to looks good too, although it's also missing from Marmalade for some reason.

I would like to add an obsolete declaration and warning to the existing toggle commands with links to suggested replacements, but I'm hesitant to do so before they have been properly released.

@instilled
Copy link
Author

I realized that projectile [1] has support for toggleling between impl and test but it does not work properly. Well, I can tell only for clojury/lein directory structures.
I'll investigate which lib is currently the best and check what I can do so it is pushed to marmalade or melpa.

[1] https://github.com/bbatsov/projectile

@bbatsov
Copy link
Member

bbatsov commented Dec 2, 2013

@technomancy +1 for removing it from clojure-mode. I'd suggest we simply suggest the use of projectile instead for that particular task, as it has pretty good support for lein projects.

@instilled By saying projectile does not work correctly I guess you mean it supports only lein projects, right?

@instilled
Copy link
Author

@bbatsov Indeed, it does support only standard lein projects but fails on others (non standard lein too) - I wasn't very clear in my previous post. I'll check in projectile why it fails with my current setup later this week and will try to fix it. Do you want me to open an issue in projectile for that?

technomancy added a commit that referenced this pull request Dec 27, 2013
Functionality for jumping between tests and implementation is obsolete as per #196.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants