Fork me on GitHub
Geoffrey Gaillard08:05:12

Hello! My vscode window crashes regularly. I suspect clojure-lsp suggestions or documentation on hover, or a calva related feature. I disabled every extension but calva. How may I diagnose these crashes?

👍 1
Pragyan Tripathi09:05:45

I have been facing the similar issues with vscode and calva.


What platform are you running it on and what version is it? If you disable Calva, is it more stable?


(I have VS Code open for days with Calva and several other "big" extensions and it never crashes -- macOS 10.12 and VS Code 1.67.2 and Calva v2.0.275, but I'm just about to update to .276)


VS Code has crashed on me once, ever. I juggle on average 6-8 VS Code windows, each with their own Calva + clojure-lsp running. Not saying this isn't Calva or clojure-lsp, but there must be something special happening. Not that I have a clue about what it could be. When did this start to happen? Is it the window that crashes or the whole VS Code? (You can test this by having a separate VS Code window open and see if that one crashes together with the one where you use Calva.) Since you suspect documentation hovers, could it be some special var you are hovering? Could be something there that makes Calva or clojure-lsp to croak.

Geoffrey Gaillard17:05:46

Thank you for your answers 🙂 • On macOS 11.6.5, vscode 1.67.2, calva 2.0.276. • Yes it is more stable if I disable calva. It is stable if calva is enabled but clojure-lsp is stopped. • It started to happen 5 days ago. • The window is crashing, not the whole VS Code. • It happens on any vars, randomly. Is there a way to get a crash report for the window?


clojure-lsp is a separated process from editor, I never saw a editor crash because of this external process with issues (if any)


Very strange. Check the clojure-lsp logs after the crashes and see what's being logged last thing. Maybe we can see some pattern to it.

Geoffrey Gaillard14:05:07

This is not a calva nor clojure-lsp bug. The bug is triggered when clojure-lsp is running in my vscode instance, but the issue itself is in the electron renderer. I don't think clojure-lsp is responsible for it. It could be anything, like corrupted cache files or font rendering issues, for instance.

☝️ 1

First, thanks to the Calva devs! Second, any recommendations for interacting with Calva from the command line? Perhaps it defeats the purpose of Calva… Looking to automate a fullstack dev boot.


	clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.9.0"},cider/cider-nrepl {:mvn/version,"0.27.4"}}}' -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"

	calva.loadfile(...) ?


I don't know of a way to do that. Could a be of use maybe? It has a badly named afterCLJReplJackInCode option that will allow you to run code once the Clojure REPL has been connected.

❤️ 1

Thanks, pez. Will look into it


👋 hi, thank you Calva devs! I’m super impressed. Can someone clue me in as to why the REPL output would display ; Error printing return value (ExceptionInfo) at ... — what’s up with “error printing return value”?


it’s a fairly vanilla ExceptionInfo object… could it have something to do with the data map attached to the object? Maybe there’s an unprintable value in the map?


I get those at times, not just with ExceptionInfo objects. Never investigated what it could be about because it always happens when I need to focus on something else, I guess. Does it matter if you have pretty printing enabled or not?


I didn't know pretty printing was a thing. I'll try toggling it to see what happens. Thanks!


Doesn’t seem to make a difference


My guess is that maybe this is happening if the result of the form that’s evaluated is a lazy seq, and while it’s being realized for printing by the REPL, an exception is thrown out


If that’s right then perhaps the error message could be improved, because Error printing return value (ExceptionInfo) at … made me think that the return value itself was itself an ExceptionInfo object. So perhaps instead if could be something like Error printing return value (an ExceptionInfo was thrown while printing) at…


Issue welcome. PR too. 😃


:thumbsup: An issue, I can do. A PR, probably not any time soon. 🙃 Issue coming soon — thanks!!

🙏 1

This post mentions this error, though idk if it’s helpful to you: > Here a new thing: Error printing return value. it’s not a Execution error anymore. The code was executed, and returns a value. clojure.core/map returns a lazy-seq, and when the printer tryies to print the result, it throws. It seems your guess it correct.


Thanks for checking that up, @U9A1RLFNV! I did wonder why I had no clue about this error message. Generally, I think some way to help with understanding upstream error messages would be great. No idea how to do it, though. 😃

👍 1

Thanks Brandon!

👍 1