I just followed the ‘How to install’ instructions on the github - I don’t see a useGlobalStartupFile
or useWorkspaceStartupFile
option in the in the palette settings when I search for supercollider. Do I need to follow the build instructions under ‘Development’ section of the github to access the features you’re talking about?
I was facing the exact same issue due to a mismatch between the VSCode extension (v0.03) and the latest Language Server quark version. I solved it by using the version of the Language Server quark embedded in the VSCode extension once installed (I am using VSCode on Windows with a remote SSH tunnel to a Mini-PC running Arch Linux):
cp -r ~/.vscode-server/extensions/scott carver.vscode-supercollider-0.0.3/LanguageServer.quark/ ~/.local/share/SuperCollider/downloaded-quarks
mv ~/.local/share/SuperCollider/downloaded-quarks/LanguageServer.quark ~/.local/share/SuperCollider/downloaded-quarks/LanguageServer
These commands are for Linux, but there should be a similar setup on MacOS.
Afterwards, when starting sclang
, I then faced another error related to extString.sc
, which I simply replaced with the latest version of the Language Server quark repo (this one).
Everything is now working apart from the Go to Declarations / Implementations / References
which are not working at all. Go to Definition
is working well though.
Hope this helps!
Hey Asher - I fixed the issue you were seeing. You can pull the latest LanguageServer quark and, if you want, get the latest vscode extension as well (Update publisher id · scztt/vscode-supercollider@76c1cba · GitHub). Let me know if you see startup files working again,
What was the error you saw with urlDecode
? The old version you’re using is very likely to cause other problem.
Also, all of the “Go to” actions should work as expected with the newest language server and vscode plugin. If you’re up to date, try setting the log level to “Info” (the setting supercollider.languageServerLogLevel
), and then try using one of the command that isn’t working and post the log, I can try to see what’s going on?
Hey Scott,
Thanks a lot for fixing the issue.
-
The error related to
extString.sc
was something aroundreplacements
variable not being defined (this is solved anyway with the latest VSCode extension you mentioned above - see below). -
There is a typo in the latest extension on GitHub (file extension should be
.vsix
instead of.visx
). -
After uninstalling the VSCode extension and the quarks, reinstalling the latest extension and using the
Supercollider: Update LanguageServer.quark to most recent supported version
command, everything works well (including loading thestartup.scd
file and the “Go to” actions) but I am still getting the warnings @asher described above:
WARNING: Extension in '/home/ayalavalva/.local/share/SuperCollider/downloaded-quarks/LanguageServer/Providers/InitializeProvider.sc' overwrites Main:startup in main class library.
WARNING: Extension in '/home/ayalavalva/.local/share/SuperCollider/downloaded-quarks/LanguageServer/Providers/InitializeProvider.sc' overwrites Platform:startupFiles in main class library.
WARNING: Extension in '/home/ayalavalva/.local/share/SuperCollider/downloaded-quarks/LanguageServer/SystemOverrides/extServer.sc' overwrites Meta_Server:fromName in main class library.
WARNING: Extension in '/home/ayalavalva/.local/share/SuperCollider/downloaded-quarks/LanguageServer/SystemOverrides/extServer.sc' overwrites Server:addr_ in main class library.
Intentional overwrites must be put in a 'SystemOverwrites' subfolder.
Renaming the SystemOverrides
folder into SystemOverwrites
, and placing the file InitializeProvider.sc
into that folder gets rid of these warnings.
- I am also receiving this last warning:
*** 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***
[LANGUAGESERVER.QUARK] suggestedServerPortRange: nil
SCDoc: Indexing help-files...
SCDoc: Indexed 1997 documents in 0.65 seconds
[LANGUAGESERVER.QUARK] Overwriting provider for method 'initialize' <-- this one
Deferred(-418090460)
Booting server 'localhost' on address 127.0.0.1:57110.
Let me know if you need me to provide additional details.
Hey @ayalavalva, thanks for the super detailed reports. I believe all of these issues are now resolved in the latest LanguageServer quark + vscode extension.
I won’t publish an official version bump for the LanguageServer / vscode plugin yet, but there are some interesting changes in the newest builds of each:
- I finally had time to fully merge Jens Haase’s great server status view to the VSCode plugin. Current builds will now show:
This can be hidden via the normal vscode mechanism (right-click on the status bar). In addition, there’s a new setting that allows you to configure the string thats displayed in the status bar. For example:☐ SUPERCOLLIDER ☐ CPU: ${peakCPU}% ☐ SYNTHS: ${numSynths} ☐
shows:
Clicking the status indicator will boot the server. Jens’ original change allowed killing the server by clicking on the status indicator - but I found that it was very easy to accidentally (or unknowingly) click it and kill the server while I was working. This feels too risky for e.g. a performance context, so I left it out for now.
-
The behavior around restarting the language, compile errors, crashes, etc. should be drastically improved now. In all cases I’ve tested, the “restart sclang” command now works immediately rather than e.g. waiting for timeouts or simply not working at all.
-
Every VSCode workspace has it’s own sclang instance. This can easily create server collisions, since the default server port is hard coded. Now, the VSCode plugin has a “Auto Allocate Server Ports” option (this defaults to enabled) that will suggest an unused server port to the LanguageServer, to avoid collisions. Note that it’s not doing anything particularly smart (for the time being) regarding e.g. checking for port availability or detecting errors, it’s just allocating different port numbers for each workspace. In the end this should be transparent to the user, except that opening multiple SuperCollider workspaces should just work.
-
I’ve been experimenting with improved error / backtrace reports in the language server. The eventual goal here would be to formalize the LSP reports in a way that could be more intelligently displayed by an IDE. The changes for now are mostly small aesthetic things, but IMO it does represent incremental improvements over the build-in class lib error reporting. This can be enabled via the “Improved Error Reports” option (this requires a language restart as well).
Newest vscode extension build is here:
Language Server can be updated via Quarks.update("https://github.com/scztt/LanguageServer.quark")
Thanks all for the great bug reports - I’ve been able to address many but not all. Hopefully the newer builds are feeling more stable and usable.
A more general question: would it be useful some time for me to do a ~1 hr interactive video session, to walk through basic setup and use of the VSCode plugin and answer questions / help people out, etc?
And, if so, is there someone using the plugin on Windows and/or Linux that would be willing to be on hand to triage questions for those platforms?
Feel free to just like this post if you are interested.
Thank you! I was able to update to the latest build and LanguageServer and now see the server status information. This is such a nice feature!
I am running into a problem that I’ve had in the past where the help documents are empty and white. I was able to fix that in the past by evaluating a SCDoc.renderAll
command in the SC-IDE but this time around it has no effect. I’d appreciate any suggestions to get my help docs back!
The docs load up fine in SC-IDE. I am running 3.14.0-dev.
edit: evaluating HelpBrowser.openBrowsePage;
in vs code does bring up the documentation in a new window. However command-D will open up a blank panel with supercollider.help
in the tab header.
another edit: it looks like there’s already an issue created in github, so at least it’s not unique to me
I’m preparing to release an alpha version of a new feature in the VSCode extension, which connects to VSCode’s existing Liveshare extension. Liveshare allows multiple users to share a single code workspace and do collaborative document editing in real-time - this feature already works well with the SuperCollider plugin, but is missing a critical piece: each user still has a separate local sclang
instance, and code is executed on their local instance.
This feature will (optionally) reroute code execution of liveshare guest users (people invited to the liveshare session) to the host’s sclang instance. In turn, all guest users will see a shared output stream of the host sclang instance. In practice, this means a group of users can cooperatively edit and run code on a single machine in real-time.
There are some cool use-cases here:
- Cooperative jam sessions: a group of users can all modify and execute code thats targeting the same sclang and server.
- Remote help: invite someone to a liveshare session, and they can not only see your code but execute things to help with e.g. debugging or diagnosing errors. This is especially valuable because there’s no need to reproduce the users exact configurations (quarks etc) in order to run their code.
- Remote control: a VSCode liveshare instance can be set up on e.g. an installation or performance machine across the room, which can be controlled remotely from another computer. This could be interesting to control an sclang instance running on a remote server also.
- Teaching: this is a simple workflow for students in a class context to collaborate on a single project, for instructors to interact with student code for help, or for students to e.g. run code on a shared classroom instance.
Excited about this one ----
BUT: I need some help testing this, since it’s obviously very annoying / unfeasable to test on a single machine by myself.
- I need someone who is comfortable with entry-level VSCode setup and debugging, to get the extension running locally and try some liveshare sessions with me.
- Further along, it would be nice to test this with a larger group. If anyone is teaching an SC class and would volunteer an hour some time to try it out with students, this could be ideal. We could also try out some kind of co-op jam session as well (but it’s a little easier to do this with people in the same place)
Please message me directly so we can coordinate! I’ll post more info when this feature gets a little further along.
This dynamic is fascinating in Google Docs. An important thing I notice when reviewing texts with other people, is knowing exactly where everyone’s cursor is, with the person’s name.
Yeah this is already super cool as I’ve been working on the LiveShare functionality, bc you can have two side-by-side code files, one for each person, and see the other person editing in real time.
Really awesome extension! I’ve gotten it to work for the most part, but I am running into one issue (on the latest build you linked above, build #33, not the latest “release”)…when I want to recompile, I try to choose the “restart sclang” action, but it just prints: “Cannot read properties of undefined (reading ‘dispose’)”. Any idea about how to fix that?
In the meantime I can just restart VSCode as a workaround, which restarts sclang as a side effect.
EDIT: Or just run sclang on the command line of course!
Hello,
Is it possible to share SCClassLibrary
folder inside in GitHub local repository
(eg.: ~/GitHub/SuperColliderRelated/supercollider) to the sclang
which is used as interpreter inside vscode
?
This would save a lot of time, I think.
I believe if you use the -a
flag for sclang, it will not automatically load the SCClassLibrary or extensions folder. This would mean you would specify the SCClassLibrary path yourself in your sclang_conf.yaml
file.
There’s a settings for the vscode plugin (Args) that will let you specify the -a
flag:
"supercollider.sclang.args": [
"-a"
],
If you only want to use a specific classlib for one project, you can specify the -a arg as a workspace setting, and enable the Supercollider › Sclang: Load Workspace Conf Yaml
option, which loads the conf yaml file from your current workspace if it exists (rather than the global one).