Thanks for the update! Good timing too, I was driving myself mad trying to get into the works of VSCode extensions. I got it working on windows 11 64 bit with only a few adjustments.
First, for those who are trying to install it, here’s my neurotic/pedantic process.
-1. Get nvm-windows and git for windows.
-
Reboot, I suppose.
-
Install SC 3.13.0 via the windows exe. Don’t run it yet
-
Download the dev build that comes with SC and copy/replace all the files in \Program Files\SuperCollider (you can choose the name when installing the exe in step 1)
-
Run it the first time as administrator. Then reload, it replaces the help files. It will be right when the default help says 3.14-dev. Compile some code, run the server, try to install some quarks. Add supernova + scsynth.exe to the windows defender exclusion list. Honestly, reboot to be safe. I’m not saying these are necessary steps, but it certainly rules out my trust issues with SC now that I’ve seen how stable it is.
3.5. Reboot again, I suppose
- Install the VSIX
At this point, the windows registry module causes some complaints that can be observed on the dev console of vscode
- Navigate to
C:\Users\[you]\.vscode\extensions\scott carver.vscode-supercollider-0.0.3
- Delete node_modules. Open a terminal in the main directory of the extension (right click → Open in Terminal) and run:
npm install
- This will have a ton of complaints about vulnerabilities. These don’t break anything, but you might feel better about your life if you run:
npm audit fix
You can also run it with the --force tag, it did not seem to break anything. I did revert to the original package.json and package-lock.json just to be sure about the dependencies. --force pushes all necessary updates that audit finds, so it could push a non-backwards-compatible one.
- Open regedit. We have to find the correct SC registry entry. The correct one will point to the Program Files directory of SC. It could vary on Windows, but on my Windows 11 it was:
HKEY_CURRENT_USER\Software\SuperCollider\3.13.0
- Go back to the extension’s directory folder. Navigate to
\out\util\defaults.js
Open this file and edit the field of line 44 col 72 that puts together the registry address. I had to change Current Version to 3.13.0 and HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER.
I’m not the most familiar with Typescript, but I believe since these files are compiled from TS, changing them is fine. You don’t have to rebuild the plugin with said changes.
-
Edit the paths in User Preferences to find a copy of your yaml config and sclang.exe. (basically follow scztt’s instructions from here)
-
You should be good to use the command palette in VSCode to install the Language Server quark. It failed on me the first time, but was fine the second time. It ran silently, so I was confused, but it then loaded up the next time I opened a .scd file.
-
Try booting the server and running code and making a synthdef. Check the output of the dev console in vscode to see if anything is failing. If not, you did it!
So, here are the existing issues that I found.
- The vscode\windows-registry module that installs by default is not up to date with the package.json.
- It seems like a lot more showed up in the node_modules folder after I cleared it and did a fresh install
- The Supercollider registry entry has a hardcoded version number and is in the wrong parent category as the scripts are trying to find, causing crashes.
- I don’t know why it’s bothering with the Win Registry search. It’s an easy fix but I don’t know if/how that changes with other windows versions
- SC’s windows dev build instructions are unclear and should really come with an installer. If you’re not supposed to overwrite the files of 3.13.0, that should be clear. I don’t believe this causes a problem other than that the SC version tends to point towards 3.13.0 sometimes. So, this is an SC development issue. I tried to build an exe on windows but some of the dependencies were unclear and the build guide is super out-of-date. And the DX sound libraries were failing to install on win 11.
And a new problem that seems to be unrelated to the problems I previously encountered:
While the sclang command shortcuts work fine, the evaluate block message that you can click physically above a region is broken.
Clicking a region of
(
postln("hello world")
)
causes the following error
ERROR: syntax error, unexpected end of file, expecting DOTDOT or ':' or ',' or ')'
in interpreted text
line 5 char 1:
-----------------------------------
ERROR: Command line parse failed
I tried debugging this and I wasn’t able to find the solution. Essentially, when that evaluate message is clicked, the closing parenthesis is left out. When the same command is executed via shortcut, the closing parenthesis is included. That’s what I inferred from the following debug logs.
Clicking Evaluate Region:
{"id": 18,"result": [{"range": {"start": {"line": 0,"depth": 0,"character": 0},"end": {"character": 0,"line": 2}},"command": {"title": "▶ Evaluate block","command": "supercollider.evaluateSelection","arguments": [{"start": {"line": 0,"depth": 0,"character": 0},"end": {"character": 0,"line": 2}}]}}]}
{"jsonrpc":"2.0","id":19,"method":"textDocument/evaluateSelection","params":{"textDocument":{"uri":"file:///c%3A/Users/Hamish/Documents/sc/test2.scd"},"sourceCode":"(\r\n postln(\"hello world\")\r\n"}}
ctrl enter:
{"id": 22,"result": [{"range": {"start": {"line": 0,"depth": 0,"character": 0},"end": {"character": 0,"line": 2}},"command": {"title": "▶ Evaluate block","command": "supercollider.evaluateSelection","arguments": [{"start": {"line": 0,"depth": 0,"character": 0},"end": {"character": 0,"line": 2}}]}}]}
{"jsonrpc":"2.0","id":23,"method":"textDocument/evaluateSelection","params":{"textDocument":{"uri":"file:///c%3A/Users/Hamish/Documents/sc/test2.scd"},"sourceCode":"(\r\n postln(\"hello world\")\r\n)"}}