Just a little overview of color related bugs, both in Documentation and otherwise:
Syntax highlighting colors are determined by the supercollider.tmLanguage.json file.
You can see WHY something in the editor is colored the way it is by running the Developer: Inspect Tokens and Scopes command, and then moving the cursor to the code in question. The textmate scopes value should correspond to something in the tmLanguage file, and the foreground color is from your theme (you can see the details of this by running Developer: Color Theme From Current Settings).
Compare SuperCollider highlighting in your theme to that of another language, e.g. Python or Javascript. If something in sclang is being highlighted in a way that seems inconsistent or weird, see if thereâs a better TextMate scope to use (this is easy-ish to change in the tmLanguage file). If you feel at all hacker-y, changing the tmLanguage file to find a better TM scope is easy, and making a pull request for a positive fix would be very helpful!
If the highlighting is simply misunderstanding the sclang code (e.g. itâs highlighting isnât just a wrong color, itâs understanding symbols incorrectly), itâs probably a problem the regex strings in the tmLanguage. Fixing these is a fun hacky evening project, but also tbh very annoying - Iâm happy to take PRâs on this but I donât blame you if you get frustrated.
Documentation color is a pain in the ass⌠The frontend.css file maps css selectors for the SuperCollider documentation to colors in the VSCode theme, so the docs match the theme. The vscode colors (things like --vscode-sideBarSectionHeader-foreground) correspond to the colors in your theme (again, Developer: Color Theme From Current Settings will show these). Theyâre all prefixed by --vscode and dots are converted to -.
Iâve spend VERY little time mapping sclang documentation colors to theme colors. If you see parts of the documentation that donât match your theme very well, I would love it if you can experiment with the frontend.css colors to see if you can find a better option. The Open Webview Developer Tools command can be helpful here, as it gives you a dev panel for the documentation, which should let you live-edit the CSS. Please try this with a few different themes to make sure the change is legible in a general way.
Code that is displayed in the sc documentation is even worse - SCDoc uses a javascript code component that has itâs OWN syntax highlighting. Ideally, I would set the highlighting of this code panel to something that matches your vscode theme, but I havenât gotten around to this. If someone figures out a good way to do this, it would be very helpful. I donât think itâs hard, probably just digging in the documentation a bit.
Probably this is not a you problem. Let me know a few specific links in the documentation that result in a white page? Or, if you want to try debugging the vscode plugin yourself - the documentation is literally running on a locally hosted web server, specified in help.ts in the launchServer function. A breakpoint on line 231 should let you see what the HTTP request from the documentation is, and maybe get a clue why itâs failing and resulting in a blank page.
I figured out why this is the case (at least for a couple of cases I am having), though I donât know the solution. It seems it is because the html file for the help doesnât exist and the VS Code version of SC doesnât automake it for you. Weird.
I was making a help file this morning. The help didnât work - white screen as described by @tremblap above. I opened SCIDE, looked up the help, and it worked. Went back to VSCode and it worked. I had been having the same issue with FluidLabelSet in VSCode. Went into IDE, opened the help, now it is all good in VS Code. In both cases the HTML file didnât exist in the Help directory until loading in the IDE. What might be the easy fix for this in VSCode? Is there a function that isnât being run properly?
just a quick note that I see this in SCNvim when using the String:help method - I get a âfile does not existâ or some such error. Completely intermittent, not sure why it works sometimes.
The help browser needs to call into sclang when a link is clicked, to render the target page. Itâs not enough to pop up a webpage; there needs to be a link handler. Iâm not sure exactly where in SC-IDE code this is done. The sclang GUI HelpBrowser does it with an onLinkActivated function. Probably this just hasnât been implemented in the VSCode plugin yet.
There are cmake files in the repository, suggesting that the build procedure is to use cmake to configure the build, then make (a familiar procedure if youâve built SC from source). After satisfying the dependencies, this went fine.
But I remembered what is the real problem with the code formatter: it depends on a two-way Pipe method which doesnât exist in the main SC distribution. It must be an extension that isnât currently public. So itâs not usable at present and thereâs no choice but to disable the formatter for now.
Thanks for the answer @jamshark70, but unfortunately I donât know what to make with this project at all (Readme doesnt seem to guide me enough, and I would need much more hand holding)
Just in any case, I found a hacky fix to avoid the annoying error in the log, which -I think- is basically disables the SC code formatter, by changing this line to false (I changed it under /Application Support/SuperCollider/downloaded-quarks/LanguageServer/Providers/TextDocumentFormattingProvider.sc)
At this point, itâs moot anyway because of the missing method thatâs called in CodeFormatter. Iâd suggest to wait until thatâs resolved (no idea how long that will take â source code for it isnât even publicly available for review yet).
IIRC the SuperCollider vscode plugin publishes a setting for the formatter to use; you should be able to disable it here as well.