Fork me on GitHub
#calva
<
2021-11-25
>
Shan Rauf01:11:34

Is there a way to increase the timeout limit for long running functions in the REPL? When I use the js-debugger, run a long Datascript query, etc, the REPL eventually says The previously used runtime disappeared. Will attempt to pick a new one when available but your state might be gone. Honestly can't tell if it's a Calva thing, a shadow-cljs thing, or what though...

bringe06:11:09

What’s your runtime environment for your JS/CLJS? If it’s the browser, for example, any time the browser is refreshed, the runtime will “disappear” I believe, because your code was running in that environment that was refreshed.

pez06:11:14

The message sounds like it is coming from shadow-cljs.

Shan Rauf03:11:03

Looks like you were right, thank you for the help https://github.com/thheller/shadow-cljs/issues/963

maxt11:11:08

Today I can’t get any results from the calva REPL on Mac. I’ve tried it on both my machine and a colleges. Typing directly into the REPL-window works, but sending forms only show the form, but no result.

pez11:11:50

Sounds very worrying. What does sending forms mean here?

maxt11:11:51

Sorry sorry! I confused “send” with “eval” facepalm

pez11:11:43

Not strange. I think that in some other IDEs it is done by sending the form to the REPL.

pez11:11:05

Have you tried it with a different project?

maxt11:11:17

That is I was running Calva: Send Current Form to Output/REPL Windowbut was expecting Calva: Evaluate Current Form (or selection, if any)

maxt11:11:01

I’m coming from Cursive, so maybe I got it from there

maxt11:11:27

But using the correct option (eval) everything works as expected

pez11:11:46

Ah, so you are all good now?

maxt11:11:13

I’m all good! Sorry for the noise and thank you for Calva! (and quick reply!)

pez11:11:17

No problem, it is actually good to know that this can confuse. And you are welcome!

maxt11:11:18

I can find one error in the Log (extension host) output_

[2021-11-25 12:40:33.732] [exthost] [error] [betterthantomorrow.calva] provider FAILED
[2021-11-25 12:40:33.732] [exthost] [error] Canceled: Canceled
	at x.makeCancelError (/Users/thomo/.vscode/extensions/betterthantomorrow.calva-2.0.225/out/extension.js:2:1104201)
	at x.handleFailedRequest (/Users/thomo/.vscode/extensions/betterthantomorrow.calva-2.0.225/out/extension.js:2:1104052)
	at /Users/thomo/.vscode/extensions/betterthantomorrow.calva-2.0.225/out/extension.js:2:1069014
	at async s.provideDocumentSymbols (/Applications/Visual Studio )

maxt11:11:29

I’ve tried this in a fresh session code --user-data-dir tmp --extensions-dir tmp and then only installed calva

emccue22:11:26

starting to experiment and i’m noticing that click to definition can take a long time

emccue22:11:12

its a particularly large codebase, which might be the cause

emccue22:11:30

but i was wondering if there were any known footguns/things to configure

emccue22:11:59

clojure-lsp version used: 2021.11.16-16.52.14
clj-kondo version used: 2021.10.20-SNAPSHOT
^ in case this helps

ericdallo23:11:01

How much is a longer time? I'm not sure calva always use clojure-lsp to find-definitions or if when repl is connected it uses cider to find the definition

ericdallo23:11:22

The lsp one usually is really fast (max 1sec AFAIK)

emccue23:11:59

It can range from really fast to never finishing

ericdallo23:11:24

That's odd, could you try with repl disconnected?

emccue23:11:43

calva reports no repl

ericdallo23:11:29

Anything on clojure-lsp logs? There is a command "Calva open clojure-lsp logs"

emccue23:11:55

running that doesn’t seem to do anything. restarting vs code

👍 1
emccue23:11:49

first error is this

2021-11-25T23:15:52.145Z  INFO [clojure-lsp.server:435] - Starting server...
2021-11-25T23:15:52.163Z  DEBUG [clojure-lsp.nrepl:21] - nrepl not found, skipping nrepl server start...
2021-11-25T23:15:52.164Z  ERROR [taoensso.timbre:796] - Uncaught exception on thread: main
 [37mclojure_lsp.main.main[m  [32m             [m
                   [37m...[m  [32m             [m
[33mclojure-lsp.main/[1;33m-main[m  [32mmain.clj: 159[m
[33mclojure-lsp.main/[1;33m-main[m  [32mmain.clj: 161[m
 [33mclojure-lsp.main/[1;33mexit[m  [32mmain.clj: 118[m
                   [37m...[m  [32m             [m
[1;31mjava.lang.NullPointerException[m: [3m[m

emccue23:11:23

and then

1-11-25T23:17:25.143Z  INFO [clojure-lsp.crawler:?] - Project only paths analyzed, took 87.13 secs
2021-11-25T23:17:49.783Z  DEBUG [clojure-lsp.server:?] - :initialize 117606ms
2021-11-25T23:17:49.847Z  INFO [clojure-lsp.server:361] - Initialized!
2021-11-25T23:17:49.848Z  DEBUG [clojure-lsp.server:?] - :initialized 0ms
2021-11-25T23:17:49.848Z  WARN [clojure-lsp.server:261] - {}
2021-11-25T23:17:50.318Z  DEBUG [clojure-lsp.server:?] - :didOpen 469ms
2021-11-25T23:17:50.324Z  DEBUG [clojure-lsp.server:?] - :documentSymbol 3ms
2021-11-25T23:17:50.518Z  DEBUG [clojure-lsp.server:?] - :codeAction 196ms
2021-11-25T23:17:50.905Z  DEBUG [clojure-lsp.server:?] - :codeAction 219ms
2021-11-25T23:17:53.558Z  DEBUG [clojure-lsp.server:?] - :definition 75ms
2021-11-25T23:17:57.936Z  DEBUG [clojure-lsp.server:?] - :didOpen 4330ms
2021-11-25T23:17:57.937Z  DEBUG [clojure-lsp.server:?] - :didClose 0ms
2021-11-25T23:17:57.938Z  DEBUG [clojure-lsp.server:?] - :hover 1ms
2021-11-25T23:17:57.938Z  DEBUG [clojure-lsp.server:?] - :definition 1ms
2021-11-25T23:17:57.938Z  DEBUG [clojure-lsp.server:?] - :documentHighlight 1ms
2021-11-25T23:17:58.646Z  DEBUG [clojure-lsp.server:?] - :hover 708ms
2021-11-25T23:17:58.689Z  DEBUG [clojure-lsp.server:?] - :hover 751ms
2021-11-25T23:17:58.689Z  DEBUG [clojure-lsp.server:?] - :definition 751ms
2021-11-25T23:17:58.933Z  DEBUG [clojure-lsp.server:?] - :definition 995ms
2021-11-25T23:17:58.942Z  DEBUG [clojure-lsp.server:?] - :hover 700ms
2021-11-25T23:17:58.947Z  DEBUG [clojure-lsp.server:?] - :definition 705ms
2021-11-25T23:17:58.987Z  DEBUG [clojure-lsp.server:?] - :documentSymbol 0ms
2021-11-25T23:17:59.012Z  DEBUG [clojure-lsp.server:?] - :definition 80ms
2021-11-25T23:17:59.041Z  DEBUG [clojure-lsp.server:?] - :codeAction 1103ms
2021-11-25T23:18:04.806Z  DEBUG [clojure-lsp.server:?] - :didOpen 5628ms
2021-11-25T23:18:04.810Z  DEBUG [clojure-lsp.server:?] - :documentSymbol 2ms
2021-11-25T23:18:04.846Z  DEBUG [clojure-lsp.server:?] - :codeAction 38ms
2021-11-25T23:18:09.334Z  DEBUG [clojure-lsp.server:?] - :didOpen 4525ms
2021-11-25T23:18:09.335Z  DEBUG [clojure-lsp.server:?] - :didClose 0ms
2021-11-25T23:18:09.336Z  DEBUG [clojure-lsp.server:?] - :documentSymbol 0ms
2021-11-25T23:18:09.336Z  DEBUG [clojure-lsp.server:?] - :documentHighlight 0ms
2021-11-25T23:18:09.336Z  DEBUG [clojure-lsp.server:?] - :definition 0ms
2021-11-25T23:18:09.337Z  DEBUG [clojure-lsp.server:?] - :documentSymbol 1ms
2021-11-25T23:18:09.346Z  DEBUG [clojure-lsp.server:?] - :codeAction 9ms
2021-11-25T23:18:09.776Z  DEBUG [clojure-lsp.server:?] - :codeAction 440ms
2021-11-25T23:18:09.785Z  DEBUG [clojure-lsp.server:?] - :codeAction 450ms
2021-11-25T23:18:12.028Z  DEBUG [clojure-lsp.server:?] - :didClose 0ms
2021-11-25T23:18:12.029Z  DEBUG [clojure-lsp.server:?] - :documentSymbol 1ms

emccue23:11:15

so far its working. im going to keep switching files until it hangs again

emccue23:11:31

and yep, now its hanging again and also calva wont open the log file again

emccue23:11:15

let me make sure i keep that window up while hopping around

emccue23:11:46

okay confirmed nothing interesting looking in the log when it hangs

2021-11-25T23:25:44.493Z  DEBUG [clojure-lsp.server:?] - :codeAction 10ms
2021-11-25T23:25:45.080Z  DEBUG [clojure-lsp.server:?] - :codeAction 388ms
2021-11-25T23:25:45.830Z  DEBUG [clojure-lsp.server:?] - :documentSymbol 1ms
2021-11-25T23:25:48.452Z  DEBUG [clojure-lsp.server:?] - :didOpen 2571ms
2021-11-25T23:25:48.483Z  DEBUG [clojure-lsp.server:?] - :definition 0ms
2021-11-25T23:25:48.483Z  DEBUG [clojure-lsp.server:?] - :hover 0ms
2021-11-25T23:25:48.483Z  DEBUG [clojure-lsp.server:?] - :documentSymbol 0ms
2021-11-25T23:25:48.490Z  DEBUG [clojure-lsp.server:?] - :codeAction 7ms
2021-11-25T23:25:48.586Z  DEBUG [clojure-lsp.server:?] - :definition 0ms
2021-11-25T23:25:48.736Z  DEBUG [clojure-lsp.server:?] - :hover 0ms
2021-11-25T23:25:48.848Z  DEBUG [clojure-lsp.server:?] - :codeAction 7ms
2021-11-25T23:25:49.092Z  DEBUG [clojure-lsp.server:?] - :documentHighlight 0ms
2021-11-25T23:25:49.195Z  DEBUG [clojure-lsp.server:?] - :definition 0ms
2021-11-25T23:25:49.532Z  DEBUG [clojure-lsp.server:?] - :references 328ms
2021-11-25T23:25:49.601Z  DEBUG [clojure-lsp.server:?] - :codeAction 12ms
2021-11-25T23:25:49.614Z  DEBUG [clojure-lsp.server:?] - :codeAction 293ms
2021-11-25T23:25:50.199Z  DEBUG [clojure-lsp.server:?] - :codeAction 361ms
2021-11-25T23:25:52.747Z  DEBUG [clojure-lsp.server:?] - :definition 105ms

emccue23:11:17

except maybe that definition 0ms - that could be an exception or something

ericdallo23:11:14

That first exception is just trash, I need to suppress that to fix it. That definition taking 0ms is weird but there is no error indeed

ericdallo23:11:37

Is it possible to you make a simple repro repo where it happens the issue? So I can test it

emccue23:11:32

that is a good question

emccue23:11:47

i have no doubt that if i make an empty deps.edn project it will work just fine

emccue23:11:33

i do have a leftover project.clj file that we are using just to run our sass builds

(defproject ic "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.10.1"]]
  :uberjar-name "ic-standalone.jar"

  :plugins [[deraen/lein-sass4clj "0.3.1"]]

  :sass {:target-path  "resources/public/css"
         :output-style :compressed
         :source-map   false
         :source-paths ["resources/sass"]})

emccue23:11:54

so maybe thats it?

ericdallo00:11:56

Na, I don't think so, so the definition works or doesn't, there is no time when the definition takes more than X seconds but loads successfully?

emccue18:11:46

it seems to work itself out kinda if i leave the editor on long enough