I thought I'd write down the possible features that could be implemented in VSCode and the extension API (using the language server protocol). This way we can divide it up into work items and anyone can work on it if they want and also keep track of the progress.
Inject templated code to save typing common constructs
E.g for Csound, new instr definition
Hover symbol support
Hover the mouse of a symbol to get a popup with info
Eg. Could be used to show an opcodes documentation
Code Completion
Nate already has this implemented in the Atom plugin. There is a compiled list of all opcodes and their arguments that can be reused.
This works but any unknown opcode will not work obviously. It would be nice to have a more dynamic approach. That would probably mean altering Csound though.
Provide Diagnostics
Parse Csound script for any errors in real-time. e.g. spelling mistakes / syntax errors
Not sure how capable the parser is in Csound for this currently
Opcode/function completion help
As the user types an opcode, a balloon pops up showing the current/remaining arguments to enter
Symbol features: Jump to definition, find all references, hightlight all occurences etc
Possibly not as useful for Csound which is normally in a single document. Might be helpful for large documents. If modules/projects/imports are ever introduced in Csound, it would make more sense.
Actions on Errors/Warnings
Provide solutions to errors or warnings e.g. add missing syntax, warn against known poor practice
Code lens
"Provide the user with actionable, contextual information that is displayed interspersed with the source code."
No real ideals for Csound yet but very powerful
Rename symbols
Format document/selection
For Csound, could align opcodes to a specific tabbing as is commonly done.
It still has to be determined how the language server would interact with Csound. The server itself can be written in a few languages so that would have an effect on it. It could be written in Python and use the bindings for that. It might also be better to use a socket to reduce any dependency on platform.
VSCode supplies a generic API to adapt a concrete debugger to the UI essentially. This means the Csound Debugger could be interfaced into VSCode via an adapter.
I thought I'd write down the possible features that could be implemented in VSCode and the extension API (using the language server protocol). This way we can divide it up into work items and anyone can work on it if they want and also keep track of the progress.
Editor Features
More info here: https://code.visualstudio.com/docs/extensionAPI/language-support
Server Implementation
https://code.visualstudio.com/docs/extensions/example-language-server
It still has to be determined how the language server would interact with Csound. The server itself can be written in a few languages so that would have an effect on it. It could be written in Python and use the bindings for that. It might also be better to use a socket to reduce any dependency on platform.
Debugger
https://code.visualstudio.com/docs/extensions/example-debuggers
VSCode supplies a generic API to adapt a concrete debugger to the UI essentially. This means the Csound Debugger could be interfaced into VSCode via an adapter.