vscode-supercollider icon indicating copy to clipboard operation
vscode-supercollider copied to clipboard

Linux / Windows: Restart sclang action gives error

Open chairbender opened this issue 10 months ago • 6 comments

PopOS 22.04 On this build: https://github.com/scztt/vscode-supercollider/actions/runs/12253938071 (haven't tried it on other builds) VScode 1.98.0 SC 3.14

Selecting the "Restart sclang" action gives an error in the console: “Cannot read properties of undefined (reading ‘dispose’)” and doesn't perform the restart. Restarting the IDE and reopening the project works around this. But would be really nice to recompile without restarting the IDE!

Various other commands for this extension work fine for me.

chairbender avatar Mar 09 '25 03:03 chairbender

Since I'm already setup for development on this repo + the LSP, I'll go ahead and take a look at this one!

EDIT: Oops! Looks like I got sucked into the sapf project for now, so anyone else feel free to take this one on.

chairbender avatar Mar 13 '25 04:03 chairbender

I BELIEVE I fixed this recently, you might grab the latest vsix and have a look? However, I can't easily test linux so it could still be a platform specific thing.

scztt avatar Mar 18 '25 12:03 scztt

Ah, I should've mentioned I also reproduced it on Windows. Still happening for me on Windows on the latest build (34).

chairbender avatar Mar 19 '25 03:03 chairbender

I can confirm that this issue occurs with the latest VSIX build (34).

My VSCode is running on Windows and is connected via Remote SSH to a Linux device running SuperCollider.

ayalavalva avatar Mar 20 '25 01:03 ayalavalva

FYI I debugged the extension locally since I realized it would probably take all of 5 minutes to figure out (meaning I shouldn't really have an excuse for not trying to fix it myself lol), and it happens in context.ts in SuperColliderContext.dispose. - this.serverPorts is undefined. I will submit a PR with the obvious fix but I don't have time to test super thoroughly.

chairbender avatar Mar 20 '25 02:03 chairbender

Yes, thank you @chairbender! The fix works as described!

This said, I still have a problem when evaluating thisProcess.recompile; which I use extensively in my startup.scd and used to work well with previous builds, but not with the latest one (34). With build 34, once evaluated, the recompile process stays stuck at:

*** Welcome to SuperCollider 3.14.0-dev. *** For help type ctrl-c ctrl-h (Emacs) or :SChelp (vim) or ctrl-U (sced/gedit).
***LSP READY***

... and then nothing happens. The workaround is to restart VSCode as for the current issue, so I am suspecting they might be related, but I can't be sure. I will open a new issue, anyway.

ayalavalva avatar Mar 20 '25 08:03 ayalavalva