Has anyone been able to open up a REPL to the vscode debug instance that you use when developing an extension? I have a basic setup where shadow-cljs compiles cljs to JS and I can load that to the debug instance but I miss repl.
I got it working. I didn’t realise that I had to first reload the the extension code in the debugger session and that creates the repl on the vscode side. Then I used Calva to connect to the shadow-cljs cljs repl and code evaluation works with vscode API. Without first activating the extension I just got an error message that no JS runtime was specified when I tried to eval any code
Not fully following, and I am super interested in this. Can you describe a bit step by step what you did? And also some more context. 😃
You probably have solved this already and it is totally clear for you after you see my example. Sorry for badly worded explanation 😄 I wanted to get REPL experience when developing vscode extensions with cljs. I documented the steps here: https://github.com/sauvala/cljs-vscode-extension. With this setup I was able to use REPL and the vscode extension api to develop it
Ah, i started to think you had got the vscode debugger working with CLJS, something I have almost, but not quite, had working. I’ve spent uncountable hours on it, because when developing VS Code extensions there is a lot of integration points, so the ratio impure/pure is quite high and I need a debugger more than in regular Clojure/ClojureScript development.
However, it is awesome that you’ve made that example repo with a great README to go with it. I’ve been wanting to demo the setup for the VS Code team, and this will come in perfect.
Getting the debugger to work would definitely be nice but I can image it’s not that easy 🙂
In theory it should just work. I don’t remember the details, but a culprit was that the source maps where not good enough, which might have been fixed since then.
Hmm okay. I just added (js-debugger)
to one of the functions and the debugger actually stopped there but it was some other file. It took some tries but finally the debugger stopped in the right file inside shadow-cljs’s cljs-runtime
folder
But it didn’t quite work right all the time
Ah, thanks for testing that. Even if it seems that it is as flaky as it used to be. 😃