crucialfelix / supercolliderjs

The JavaScript client library for SuperCollider
https://crucialfelix.github.io/supercolliderjs/
MIT License
472 stars 41 forks source link

Language Server Protocol for sclang #36

Open crucialfelix opened 6 years ago

crucialfelix commented 6 years ago

This would be a separate project. LSP (language server protocol) would mean that sclang can be connected to most IDEs (atom, vscode, emacs, vim) and would support:

Code completion | Hover | Jump to def | Workspace symbols | Find references | Stream reference results | Diagnostics

http://langserver.org/

My initial idea is to have supercollider dump a JSON file with all classes, methods and help strings (derived from the help files). A language server would answer requests using that dump as data. It could be written in go to make it more portable and easier to install.

widp commented 6 years ago

For anyone who wants to pick this up, I have a better idea. Communication like this has already been implemented in the Qt based IDE. It uses yaml and a custom protocol instead. The sc developers seem open to the idea of implementing lsp instead of that. Supercollider has enough introspection built in already to support these features. I'll probably try to implement this if I get the time, if I don't I hope someone will.

crucialfelix commented 6 years ago

The benefit to implementing LSP is that large numbers of editors and IDEs already support it. High quality interfaces and usages of that protocol are being developed all the time.

The Super Collider IDE supports a custom protocol, so the only thing that connect to that is SC IDE. The only advancement that will ever happen is by this very tiny SC community. I think it would be better to concentrate on music features unique to SC.

widp commented 6 years ago

Agree completely, My point was to replace the existing protocol with LSP.

crucialfelix commented 6 years ago

Oh, I misunderstood your previous comment then !

madskjeldgaard commented 3 years ago

did any of you guys make progress on this?

widp commented 3 years ago

Current setup:

madskjeldgaard commented 3 years ago

Thanks for the information. That's very useful!