"Toggle between implementation and test" command do not work for projects with children test paths
I'm migrating from IntelliJ recently and noticed that Toggle between implementation and test command is not working the same for projects that uses subfolders inside test path (example: test/unit/..., test/integration/...).
I have a Leiningen project that looks like the following:
.
├── project.clj
├── src
│ ├── my-project
│ │ ├── ...
│ │ ├── adapters
│ │ │ ├── command.clj
│ │ ├── ...
└── test
├── helpers
│ ├── ...
├── integration
│ ├── integration
│ │ ├── ...
└── unit
└── my-project
├── adapters
│ ├── command_test.clj
├── ...
│ ├── ...
What I expected when I'm in a function inside my-project.adapters.command namespace and hit Toggle between implementation and test command is to go to my-project.adapters.command-test and vice-versa. Regardless of how they are in src/test folders.
What happens is that the editor asks to create a test file test/my_project/adapters/command_test.clj (when test/unit/my-project/adapters/command_test.clj already exists. When when I'm in the test file it asks to create a source in src/unit/my-project/adapters/command.clj (when src/my-project/adapters.command.clj already exists).
This issue is a request to support these use cases. I'd expect to search using namespaces (which match in the examples I mentioned) and not necessarily test file path. Consider following leiningen's :test-paths config.
Here's what my leiningen project.clj defined test paths looks like:
:test-paths ["test/unit/"
"test/integration/"]
Hello. Sorry for radio silence. Thanks for reaching out! This sounds like a good thing for Calva to support. We have similar use cases for fiddle files where we allow for more flexibility. Maybe we can re-use some of that code for this. (Or maybe not, but mentioning it because whoever starts working on this should be aware.)