Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Server Features #2

Open
stekyne opened this issue May 2, 2018 · 0 comments
Open

Language Server Features #2

stekyne opened this issue May 2, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@stekyne
Copy link
Member

stekyne commented May 2, 2018

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

  • Syntax highlighting
    • Partially there already
  • Source code snippets
    • 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.

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.

@stekyne stekyne added the enhancement New feature or request label May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant