Skip to content

Commit 814fe42

Browse files
Merge branch 'topic/custom_features_doc' into 'master'
Document how to create non-LSP custom ALS features See merge request eng/ide/ada_language_server!1404
2 parents 9791e0f + 40524bf commit 814fe42

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

doc/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ The Ada Language Server (ALS) supports some features that are not in the officia
66
[Language Server Protocol](https://microsoft.github.io/language-server-protocol)
77
specification. This document specifies how these features are documented.
88

9+
## Developing a custom feature
10+
11+
Usually we tend to implement custom features through [LSP commands](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#command). These commands can then be executed by the LSP clients running the ALS (e.g: VS Code).
12+
13+
Commands can either do something on the codebase directly (e.g: refactorings) or be used to query specific information (e.g: return all the function declarations within a scope).
14+
15+
Commands can be directly accessible to users through [LSP codeActions](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeAction). This is the case for all ALS-specific refactorings.
16+
17+
You can also use custom commands to perform queries on the code base, to develop an IDD-specific tool integration on top of the ALS for instance. In that case you can directly execute the command via the [LSP workspace/executeCommand](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_executeCommand) request and use the command's results as you want.
18+
19+
Here are some implementations of custom features in the ALS implemented through this mechanism:
20+
21+
* [Show Dependencies](../source/ada/lsp-ada_handlers-show_dependencies_commands.ads)
22+
* [Other File](../source/ada/lsp-ada_handlers-other_file_commands.ads)
23+
924
## Feature description document
1025

1126
Each feature is described in a dedicated Markdown document.
@@ -39,7 +54,7 @@ It includes TypeScript definitions, as the official specification does.
3954
This section includes related feature description documents and links to others
4055
related resources.
4156

42-
## List of features
57+
## List of custom features
4358
* [Debug](debug.md)
4459
* [Other File](other_file.md)
4560
* [Reference kinds](reference_kinds.md)

0 commit comments

Comments
 (0)