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.
I too use WSL-Remote on one of my machines.
Thanks! Itās this PR https://github.com/BetterThanTomorrow/calva/pull/1187 the latest VSIX is here: https://13743-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.199-pull-1187-7179e66a.vsix 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.
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 @seancorfield 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
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).
Happy path worked on a lein new re-frame rftest +test
project in WSL remote mode... trying @seancorfield's muti folder setup + a few other possible edge cases I've seen in other projects
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
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.
okay, I see this as an open issue here - https://github.com/clojure-lsp/clojure-lsp/issues/416
(Iām just heading out for lunch/shopping but will try to remember to test it when I get back)
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?)?