Is this currently supposed to work only using a development version of SC?
I am asking cause when I try to start my development version it throws “Interpreter has crashed or stopped forcefully. [Exit code: 6]” So I am not sure this would be related to " Command ‘SuperCollider: Update LanguageServer.quark to most recent supported version.’ resulted in an error" in VSCode. If anyone has fixed a similar issue please let me know, btw, I tried to install also the quark manually in SC my stable version but it wont work at all. My settings in json file of the VSCode is below:
I believe you need it, yea. It also makes sense to consider utilizing an alternative configuration YAML file for vscode, adding the Language Server quark extension. This will help prevent conflicts when working with the IDE again.
While the current lsp is relatively basic, it holds significant potential. It’s nice to have this going forward.
Okay, so the problem then stands firstly from the fact that my development version of SC is not initializing right. Is there a workaround at this point?
No, if you have the language server quark on your yaml config, it’s fine. It’s ust inconvenient to switch back to the ide. If you also have a dev build of sc, I don’t know what’s wrong.
you can try to use the -l argument to sclang, just an idea… maybe something like this? idk
I followed the installation instructions linked in the first post in this thread, but I got an error after sclang boots by opening my working folder /Users/prko/Dropbox/prko/__myDocs/Writings/Making Sound using Open Sources/mixed/SuperCollider.app/Contents/Resources/HelpSource/Tutorials/aKoreanGuide/. The yaml file is the same as the yaml file which SC-IDE uses: /Users/prko/Library/Application Support/SuperCollider/sclang_conf.yaml
How can I solve the problem?
Found 855 primitives.
Compiling directory '/Users/prko/Dropbox/prko/__myDocs/Writings/Making Sound using Open Sources/mixed/SuperCollider.app/Contents/Resources/SCClassLibrary'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/Extensions'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/SCLOrkSynths'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/MathLib'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/TuningLib'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/PitchCircle'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/PitchShiftPA'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwSpeedLim'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/webRTCgui'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ExtraWindows'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/SignalBox'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/crucial-library'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwCommon'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwPrototype'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwGUIEnhancements'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwMixerChannel'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwPatterns'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwTemperament'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwEQ'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwMIDI'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwPeakMonitor'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwSensitivity'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwStatusBox'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwVoicer'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/dewdrop_lib'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Freesound'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Morse'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Collapse'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/panola'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/OSequence'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Singleton'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/BandSplitter'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/WindowViewRecall'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/magnituderesponseview'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/redGrain'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/turtle'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/redMst'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/redSampler'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/TabbedView2_QT'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/TabbedView2'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/redSys'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/redUniverse'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/AmbIEM'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Canvas3D'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/SCAnimation'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/scgraph'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Dimple'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/JITLibExtensions'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/KtlLoop'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/KeyPlayer'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ixiViews'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwWavetableSynth'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/miSCellaneous_lib'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/cycle'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Ctk'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/XML'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Wavesets'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwChucklib'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ddwTimeline'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/SafetyNet'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/fosc'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/MusicalNotation'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/wslib'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/BBCut'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/DayTimer'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/IconSet'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Convolve'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/KDTree'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/SuperSampler'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/lfsaw.de'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/NetLib'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/NB'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/SampleTools'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/orb'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/json'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/LineAndPlaneGeometry'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/VuView'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/dmx'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Fomus'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/adclib'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/FreeAfter'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Spectrogram'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Require'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/ServerTools'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Strang'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Notator'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/rd_dot'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/sc3-dot'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/scparco'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/say'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Log'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/UnitTest2'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/Deferred'
Compiling directory '/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/LanguageServer'
numentries = 3551054 / 105770112 = 0.034
15162 method selectors, 6976 classes
method table size 81317320 bytes, big table size 846160896
Number of Symbols 38850
Byte Code Size 1713395
compiled 1965 files in 2.86 seconds
Info: 77 methods are currently overwritten by extensions. To see which, execute:
MethodOverride.printAll
compile done
localhost : setting clientID to 0.
internal : setting clientID to 0.
Safety('internal') enabled.
Safety('localhost') enabled.
// Butz.curr is Butz('top').
Class tree inited in 1.86 seconds
Safety('localhost') disabled.
Ctk init class runs
ERROR: Message 'addRawRecvFunc' not understood.
Perhaps you misspelled 'addOSCRecvFunc', or meant to call 'addRawRecvFunc' on another receiver?
RECEIVER:
Instance of Main { (0x128130058, gc=CC, fmt=00, flg=00, set=04)
instance variables [11]
classVars : instance of Array (0x138264a40, size=1285, set=11)
interpreter : instance of Interpreter (0x128130428, size=30, set=5)
curThread : instance of Thread (0x128130188, size=28, set=5)
mainThread : instance of Thread (0x128130188, size=28, set=5)
schedulerQueue : instance of Array (0x17857b5c0, size=1, set=12)
nowExecutingPath : nil
platform : instance of OSXPlatform (0x128130868, size=9, set=4)
argv : nil
recvOSCfunc : nil
prRecvOSCFunc : nil
openPorts : instance of Set (0x13815d5b8, size=2, set=2)
}
ARGS:
Instance of Function { (0x17832b0e8, gc=C8, fmt=00, flg=00, set=02)
instance variables [2]
def : instance of FunctionDef in Method LSPConnection:start
context : Frame (0x170ad6c38) of LSPConnection:start
}
CALL STACK:
DoesNotUnderstandError:reportError
arg this = <instance of DoesNotUnderstandError>
Nil:handleError
arg this = nil
arg error = <instance of DoesNotUnderstandError>
Thread:handleError
arg this = <instance of Thread>
arg error = <instance of DoesNotUnderstandError>
Object:throw
arg this = <instance of DoesNotUnderstandError>
Object:doesNotUnderstand
arg this = <instance of Main>
arg selector = 'addRawRecvFunc'
arg args = [*1]
LSPConnection:start
arg this = <instance of LSPConnection>
< FunctionDef in Method Meta_LSPConnection:initClass > (no arguments or variables)
Function:doOnStartUp
arg this = <instance of Function>
ArrayedCollection:do
arg this = [*50]
arg function = <instance of Function>
var i = 24
List:do
arg this = <instance of List>
arg function = <instance of Function>
Meta_StartUp:run
arg this = <instance of Meta_StartUp>
Main:startup
arg this = <instance of Main>
var didWarnOverwrite = false
^^ ERROR: Message 'addRawRecvFunc' not understood.
Perhaps you misspelled 'addOSCRecvFunc', or meant to call 'addRawRecvFunc' on another receiver?
RECEIVER: a Main
After installing SuperCollider extension for vscode, SuperCollider IDE cannot compile sclang library due to duplicated class:
ERROR: duplicate Class found: 'Document'
/Users/prko/Dropbox/prko/__myDocs/Writings/Making Sound using Open Sources/mixed/SuperCollider.app/Contents/Resources/SCClassLibrary/scide_scqt/ScIDE.sc
/Users/prko/Library/Application Support/SuperCollider/downloaded-quarks/LanguageServer/LSPDocument.sc
ERROR: There is a discrepancy.
numClassDeps 3491 gNumClasses 6980
I should have two yaml files: one for SC-IDE, one for VSCode Language Server Protocol support.
One thing I did not mention:
I should test it with SuperCollider 3.13.0, because the linked development version in the read.me crashed with the following error
Interpreter has crashed or stopped forcefully. [Exit code: 6]
"supercollider.sclangCmd": "/Users/prko/Dropbox/prko/__myDocs/Writings/Making Sound using Open Sources/mixed/SuperCollider.app/Contents/MacOS/sclang -l /Users/prko/Library/Application Support/SuperCollider/sclang_conf_vscode.yaml",
From your earlier post it looks like you’re using sclang from the development build, but asking it to compile the class library from the non-development build. Don’t do that. Use the class library from the dev build.
Then I removed all folders and files under Platform.userAppSupportDir. There is no Platform.systemAppSupportDir on my MacOS.
When this build is started, the SuperCollider IDE posts to the Post window:
Interpreter has crashed or stopped forcefully. [Exit code: 6]
And on VSCode, nothing happens when trying to use it.
Summary:
Attempting to use SuperCollider VSCode / Language Server Protocol support with SC3.13.0
in VSCode and VSCodium:
^^ ERROR: Message 'addRawRecvFunc' not understood.
Perhaps you misspelled 'addOSCRecvFunc', or meant to call 'addRawRecvFunc' on another
receiver?
RECEIVER: a Main
in SC-IDE: sclang works properly.
Trying to use SuperCollider VSCode / Language Server Protocol support with the latest build of the development branch
(build name: SC-45a103c15f487243a84436c4aee4a05fcc1a5a3d.dmg)
in VSCode and VSCodium: nothing happens
in SC-IDE: results in the following error:
Interpreter has crashed or stopped forcefully. [Exit code: 6]
I ran into this the other day and until it is fixed my hacky solution just to get it running was to copy the missing lib files over from an older version of SC (if you explore in SuperCollider/Contents/Frameworks…)
Just copying the missing libraries won’t work since the loader path from libsndfile still points to an arbitrary path outside the bundle. You would need to also replace the libsndfile dylib itself since the one in the 3.13 has the correct loader paths. @prko you probably could try that, I would suggest anyway moving to a new thread if you still have issues since this problem seems no longer about VSC LSP support.
Now the development version works again and it runs in vscode too!
I have two questions:
What hotkey do you use to open a help document? Currently I use ctrl + alt + d. I would like to know if there is a more common hotkey that is preferred by advanced users.
Currently sclang starts automatically when I open an SCD file. However, I could not find a shortcut to recompile sclang. How do I do this?
Sorry for these questions. It is not easy for me to use an editor other than SC-IDE for sclang…
There’s a command “Restart sclang” which will restart your sclang instance (this, of course, recompiles also). I don’t currently have a command to ONLY recompile without restarting, as this workflow is difficult to implement in VSCode - but restarting only takes a second or so longer than recompiling, so this is really more of a nice-to-have feature.
IIRC the standard Cmd+D help key from the ScIDE is used by VSCode for some other common operation - you can always overwrite this key combo if you don’t care about the VSCode default.
Also, fwiw: the current behavior when VSCode is unable to connect to sclang because e.g. of a compile error is a LITTLE rough around the edges. In case of a compile error or sclang for some reason becoming unresponsive, “Restart sclang” command will eventually force-restart the sclang instance. Sometimes, it might take a few seconds due to waiting for time-outs, and sometimes you might have to restart a second time before it works. I’d like to improve this in the future: disconnecting / reconnecting a language server in VSCode is very undocumented, so it’s a lot of trial and error to get the behavior right.
BTW: I’ve been supporting this effort by using vscodium for non-production SC noodling (e.g. hacking at code examples for the forum) and, where I see something dodgy in the language server, if I can find it then I’ll put in a PR to fix it. I’m up to 4 PRs, for little things that scztt now won’t have to debug. I imagine others could do the same.
Almost overlooked this… the one debugging feature in sclang that requires recompiling without quitting and relaunching the process is Process.tailCallOptimize = false; – agreed that this is only nice to have, but, I have occasionally run into some cases where tail call optimization obscured the code path, and it was nice to be able to run the code without that optimization.
Probably the solution for vscode, though, would be to set the flag at startup rather than interactively: a commandline switch, or an option in the language config file. My gut feeling is that the commandline switch might be better: I can’t think of a good reason to disable tail call optimization permanently, and it would be less convenient to switch it on and off in a json file.
I’m joining this discussion and have thoroughly read through all the details. First off, I’d like to express my appreciation for the LSP support—it’s a fantastic development, so thank you for that!
I’ve been attempting to install the VSCode extension, carefully following the provided guidelines. However, I’ve encountered an issue during the extension’s activation phase (when installing the LanguageServer.quark). Below is the error message that appears in VSCode:
Additionally, the VSCode exthost.log is showing the following error (I can share the full log if needed):
2024-02-27 15:48:54.038 [error] Activating extension Scott Carver.vscode-supercollider failed due to an error:
2024-02-27 15:48:54.038 [error] Error: \\?\c:\Portableapps\VSCode 1.86.2\data\extensions\scott carver.vscode-supercollider-0.0.2\node_modules\@vscode\windows-registry\build\Release\winregistry.node is not a valid Win32 application.
\\?\c:\Portableapps\VSCode 1.86.2\data\extensions\scott carver.vscode-supercollider-0.0.2\node_modules\@vscode\windows-registry\build\Release\winregistry.node
at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:2131)
at Object.<anonymous> (node:internal/modules/cjs/loader:1403:18)
[...additional log content...]
Has anyone else experienced this issue, or does anyone have suggestions on how to resolve it? Any assistance would be greatly appreciated!