VSCode-supercollider Current State MacOS

Where can I find editor-specific folder (scide_vscode)?

you need to create this folder within the LanguageServer folder (in downloaded-quarks)

1 Like

Ah thanks! It works!

~/Library/Application Support/SuperCollider/downloaded-quarks/LanguageServer/scide_vscode/LSPDocument.sc

1 Like

Ah, I’ll make this change in the quark, I didn’t know this supported arbitrary ide names.
The Document class still desperately needs refactoring, there are some features that are broken or work weirdly in VSCode, but this definitely lowers the priority.

3 Likes

I tried that new folder idea, removed all extensions, reinstalled the quark. I still get this:

ERROR: Message ‘addRawRecvFunc’ not understood.
Perhaps you misspelled ‘addOSCRecvFunc’, or meant to call ‘addRawRecvFunc’ on another receiver?

If anyone had that issue and knows how to solve it I’d be super happy to try it.

It looks like you’ll need a newer build of SuperCollider - this feature was merged in April. Any of the recent green develop builds here: Workflow runs · supercollider/supercollider · GitHub should work.

Specifically, this is the most recent one I see: Merge pull request #6113 from dyfer/topic/storeOn-printOn ¡ supercollider/supercollider@a0644a7 ¡ GitHub

(builds are under “Artifacts” at the bottom)

ok I read that somewhere but as I had the tip of releases I thought it meant I was right… but in effect I need to be on the tip of the dev branch!

ohhhhhh you guys are on CI too for your dev branch! I’ll use that now. Is it stable and gig-ready?

1 Like

and it wooooorrkkkkkk!!!

(I resisted inserting here a Frankenstein gif. You are welcome.)

3 Likes

Usually a “stable” build has gone through some period of feature freeze and testing before release – which is what makes it stable. “Tip of dev” isn’t stable in this sense. But, practically speaking (and anecdotally), I’ve been running from dev for a long time and haven’t experienced any bad behavior from that (i.e. I haven’t been reverting to a tagged release for shows, without issue).

hjh

1 Like

Hi again Scott - there is a collision with API quark which I have been using (duplicate JSON class)- would it be worth adding API as a dependency rather than rolling your own? otherwise I can factor out methods I need perhaps…

ok I love it all thanks @scztt for the hard work on this. The one thing I miss now from SCIDE is the ability to autocomplete arguments with tab (especially in Fluid* land where we have LOADS of arguments so we are likely to use preset on many and need to skip to some further in the list)

Did I miss a shortcut or is it not implemented?

(oh I also miss not being able to execute example code from the help browser but that I can live with :slight_smile:

oooook I’ll stop giving love but HOW COULD I CODE WITHOUT VARIABLE AUTOCOMPLETE BEFORE!!!

(sorry for the love and enthusiasm - that feature is so useful in my other langages but I got use not to have it in SC - you know, you just gave me a gateway drug)

thanks again. I’ll stop the outpour of love for now

Can you file an issue with LanguageServer.quark so I remember? Right now, we have several different JSON read/write implementations in both the core and different quarks, each with their own quirks and bugs, so I found it safer to include my own here until there’s one “settled” implementation. I’ll test the version in API and either use that or rename the one in LanguageServer to something private so it doesn’t collide.

1 Like

Yes, the autocompete of function arguments is a bit different in VSCode, I’m not totally happy with it for usage in SuperCollider. What SHOULD work:

  • When you start typing a method invocation (after the first paren), e.g. SinOsc.ar(, you should see a popup with one or more method signatures, with all arguments and default values.
  • You can switch through these with the up/down arrow keys (minus: this is pretty inconvenient for cases where there’s a LOT of possible matching methods).
  • If you’re in the middle of typing a method call and you want to show the popup after it’s hidden, you want the “Trigger Parameter Hints” VSCode command - you can assign this to any keyboard shortcut you want.
  • If you don’t see parameter hints at all, they may be disabled - look in your vscode settings for “Parameter Hints” or editor.parameterHints.enabled
  • Parameter hints don’t work well for method calls that span multiple lines. This will be fixed in the future, but I need to access the parsed sclang code for this to work.
  • There’s a slightly different workflow for methods to: you should see a list of potential methods BEFORE you type the first paren, e.g. SinOsc.ar - you can select a method from the list and hit tab and you will get all the arguments pre-populated. You can tab through them and start typing immediately to replace the argument name with a value. (minus: it takes several extra keystrokes to remove an argument if you don’t want it at all, so complex method signatures are still annoying).
  • For really complex statements, you can create code snippets. The snippets system in VSCode is extremely sophisticated and customizable: Snippets in Visual Studio Code / Snippets — TextMate 1.x Manual. \
  • I plan to make it possible in the future for Quarks to provide their own snippets collections, and maybe to provide custom snippets / completions for specific methods. In the mean time, you might try making some snippets specifically for the Fluid classes - if these are helpful, they can get integrated for everyone to use eventually.
2 Likes

This still has some issues, unfortunately. If anyone has experience with javascript/typescript debugging, it should be relatively easy to fix - I can point in the right direction.

1 Like

Finally: if there are subtle improvements you can think of for e.g. method signatures, please let me know or experiment yourself. All of the implementation is in sclang code:

  1. The structure for method signature hints is here - I’ve implemented much, but not all, of the available functionality.
  2. The provider that supplies method argument hints is here - specifically this generates the response: https://github.com/scztt/LanguageServer.quark/blob/develop/Providers/SignatureHelpProvider.sc#L36
  3. The guts of the response, and the snippet that shows the arguments etc is generated here: https://github.com/scztt/LanguageServer.quark/blob/develop/LSPDatabase.sc#L310
1 Like

all of that is clear and some are improvement for me on SCIDE. but this is not what I was refering to.

In SCIDE, if you type SinOsc.ar( then if you hit tab, it autopopulates and skips, so 3 tabs will enter mul: - it is super convenient for methods that have huge number of arguments. That is what I miss - autocomplete of named arguments (if that is the way to call this)

sadly not. James Bradbury and @weefuzzy were the JS magicians I worked with. I’ll try to get through the next FluCoMa release without a team, then I’ll come back to help I hope.

thanks again for your development work (and patience!)

I just published a new version of the vscode plugin with some preliminary improvements to path handling. It would be super helpful if people could test to see how things are behaving, I think it’s a big improvement for the first-launch usability.

What has changed:

  1. We now have reasonable default values for the sclang_conf.yaml and sclang executable:
    https://github.com/scztt/vscode-supercollider/blob/develop/src/util/defaults.ts#L43
    https://github.com/scztt/vscode-supercollider/blob/develop/src/util/defaults.ts#L46
  2. If you do not have an explicit path specified in your vscode settings, the defaults will be used. For many users, this should never require explicit configuration at all.
  3. If an sclang executable is not detected, the user gets a coherent error message and has an option to find the executable with a file dialog. If this fails, they should be prompted again the next time they try to start sclang.
  4. If the user selects an sclang executable from the dialog box, this is written into the settings so they are not prompted in the future.

I don’t know if I got the paths correct on Windows and Linux - for sclang conf, I followed the behavior of SuperCollider itself.

What to test:

Obviously, be careful about preserving your working configuration so you can go back to it after testing :slight_smile:

  • Try removing the sclang.cmd and sclang.confYaml settings in vscode, and restarting VSCode. If you have SuperCollider installed in a normal, default location (e.g. “Program Files” on Windows), everything should work as expected.

  • Try moving your SuperCollider installation to a non-standard location. You should see a dialog when you try to launch sclang in VSCode - see if you can use the open file dialog to locate your sclang executable - everything should work after this.

  • Make sure manually setting a path for the sclang_conf and sclang executable still works correctly.

  • If you can, read through the linked source files above and see if the path logic matches what you see on your system - especially for Windows and Linux, where I don’t have as much knowledge about standard paths.

I’m super open to feedback here about what should happen. Ideally, a user that has a “default” installation of SuperCollider should not need to do any configuration at all, at at worse they’ll get a one-time request to find sclang, and then never see it again.

I’m also adding an option soon to pick up the sclang_conf from the local workspace, which means you can have per-workspace configurations.

2 Likes

do we have to install a new version of the quark too? it is in that folder that we had to change location of the infamous ‘document’ class def so I wonder if that has been changed.

if not no worried, I’ll update anyway :slight_smile:

It doesn’t on MacOS. When I remove both the error is:

Screenshot 2023-11-04 at 11.57.25

Otherwise I need to have a confYaml to avoid Document class conflicts with flucoma so I can’t help much.

it does indeed… but as above even in the normal location :slight_smile:

they do. thanks!

if the message was less ominous maybe - the zxxzx is what frightened me :slight_smile:

1 Like