Fork me on GitHub

It is far from obvious. 😃


Is someone using Calva with the Remote extension? We need some help testing a PR.


@pez Do you mean the WSL-Remote stuff or something else?


I think I mean the WSL-Remote stuff.


I guess I can help test it on my laptop then? All my Clojure code is on Ubuntu (WSL2) and I run Calva on Windows and access everything via the remote extension.

Ryan Jerue19:06:14

I too use WSL-Remote on one of my machines.


Thanks! It’s this PR the latest VSIX is here: What’s mainly under test in the remote setting is that the command works for the “happy path”. That is if the project structure is fairly standard you should be able to switch between test and implementation files and also test and implementation files should be offered to be created, and then be created.


(I’m just heading out for lunch/shopping but will try to remember to test it when I get back)

❤️ 2

Switching between src/test works. Creating missing files uses the wrong path.


I was looking at the remote file /Developer/workspace/wsmain/clojure/login/src/login/handlers/main.clj and it seemed to reuse the path of the previous file I was looking at and wanted to create a test file in /Developer/workspace/wsmain/clojure/bases/google-search-cli/Developer/workspace/wsmain/clojure/login/test/login/handlers/main_test.clj


The path would have been correct if it didn’t have that previous path prefix, i.e., if it had been: /Developer/workspace/wsmain/clojure/login/test/login/handlers/main_test.clj


If the confirmation popup let you edit the path, that would be nice.


Anyway, hope that helps @pez (not sure if Partik is on here?)?


Thanks @U04V70XH6! Totally appreciate this help. Yes, @U01PG2LDYV8 is around 😃


looks like it’s happening due to how we calculate project root?


Could be, but it also looks like the hard-disk root path is repeated…


The odd thing to me was that it used the path of a file I had previously been viewing, not the path of the file I was currently viewing when I asked it to switch to the test file — so maybe some stale state in a global var?


Hey @U04V70XH6 can you help me with the project structure for this, I am trying to reproduce the bug


Well, the switching between source and test works just fine — so that part knows where the corresponding file should be. It’s only when the corresponding file is missing that it seems to compute the wrong path. So the bug is that there’s a difference between where it looks for the file and where wants to create the file if it is not present.


Roger that, but we’d like to see if it is a Remote thing or general so we would like to try repro on Mac w/o Remote in the picture.


OK, I can install the VSIX on Mac and try it out with the exact same project…


Switching does not work on Mac at all: even for the examples that do work on Windows/WSL2.


The path it is offering to create the file in is correct — when the file is actually present.


When I then move to a part of the project where there is no matching test file, I see the same bug I saw on Windows/WSL2: it repeats the entire path and reuses the previous folder location I was in.


So that bug is reproducible between platforms but, in addition, switching on Mac doesn’t work, even when the matching file is present (but at least where it wants to create the file looks correct).


FYI I’ve switched back to 2.0.200 so I can continue working now 🙂


hmm, I’ll have a look, as far as I remembered, file switching and directory creation were working fine on my mac

Ryan Jerue18:06:31

I can give it a try tonight


Found the culprit! it happens with multiple projects open in VSCode, say I have 2 projects open test.check and tools.cli and I switch run the command on file of one project, and then switch to some other project’s file and run the command there. I was opening these projects one by one and testing them 😕


Yeah, I pretty much always have at least two projects open, often more.


What is implied by haveing more than one project open?


More than one folder in the workspace.


But the testing I was doing was all within the same project tree.


Thanks. I got worried that state was leaking between VS Code windows (which is how I have more than one project open).

Ryan Jerue02:06:13

Happy path worked on a lein new re-frame rftest +test project in WSL remote mode... trying @U04V70XH6's muti folder setup + a few other possible edge cases I've seen in other projects

Ryan Jerue02:06:25

When I have multiple folders in the workspace, I get prompted to make a new file, and upon clicking create, it brings me to the test impl. It does not create a new file

👍 2
Ryan Jerue02:06:31

Going to add comment to pr.


I have fixed some of the issues but seems like when I open multiple projects(in one window), auto-add-ns functionality is not working. Tested that it works with a single project open.