ada-lsp
November 28, 2017 · View on GitHub
Language Server Protocol for Ada
The goal of this project is to provide implementation of Language Server Protocol (LSP) for Ada.
The Language Server protocol is used between a tool (the client) and a language smartness provider (the server) to integrate features like auto complete, goto definition, find all references and alike into the tool.
Install
Run:
git clone https://github.com/reznikmm/ada-lsp.git
cd ada-lsp
make
Dependencies
The dependency is
-
Matreshka - latest trunk, (at least 2017-10-13). AMF isn't requred/used. See Installation guide
-
increment an incremental analysis library.
-
Ada Pretty Printer library.
-
Anagram - parser generation Ada library .
-
Node.js - to prepare VS Code extension
-
VS Code - to test the protocol binding
Status of the project
Ada binding of the protocol is (mostly) implemented, but only from server's point of view. There is a 'demo' to check how the binding works. The Ada Language Server isn't implemented yet.
Usage
Running a Demo
The demo let you see common usage of LSP for Ada and explore protocol messages.
Prepare Ada extension and run VS code:
make vscode
code --extensionDevelopmentPath=`pwd`/integration/vscode/ada/ `pwd`
- Open source/protocol/lsp.ads
- Open Output Console
Ctrl-Jand look for 'Ada Language Server' logs. - Print
X'play with completion, pressCtrl+Spaceto see/hide the documentation. SelectS'Adjacentto paste a snippet. - Move the mouse over
Adjacent, tooltip will appear with Markdown inside. - Undo your changes and remove semicolon and save file. The editor will be populated with diagnostics. A bulb on the left side represent a CodeAction to correct the error. Click on it and fix the error.
- Print
pragma Assert (- signature help appears. PrintX, "Ops"and see how parameter description changes after comma. - Open context menu on
LSPidentifier and clickFind all references. Two references will be displayed. - Open lst-types.ads. Open context menu on
Generic_Optionalon the line
with LSP.Generic_Optional;
- Press
Go to definition. Corresponding file will be opened. - Press
Ctrl+Shft+Oand see list of local symbols. - Press
Ctrl+Tand see list of global symbols.
Maintainer
Contribute
Feel free to dive in! Open an issue or submit PRs.
License
MIT © Maxim Reznik