supercolliderjs icon indicating copy to clipboard operation
supercolliderjs copied to clipboard

Language Server Protocol for sclang

Open crucialfelix opened this issue 8 years ago • 7 comments

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.

crucialfelix avatar Sep 27 '17 05:09 crucialfelix

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.

widp avatar Mar 21 '18 03:03 widp

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.

crucialfelix avatar Mar 21 '18 09:03 crucialfelix

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

widp avatar Mar 21 '18 14:03 widp

Oh, I misunderstood your previous comment then !

crucialfelix avatar Mar 21 '18 14:03 crucialfelix

did any of you guys make progress on this?

madskjeldgaard avatar Nov 08 '20 21:11 madskjeldgaard

Current setup: - qtIDE has a class sc_introspection.hpp which talks to ScIDE.sc file in scide_scqt - from where it gets all information, such as method names, class names. - Also look at the Document.sc class. Relevant directories: - scide_scqt - editors/sc-ide

widp avatar Nov 10 '20 19:11 widp

Thanks for the information. That's very useful!

madskjeldgaard avatar Nov 10 '20 19:11 madskjeldgaard