Fork me on GitHub
#calva
<
2023-12-19
>
seancorfield01:12:02

I experimented with Live Share today (for the very first time): I shared from a desktop VS Code + Calva project to http://vscode.dev (web) and saw that Calva switched to a Clojure notebook format in my desktop (to match what I saw in the web version?). I could run individual cells but they didn't seem to maintain "history" between cells -- so eval'ing (ns foo.bar (:require '[some.thing :as st])) in cell 1 worked, but then eval'ing (st/wibble) in cell 2 failed with st not known. What's the current status of Clojure editing in http://vscode.dev these days? And what are folks realistically doing with Live Share?

pez08:12:52

It’s a LiveShare issue causing the notebooks editors to be used. https://github.com/MicrosoftDocs/live-share/issues/4765 You can disable the Calva Spritz extension to stop that from happening.

pez08:12:35

The issue with st not being defined properly is strange. Maybe Calva fails to figure out the namespace for the second evaluation…

seancorfield17:12:24

Oh, so if I turn Spritz off, I'll get regular Calva-powered open files?

pez17:12:34

That’s the intention. But should work, because without the Spritz extension there’s no notebook file extension association going on.

pez17:12:57

I was hoping Spritz would be a very temporary thing, but the VS Code team does not seem to think the issue is worth spending time on.

seancorfield17:12:02

Does disabling Spritz affect anything else except Live Share?

pez17:12:13

Effectively Spritz is what enables Calva Notebooks. Nothing more, nothing less.

seancorfield17:12:28

OK, so no Spritz, no notebooks at all for Clojure, regardless of Live Share? (just so I'm clear)

pez17:12:57

Exactly.

1
pez17:12:43

Re-enabling Spritz takes a reload of the VS Code window, iirc.

seancorfield18:12:40

Live Share is kind of amazing...

pez18:12:17

I haven’t used it much, but from what I’ve seen, yeah!

Raghav18:12:20

I'm unable to use 'Go to definition' for clojure.core functions. It works for the things I've defined in my namespace.

nREPL dependencies configured:
  nrepl: 1.0.0
  cider-nrepl: 0.28.5
  cider/piggieback: 0.5.3
clojure-lsp version configured: latest

Calva version used: v2.0.403
clojure-lsp version used: 2023.10.30-16.25.41
Does it require something extra?

ericdallo18:12:23

no, you probably have a classpath issue

ericdallo18:12:38

try: • rm -rf .lsp/.cache (to force rescan) • restart vscode • check server logs (https://calva.io/clojure-lsp/#viewing-the-logs-between-the-client-and-server Opening the Server Log File)

ericdallo18:12:03

(BTW @U0ETXRFEWwould be nice to link directly to those headings "Opening the Server Log File", it's not the first time I can't do that :/ )

Raghav19:12:58

I see some errors and warnings.

Raghav19:12:39

I don't see clojuredocs on hover anymore. I'm guessing that had something to do with me deleting the cache. edit: can see the documentation after starting the repl.

ericdallo19:12:57

the clojuredocs info is requested after server startup and take some seconds, then cached

ericdallo19:12:03

but that exception is not related with your problem

ericdallo19:12:23

but it's a bug, we should fix it in clojure-lsp

ericdallo19:12:46

anyway, I'm not seeting logs about classpath lookup, is that all the log?

pez19:12:17

@UKFSJSM38 The headings are linkable, like so: https://calva.io/clojure-lsp/#opening-the-server-log-file Do you mean it doesn’t scroll to the top?

pez19:12:43

> edit: can see the documentation after starting the repl Does go to definition also work when the repl is started?

Raghav19:12:11

@UKFSJSM38 @U0ETXRFEW I created a new project via lein and it seems to be working fine now. Earlier I just had a single file inside a folder. Thank you!

🙏 1
ericdallo19:12:40

@U0ETXRFEW ah, I thought that wasn't enable because in clojure-lsp there is a permalink icon, but glad it works, not sure if you typed the heading manually or clicked somewhere else

ericdallo19:12:10

ah yeah, it's important to have a minimal project concept so clojure-lsp can know the project type and get the classpath @U05H1PF60G1

1
pez20:12:45

Are you using mkdocs for the clojure-lsp site, @UKFSJSM38?

pez20:12:42

I’ll see if I can enable the permalink thing.

ericdallo20:12:48

yes, mkdocs-material, I have a image for that https://github.com/clojure-lsp/docs-image

pez20:12:13

Found it. It’s fixed now. We’re also using mkdocs materials. Thanks for pointing that out!

ericdallo20:12:46

way better, thank you!

Ludger Solbach19:12:48

Do we have a nice printable Calva cheat sheet?

pez19:12:14

Oh, that would be lovely!

gdubs23:12:56

Anybody know of a way to add the portal middleware when Calva jacks in? (see also: https://clojurians.slack.com/archives/CBE668G4R/p1681508197454209). @seancorfield what's your workflow in this regard?

seancorfield03:12:15

See https://github.com/seancorfield/dot-clojure My user deps.edn has a :dev/repl alias I use when jacking-in. It starts a REPL based on whatever it finds on the classpath -- see the tail end of https://github.com/seancorfield/dot-clojure/blob/develop/src/org/corfield/dev/repl.clj for how it decides what middleware to add. Then my project's typically have VS Code settings for Calva to automate the jack-in process: https://github.com/seancorfield/next-jdbc/blob/develop/.vscode/settings.json

seancorfield03:12:08

(in particular, the calva.replConnectSequences jack-in adds aliases for Clojure 1.12 (Alpha 5), Portal, :test, and :dev/repl -- 1.12 so I can add dependencies on-the-fly to my REPL without a restart -- :portal, :1.12, and :dev/repl all come from my user deps.edn file)

seancorfield03:12:10

Note that my dot-clojure repo is both a library (with org.corfield.dev.repl in it) and a user deps.edn file from which you can copy whatever aliases you want 🙂

gdubs17:12:17

Thanks Sean! I'm excited to use this! I have your user deps.edn installed. When I run the calva Jack-In command, should I expect to see all your aliases in the pick menu? I don't. Nor does it appear to let me free-type anything. I could try using the calva.replConnectSequencessetting you linked to. I did try clj -M:dev/repl from my project root and it seemed to work fine, thus validating that my user deps.edn was located fine.

gdubs18:12:45

lol, it was right above the message that I linked to in my first post! I'm just 8 month behind you Sean!

1
seancorfield18:12:09

I'm livin' on the bleedin' edge 🙂