calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
pez 2021-06-09T06:59:57.223Z

It is far from obvious. šŸ˜ƒ

pez 2021-06-09T16:02:54.223600Z

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

seancorfield 2021-06-09T19:09:51.224100Z

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

pez 2021-06-09T19:48:02.224800Z

I think I mean the WSL-Remote stuff.

seancorfield 2021-06-09T19:49:31.225600Z

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 Jerue 2021-06-09T19:53:14.226400Z

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

pez 2021-06-09T19:56:26.229600Z

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.

2021-06-10T07:26:35.231500Z

looks like itā€™s happening due to how we calculate project root?

pez 2021-06-10T07:34:06.231700Z

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

seancorfield 2021-06-10T16:13:16.231900Z

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?

2021-06-10T16:51:56.232100Z

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

seancorfield 2021-06-10T16:56:03.232300Z

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.

pez 2021-06-10T17:09:15.232500Z

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.

seancorfield 2021-06-10T17:15:36.232700Z

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

seancorfield 2021-06-10T17:19:04.232900Z

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

seancorfield 2021-06-10T17:20:24.233100Z

The path it is offering to create the file in is correct ā€” when the file is actually present.

seancorfield 2021-06-10T17:21:08.233300Z

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.

seancorfield 2021-06-10T17:22:01.233500Z

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

seancorfield 2021-06-10T17:26:13.233700Z

FYI Iā€™ve switched back to 2.0.200 so I can continue working now šŸ™‚

2021-06-10T17:53:38.233900Z

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

Ryan Jerue 2021-06-10T18:06:31.234300Z

I can give it a try tonight

2021-06-10T18:16:41.234500Z

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 šŸ˜•

seancorfield 2021-06-10T18:26:44.234700Z

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

pez 2021-06-10T18:30:09.235600Z

What is implied by haveing more than one project open?

seancorfield 2021-06-10T18:31:09.235800Z

More than one folder in the workspace.

seancorfield 2021-06-10T18:31:29.236Z

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

pez 2021-06-10T19:00:23.236200Z

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

Ryan Jerue 2021-06-11T02:07:13.236500Z

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

Ryan Jerue 2021-06-11T02:10:25.236700Z

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

šŸ‘ 1
2
Ryan Jerue 2021-06-11T02:13:31.237100Z

Going to add comment to pr.

2021-06-11T17:05:19.242300Z

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.

2021-06-11T17:13:56.242600Z

okay, I see this as an open issue here - https://github.com/clojure-lsp/clojure-lsp/issues/416

seancorfield 2021-06-09T20:05:54.229900Z

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

ā¤ļø 1
seancorfield 2021-06-09T22:41:00.230200Z

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

seancorfield 2021-06-09T22:43:24.230400Z

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

seancorfield 2021-06-09T22:44:11.230600Z

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

seancorfield 2021-06-09T22:44:34.230800Z

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

seancorfield 2021-06-09T22:44:57.231Z

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