Been using it for months. Not going back. The upside far outweighs the few rough edges left to smooth over.
Sam
Been using it for months. Not going back. The upside far outweighs the few rough edges left to smooth over.
Sam
Did you look and make some sense of the LSP code behind it? We should try to grasp it at some point. So we can start to improve and even write plugins.
Two weeks ago, I made my first change in another vscode extension to fit what I would prefer (Haskell-interactive) also to see how difficult that would be. It worked, simple changes, even though I had never coded in typescript before…
I agree with this suggestion – people who would like vscode to be a viable replacement for SC-IDE could move this forward by reporting and fixing bugs. The language server is even in sclang itself, so the entry barrier is relatively low. (The vscode plugin isn’t sclang, but the language server is.)
hjh
It is on my list of things to do. Hopefully I can get to it before school starts up again.
Sam
Better indentation will depend on scztt’s other tool, sclang-format, which I tried and failed to build.
This, btw, I have to amend – I did get it to build successfully, though I’m mired in end-of-semester tasks and won’t be able to do anything with it in the immediate future. Looking forward to seeing how that works.
hjh
The repo clang-formt depends on has moved. Also, install antlr
. That’s all you need, it seems.
cd external
git clone https://solitarybees.us/hadron/sparkler
cd ..
to install antlr
dependency, if on macos:
brew install antlr
To build (from the root of the sclang-format dir):
mkdir build
cd build
cmake ..
make
I did it.
./sclang-format -t /Users/prko/Downloads/test.scd
By pressing cmd + .
, I can return to terminal prompt:
Moreover, I do not understand why the following command does not work:
sclang-format -t /Users/prko/Downloads/test.scd
I don’t know, I think we need to ask Scott about it.
One thing you can try is to checkout the exact commit of the dependency:
cd external/sparkler
git checkout bd9d0df
cd ../..
And then build again (in this case, try a clean make with a new folder)
Done again, but same result! Anyway, thanks!
Moreover, I do not understand why the following command does not work:
This is about the Unix command shell’s PATH variable. Should be plenty of information online about it.
Certain paths are included by default in the list of locations that will be searched, to find the executable for a command. The build location for sclang-parser is naturally not one of these default locations, because no system could anticipate where you will put the repository. So you could add the path manually (see online documentation) or specify the path when running the command (which is implicitly what happens when you cd to the directory and run ./sclang-parser
). A final release of sclang-parser would include an “install” stage (as SC’s cmake configuration does) to copy the executable into a default location. But, as this is a pre-release tool, this hasn’t been done yet.
hjh
Moreover, I do not understand why the following command does not work:
sclang-format -t /Users/prko/Downloads/test.scd
@prko I did a quick test and it seems to work (it outputs something), it uses standard input and standard output. It does not have an “in place” option.
cat ~/scwork/my-file.scd | ./sclang-format
EDIT: If I’m not mistaken, I thought there was a convention for supercollider code to always indent with four spaces, not tabs. Is there such a convention, or that’s my imagination?
(sorry, I think I replied you in the wrong thread)
Thank you! The following code is for using tab instead of four white spaces.
cat ~/scwork/my-file.scd | ./sclang-format -t
If I’m not mistaken, I thought there was a convention for supercollider code to always indent with four spaces, not tabs. Is there such a convention, or that’s my imagination?
I cannot remember… Sorry!
But then tab indentation should be removed from SC-IDE preferences and other software in sclang format?
(sorry, I think I replied you in the wrong thread)
no problem! Thanks a lot!
If I’m not mistaken, I thought there was a convention for supercollider code to always indent with four spaces, not tabs.
I never heard of that. Even the ancient Cocoa SuperCollider.app used tabs.
Edit: There is a convention to use spaces for indentation in the c++ source files – this is enforced by the linter. But that doesn’t apply to .sc or .scd files.
hjh
I never heard of that. Even the ancient Cocoa SuperCollider.app used tabs.
Edit: There is a convention to use spaces for indentation in the c++ source files – this is enforced by the linter. But that doesn’t apply to .sc or .scd files.
Ah, yes, of course. The class library uses tabs, but there was never a convention. Even the scel lisp code in some places uses tabs, which is uncommon.
the confusion may come from this page in the wiki:
An audio server, programming language, and IDE for sound synthesis and algorithmic composition. - supercollider/supercollider
specifically this block at the end:
An audio server, programming language, and IDE for sound synthesis and algorithmic composition. - supercollider/supercollider
just scrolling down you find “indentation” and are instructed to use 4 spaces - its easy to miss that this in an “other files” heading (and then… does “other files” belong in a style guide that is otherwise entirely about sclang?
Also:
An audio server, programming language, and IDE for sound synthesis and algorithmic composition. - supercollider/supercollider
Rule: use tabs for indentation.
The SuperCollider class library uses tabs for indentation.
The indentation examples for SCD files on the same pages seem to use spaces.
Then a reasonable summary is:
The SuperCollider class library uses tabs for indentation,
but SuperCollider Document (*.SCD) uses four white spaces for indentation.
Am I correct?
The SuperCollider class library uses tabs for indentation,
but SuperCollider Document (*.SCD) uses four white spaces for indentation.
I don’t think it makes sense to have two different styles for SC code.
To be honest, I don’t care which one it ends up being. Vscode by default uses 4 spaces. SC-IDE uses tabs. I don’t really notice unless I copy some tabbed code from the forum into vscode, modify it and paste it back into the forum.
hjh
To be honest, I don’t care which one it ends up being. Vscode by default uses 4 spaces. SC-IDE uses tabs. I don’t really notice unless I copy some tabbed code from the forum into vscode, modify it and paste it back into the forum.
It’s because tabs are always set to 4 spaces. It’s very close to C, but unlike C, one never sees 2 or 8 spaces/tab, for example. So even if they are mixed up by different authors, it’s not so annoying. Also, SC code doesn’t try to do fancy alignment things like Lisp or Haskell, which works much better with spaces.
So, pretty much one doesn’t notice that much.
It would be very convenient if the result of the code evaluation could be displayed as a kind of slightly transparent, floating, scrollable window that surrounds the position of the mouse pointer; and that automatically disappears when the mouse pointer leaves the window. Users with goo eyecraft would not need this feature. It is an accessibility feature.
It would be very convenient if the result of the code evaluation could be displayed as a kind of slightly transparent, floating, scrollable window that surrounds the position of the mouse pointer; and that automatically disappears when the mouse pointer leaves the window.
I tried to do it by hacking the emacs mode, and it worked but I haven’t tested much.
(Can try to find it DM off-list me if you want)