Fork me on GitHub
#calva
<
2022-06-29
>
craftybones03:06:59

Not sure if this is on quil or Calva, but I am unable to evaluate any of the quil.core fns on the launched repl. I've jacked in using figwheel-main + deps.edn . When I exec any quil.core functions, I get the following:

(q/noise 1)
; #object[TypeError TypeError: Cannot read properties of null (reading 'noise')]
cljs꞉example.core꞉> 
cljs.repl/evaluate-form (repl.cljc:578)
cljs.repl/evaluate-form (repl.cljc:499)
cider.piggieback/eval-cljs (piggieback_impl.clj:255)
cider.piggieback/eval-cljs (piggieback_impl.clj:254)
cider.piggieback/do-eval (piggieback_impl.clj:294)
clojure.core/apply (core.clj:667)
clojure.core/with-bindings* (core.clj:1990)
cider.piggieback/do-eval (piggieback_impl.clj:271)
cider.piggieback/do-eval (piggieback_impl.clj:270)
cider.piggieback/evaluate (piggieback_impl.clj:328)
cider.piggieback/evaluate (piggieback_impl.clj:326)
clojure.lang.Var/invoke (Var.java:384)
cider.piggieback/wrap-cljs-repl (piggieback_impl.clj:359)
cider.piggieback/enqueue (piggieback_impl.clj:206)
nrepl.middleware.session/session-exec (session.clj:218)
nrepl.middleware.session/session-exec (session.clj:217)
java.lang.Thread/run (Thread.java:833)

bringe03:07:23

> The code works fine on the browser itself. What do you mean by this? What steps do you take to cause the above error? Are you evaluating that from a file, using one of the eval commands, or are you using the load file command with that at the top level, or evaluating from the repl output window?

craftybones04:07:00

Turns out this is a quirk of quil's. Several of the core functions in quil only work when provided a graphics context. This oddly extends to their math functions as well. This is not a calva issue.

👍 1
craftybones04:07:21

I should have updated this earlier

bringe04:07:28

No worries

craftybones03:06:41

The code works fine on the browser itself.

pez07:06:48

IMPORTANT: Dear Calva and clojure-lsp friends. The latest version of clojure-lsp is having some issue with freezing up after some minutes of running. And Calva's backup of using the REPL instead for some of the lsp provided services don't kick in because it is a freeze-up situation that we haven't prepared for. I think most/all Calva users are affected, and for now can only advice you to use the previous version of clojure-lsp, until the issue is sorted. Here are the steps for using previous clojure-lsp: 1. Update the setting Calva: Clojure Lsp Version to 2022.05.31-17.35.50 2. stop clojure-lsp 3. download clojure-lsp 4. start clojure-lsp (You can use the status bar clojure-lsp button for steps 2-4.) See also: • We are tracking the issue from the Calva side of things here: https://github.com/BetterThanTomorrow/calva/issues/1782 • Here's a clojure-lsp issue: https://github.com/clojure-lsp/clojure-lsp/issues/1080 • Slack thread analyzing the problem: https://clojurians.slack.com/archives/CPABC1H61/p1656093769590509

🤞 6
thanks2 1
Tuomas-Matti Soikkeli10:06:25

can confirm that this version works plus_one

🙏 1
Eugen10:06:01

thank you, I've been hit by this as well

seancorfield16:06:30

Ah, yes, I was experiencing this issue but hadn't made the connection with LSP freezing.

ericdallo21:06:03

Problem fixed folks, fix on the latest clojure-lsp release! https://clojurians.slack.com/archives/CPABC1H61/p1656538473980919

metal 1
🙏 1
❤️ 3
🎉 3
gratitude 1
💯 1
pez20:06:52

Thanks for giving us Calva users this targeted fix @ericdallo! ❤️ I've been running with latest clojure-lsp all day and it has worked just great. 🎉

ericdallo20:06:04

Awesome! thanks for the feedback! 💜

ericdallo20:06:44

Most of the work was done by @U07M2C8TT! He helped a lot finding the root cause and testing on Calva

jacob.maine20:06:14

It was an elusive bug, but I can only take part of the credit... The Calva community really stepped in to figure out which release introduced it, how to repro it, and then to test patches as they were proposed. Thanks to all of you for making clojure-lsp better! ❤️

gratitude 5
yonatanel16:06:12

Is anyone using VSCodeVim or VSCode Neovim with Calva successfully? Is there a hack to make Expand Selection work correctly with copy-paste etc?

Cal Herries20:06:14

This is my init.vim, see if the set clipboard=unnamedplus line fixes your issues

set clipboard=unnamedplus
nmap cqp :call VSCodeNotify('calva.jackIn')<CR>
nmap cqq :call VSCodeNotify('calva.disconnect')<CR>
nmap cpr :call VSCodeNotify('calva.loadFile')<CR>
nmap cpR :call VSCodeNotify('calva.loadNamespace')<CR>
nmap cpp :call VSCodeNotify('calva.evaluateSelection')<CR>
nmap cqc :call VSCodeNotify('calva.evalCurrentFormInREPLWindow')<CR>

yonatanel17:06:10

That didn't quite had the effect I wanted. I did end up using VSCode Neovim and installed the vim-sexp plugin directly in neovim, which now gives me expand-selection in visual mode. (https://github.com/tpope/vim-sexp-mappings-for-regular-people)