Fork me on GitHub
#calva
<
2023-01-27
>
pez11:01:42

🎉 4
seancorfield17:01:46

If you have a Polylith monorepo with over 100 components (as we do), that change makes for a really unwieldy menu since I now get double the number of lines in it (and extra vertical space too?) so that menu is somewhere north of 300 lines long now (showing 160 deps.edn files and their full paths).

seancorfield17:01:51

It would be great if Calva either remembered the last project you connected to (it's always the workspace root for us) or defaulted to the workspace root -- instead of whatever random file in the repo you happen to have open...

plus_one 2
seancorfield17:01:48

Another option would be to always put the current path at the top of the menu and default to that -- since at least then the default would work for almost everyone and I'd only have to move the cursor down one row to select the workspace root.

pez17:01:45

Is this the repl connect menu with project roots you are referring to?

pez17:01:40

We can also make that extra line searchable, so you would type ”root” and select it quickly that way. Though, I think that in a Polylith project that extra line does not otherwise add all that much value. We should consider skipping it at some threshold, or something.

seancorfield17:01:12

Yes, whenever I connect to a REPL: I get the folder menu, then the project type menu (which at least it remembers from the previous connection), then the host:port menu. It's a bit painful overall but this latest change is a nightmare for me 😞

pez18:01:21

Sorry about that, @U04V70XH6! Until we fix it you can navigate to the top of the menu with a keystroke. cmd+home works on Mac. Not sure what it could be on Windows.

seancorfield18:01:08

Ah, ctrl+home would probably work -- I hadn't thought of trying that in a drop-down menu...

seancorfield18:01:57

Yup, confirmed. That's much better.

seancorfield18:01:54

It would be nice if there was a single command to just connect to the workspace-root-deps-nrepl using the host:port already set (in the .nrepl-port file) with no interaction needed. Those menus are fine for a first connection but a pain for repeated later connections.

bringe04:01:20

Do repl connect sequences not allow this already? (I don’t really use them.) If not, maybe a solution could be something added to the connect sequence functionality to allow this.

seancorfield05:01:46

@U9A1RLFNV No, they appear as items in the second of those three menus -- I use them already for setting up QA and production REPL connections -- but you still have to go through the first project/folder menu to get to the "repl type" menu in which they appear and then manually select one: so you only skip the third "menu" (dialog) of host:port.

👍 2
Kiyanosh Kamdar18:01:10

Hello, I just started receiving this error message:

Kiyanosh Kamdar18:01:36

I’ve tried to restart VS code several time, looked for cache files (didn’t find any)

Kiyanosh Kamdar19:01:52

is there a way to revert back to a previous version? It appears I’m on latest v2.0.327

seancorfield19:01:51

@U03EEEB90DV If you run that command from the workspace root, what output do you get? /usr/local/bin/clojure -A:test:dev -Spath

Kiyanosh Kamdar19:01:43

let me try that. fwiw, I downgraded to v2.0.324 and that works without any errors

Kiyanosh Kamdar19:01:25

output:

WARNING: Specified aliases are undeclared and are not being used: [:dev]
test:src:/Users/kkamdar/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar:/Users/kkamdar/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar:/Users/kkamdar/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar

seancorfield19:01:55

OK, so it's not finding the :dev alias -- which is probably why that message appears.

seancorfield19:01:48

Either add :dev as an alias in the project or remove it from the aliases when you jack-in I guess?

Kiyanosh Kamdar19:01:00

hmmm I’m not sure where that alias is coming from. The error message I post above comes when I startup VS code and don’t do anything else.

seancorfield19:01:21

Perhaps in your .lsp/config.edn file?

Kiyanosh Kamdar19:01:37

let me look there

seancorfield19:01:42

:source-aliases

Kiyanosh Kamdar19:01:43

That file doesn’t have :source-aliases that I could find

pez19:01:58

Try with the previous version of Calva. In the extensions pane, you can bring up a menu on the Calva entry, and select to install another version.

Kiyanosh Kamdar19:01:48

👍 v2.0.324 loaded fine

pez19:01:17

The error doesn’t look like it would come from the changes, but they were almost all about clojure-lsp


seancorfield20:01:15

And, just to check @U03EEEB90DV, /Users/kkamdar/repos/docs-ci-master/deps.edn exists and is the valid deps.edn file for this project, where you ran the clojure command above?

pez20:01:29

I was going to ask the same as @U04V70XH6, and also if /Users/kkamdar/repos/docs-ci-master/ is the project root?

pez20:01:29

@USDPTD3FY, are you experiencing similar problems with 2.0.237?

Kiyanosh Kamdar20:01:31

That project had a empty deps.edn file in it. Let me remove it from the workspace and try again

Daniel Craig20:01:21

I'll have to check my version; I see a very similar error though

seancorfield20:01:28

Ah, so the difference now is that LSP is checking every project in the workspace now I think.

Kiyanosh Kamdar20:01:10

@U04V70XH6 I’m seeing another weird problem pop up all of a sudden. The Organize Imports has stopped working. I see the below error:

Kiyanosh Kamdar20:01:19

I’m going to try an older version

Kiyanosh Kamdar20:01:30

older version works!

pez20:01:37

Can you describe the workspace layout you have a bit, @U03EEEB90DV ?

pez20:01:18

@U04HKE0BTC5 , do you have an idea what could be going on?

Kiyanosh Kamdar21:01:55

Can I send you a picture? A workspace with five projects. Only two are core clojure project, the others are k8s helm charts and other things

julienvincent21:01:59

At a glance not sure what's happening. Must be some side-effect from the changes. If this is too wide-spread we can rollback maybe? How easy is this to reproduce?

julienvincent21:01:51

I didn't run into this in my testing, having a reproducible project structure would be really helpful

Kiyanosh Kamdar21:01:31

this is what it looks like:

julienvincent21:01:08

@U0ETXRFEW the default setting for lsp autostart will try start an lsp server in all workspace roots regardless of whether they are valid clojure projects or not. (I.e not the on file open behavior). So this is probably related to starting an lsp server in a non-clojure project. @U03EEEB90DV does the lsp in the clojure project workspace folders work?

Kiyanosh Kamdar21:01:01

Yes, they seem to be working

julienvincent21:01:24

Ok, then this is probably not a big issue I think. Just need to prevent starting the lsp in non-clojure workspaces to prevent the vscode error notification

Daniel Craig21:01:29

I'm not able to produce this error at the moment

pez22:01:48

What about the missing LSP commands, @U04HKE0BTC5?

pez22:01:57

Rolling back v2.0.327 now. 328 will be 326 with a new name.

pez23:01:33

Calva v2.0.328 is out, rolling back v2.0.327 which broke some things around clojure-lsp functionality. Please see https://github.com/BetterThanTomorrow/calva/issues/2041

julienvincent23:01:57

Will take a look at this over the weekend

❀ 4
pez23:01:13

Cool. I've not rolled back our main development branch this time, @U04HKE0BTC5. If it seems to get tricky fixing the issues, let me know and we can rollback dev. But if it is not so tricky, we can allow dev to be blocked for new releases while fixing. I'll try to make myself available, should you need my help with something.

seancorfield23:01:32

And, to be clear, now I know I can use ctrl+home to jump to the top of the connect folder/project menu, the "very large" menu is less of a concern -- and my preferred solution there would be for Calva to perhaps put the "current" project folder (identified by the current logic based on what file is open) at the very top of the list, followed by all the auto-discovered folders (i.e., the current list). That would allow folks to just hit enter to retain the current behavior -- select the project folder most likely associated with the current open file -- with the workspace root (if different) on the second line, making it much easier/more obvious to navigate to.

seancorfield00:01:25

(the real solution here is to provide a programmatic API so folks can more easily avoid the three menus/dialogs altogether and just bind a key to a Joyride script to auto-select the workspace root, the project type, and the .nrepl-port value and not require human confirmation three times! 🙂 )

pez00:01:52

I think we have an issue for the real solution. Restoring the menu is a temporary measure. If we can sort it like you suggest without much issue, we might do that instead.

2
seancorfield00:01:14

I know our project is somewhat of an outlier:

(/var/www/worldsingles)-(!2016)-> find . -name deps.edn | wc
    178     178    6084
(because with Polylith, every "base", "component", and "project" has deps.edn as well as the top-level -- workspace -- deps.edn)

pez09:01:10

@U04V70XH6 I think your suggestion with sorting the pre-selected item to the top is brilliant. It will support your gargantuan Polylith without sacrificing Ux for more common project sizes. It also seems easy to implement on top of what we have.

2
julienvincent14:01:39

Quick update: Locally I have PoC fix for the missing clean-ns command when running organize-imports (and other related issues) and I have resolved the issue of the lsp being starting in non-clojure projects. Need to pause for now - will continue this evening.

metal 2
julienvincent18:01:31

Fixes have arrived: https://github.com/BetterThanTomorrow/calva/pull/2046 Sorry for the delay - been working from a plane 😁

gratitude 2
julienvincent18:01:30

Hopefully this addresses everything, let me know if I missed anything

seancorfield20:01:36

Installed. Will let you know how it goes!

🙏 4
seancorfield20:01:49

The project folder drop-down menu is a huge improvement -- thank you! (in our 160 deps.edn monorepo)

clojure-spin 4
pez22:01:57

Rolling back v2.0.327 now. 328 will be 326 with a new name.

pez23:01:33

Calva v2.0.328 is out, rolling back v2.0.327 which broke some things around clojure-lsp functionality. Please see https://github.com/BetterThanTomorrow/calva/issues/2041