prototype implementation of the Microsoft Language Server Protocol for Ada/SPARK
This repository contains a prototype implementation of the Microsoft Language Server Protocol for Ada/SPARK.
Current features:
- GNAT project files
- Code completion
- Go to definition
- Find corresponding references
- Document symbol search
We also provide Visual Studio Code extension as .vsix file.
You can install binary image or build language server from sources.
To install binary image download an archive corresponding to your OS and unpack it
somewhere. You will find ada_language_server
inside unpacked folder.
We provide binaries for
- Linux x86_64 - take linux.tar.gz
- Window 64 bit - take win32.tar.gz
- Mac OS X - take darwin.tar.gz
To build is from source install dependencies and run
make
It will build .obj/server/ada_language_server
file.
To build the language server you need at least a version of the GNAT compiler,
and the Libadalang library to be built
and available via the GPR_PROJECT_PATH
.
To run the language server you need gnatls
(parts of GNAT installation)
somewhere in the path.
The ada_language_server
doesn't require/understand any command line options.
Request | Supported |
---|---|
initialize |
✅ |
initialized |
✅ |
shutdown |
✅ |
exit |
✅ |
$/cancelRequest |
Request | Supported |
---|---|
workspace/didChangeWorkspaceFolders |
|
workspace/didChangeConfiguration |
✅ |
workspace/didChangeWatchedFiles |
|
workspace/symbol |
|
workspace/executeCommand |
Request | Supported |
---|---|
textDocument/didOpen |
✅ |
textDocument/didChange |
✅ |
textDocument/willSave |
|
textDocument/willSaveWaitUntil |
|
textDocument/didSave |
|
textDocument/didClose |
✅ |
Request | Supported |
---|---|
textDocument/completion |
✅ |
completionItem/resolve |
|
textDocument/hover |
|
textDocument/signatureHelp |
|
textDocument/definition |
✅ |
textDocument/typeDefinition |
|
textDocument/implementation |
|
textDocument/references |
✅ |
textDocument/documentHighlight |
|
textDocument/documentSymbol |
✅ |
textDocument/codeAction |
|
textDocument/codeLens |
|
codeLens/resolve |
|
textDocument/documentLink |
|
documentLink/resolve |
|
textDocument/documentColor |
|
textDocument/colorPresentation |
|
textDocument/formatting |
|
textDocument/rangeFormatting |
|
textDocument/onTypeFormatting |
|
textDocument/rename |
|
textDocument/prepareRename |
|
textDocument/foldingRange |
For the moment, this repository includes a vscode extension that is used as the reference extension for this implementation.
You can try it by running:
code --extensionDevelopmentPath=<path_to_this_repo>/integration/vscode/ada <workspace directory>
You can configure the GNAT Project File and scenario variables via the
.vscode/settings.json
settings file, via the keys "ada.projectFile"
and
"ada.scenarioVariables"
.
Here is an example config file from the gnatcov project:
{
"ada.projectFile": "gnatcov.gpr",
"ada.scenarioVariables": {
"BINUTILS_BUILD_DIR": "/null",
"BINUTILS_SRC_DIR": "/null"
}
}
Feel free to dive in! Open an issue or submit PRs.