Fork me on GitHub
#calva
<
2021-06-09
>
pez06:06:57

It is far from obvious. 😃

pez16:06:54

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

seancorfield19:06:51

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

pez19:06:02

I think I mean the WSL-Remote stuff.

seancorfield19:06:31

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.

pez19:06:26

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.

seancorfield20:06:54

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

❤️ 2
seancorfield22:06:00

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

seancorfield22:06:24

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

seancorfield22:06:11

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

seancorfield22:06:34

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

seancorfield22:06:57

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

pez06:06:05

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

Pratik07:06:35

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

pez07:06:06

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

seancorfield16:06:16

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?

Pratik16:06:56

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

seancorfield16:06:03

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.

pez17:06:15

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.

seancorfield17:06:36

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

seancorfield17:06:04

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

seancorfield17:06:24

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

seancorfield17:06:08

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.

seancorfield17:06:01

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).

seancorfield17:06:13

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

Pratik17:06:38

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

Pratik18:06:41

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 😕

seancorfield18:06:44

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

pez18:06:09

What is implied by haveing more than one project open?

seancorfield18:06:09

More than one folder in the workspace.

seancorfield18:06:29

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

pez19:06:23

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

6
👍 2
Ryan Jerue02:06:31

Going to add comment to pr.

Pratik17:06:19

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.