-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Feature request: Jump back and forth between Clojure source and its test #1168
Comments
Thanks! There is some prior art in Calva as well, in the way the |
Output window jump is great. Thank you PEZ! For those looking for the command name: {
"key": "ctrl+alt+c o",
"command": "calva.showOutputWindow",
"when": "calva:connected && calva:connected && calva:keybindingsEnabled && !calva:outputWindowActive"
},
{
"key": "ctrl+alt+c o",
"command": "calva.showFileForOutputWindowNS",
"when": "calva:connected && calva:connected && calva:keybindingsEnabled && calva:outputWindowActive"
}, |
@PEZ @bpringe I'd like to work on this feature if it's not yet assigned. I looked at this module of Elixir test repo that @rudolfvesely mentioned and I can implement similar thing for Calva unless you guys have some other ideas. |
@pratik97 please do! And please holler or way in the calva channel over at the Clojurians slack. |
Just moving this info from Slack: if we make the way this feature calculates/finds test namespaces account for more possibilities than just the test namespace being the same plus Line 123 in 210e816
@seancorfield mentioned that there are different conventions used for test namespace and file organization:
We should probably either add settings like this, or implement this in such a way that it accounts for a majority of cases. |
Maybe this goes without saying, but I think we should keep this implementation as simple as possible so as to reduce future maintenance work/requests on it. If that means just implementing it for one convention, without settings, and documenting that it's just a convenience feature if you use x convention, I think that would be fine. Also, thank you @pratik97 for working on this! |
I agree about starting simple, with few settings. |
The cases to consider:
I think you could do all of that without adding any options -- even though you'd need to support the "simple" style and "Maven" style paths ( This would be a reasonable test case: https://github.com/clojure/tools.cli -- it follows the Maven structure and uses Not sure if you'd want to support this as a test case: https://github.com/clojure/data.xml -- the test files have Of course, I would love to see this support additional test filename patterns (such as LMK if you have any Qs about that. |
makes sense, @seancorfield thanks for your inputs! I will work on adding extra look-up path and the file extensions. |
Dear Calva developers,
As discussed on Clojureverse, I'd like to kindly ask to add the following feature:
src/a/b/c.clj
Calva will open a filetest/a/b/c_test.clj
and then when executed again Calva will focus to the the source filesrc/a/b/c.clj
.There is already a similar extension for Elixir called Elixir Test that has exactly this functionality so you may consider to take a look at its code (MIT licensed) to see how it's implemented.
Thank you.
Kind regards,
Rudolf Vesely
The text was updated successfully, but these errors were encountered: