Skip to content

Commit 091f459

Browse files
committed
Add Sphinx script to build documentation.
Fix minor issues in markdown documents and group them im `toctree` directives. Then use `myst-parser` to parse markdown files. To build documentation: * pip install -r doc/requirements.txt * make -C doc html Refs #1419
1 parent 1aa3d78 commit 091f459

File tree

13 files changed

+157
-25
lines changed

13 files changed

+157
-25
lines changed

doc/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_build
2+
ada_language_server.wiki

doc/HACKING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ The UI offers ways to run or debug one test, a subset of tests or all tests.
148148
149149
### Other tests
150150
151-
See more about the project testsuite [here](../testsuite/README.md).
151+
See more about the project testsuite [here](https://github.com/AdaCore/ada_language_server/blob/master/testsuite/README.md).
152152
153153
## Release VS Code extension
154154

doc/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile ada_language_server.wiki
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+
22+
ada_language_server.wiki:
23+
git clone --depth=1 https://github.com/AdaCore/ada_language_server.wiki.git

doc/README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ You can also use custom commands to perform queries on the code base, to develop
1818

1919
Here are some implementations of custom features in the ALS implemented through this mechanism:
2020

21-
* [Show Dependencies](../source/ada/lsp-ada_handlers-show_dependencies_commands.ads)
22-
* [Other File](../source/ada/lsp-ada_handlers-other_file_commands.ads)
21+
* [Show Dependencies](https://github.com/AdaCore/ada_language_server/blob/master/source/ada/lsp-ada_handlers-show_dependencies_commands.ads)
22+
* [Other File](https://github.com/AdaCore/ada_language_server/blob/master/source/ada/lsp-ada_handlers-other_file_commands.ads)
2323

2424
## Feature description document
2525

2626
Each feature is described in a dedicated Markdown document.
27-
There is [a list of all features](.#list-of-features) at the end of this document.
27+
There is [a list of all features](#list-of-custom-features) at the end of this document.
2828
We provide a [template](./TEMPLATE.md) for convenience.
2929
The feature description document has the following structure:
3030

@@ -62,3 +62,32 @@ related resources.
6262
* [Check Syntax](check_syntax.md)
6363
* [Executables](executables.md)
6464
* [Call Hierarchy](callhierarchy.md)
65+
* [Document symbol params](document_symbol_params.md)
66+
* [Get project attribute value](get_project_attribute_value.md)
67+
* [Initialization](initialization.md)
68+
* [Object dir](object_dir.md)
69+
* [Project file](project_file.md)
70+
* [Source dirs](source_dirs.md)
71+
* [Workspace symbol params](workspace_symbol_params.md)
72+
73+
```{toctree}
74+
:maxdepth: 1
75+
:caption: "List of custom features:"
76+
:hidden:
77+
78+
debug
79+
other_file
80+
reference_kinds
81+
show_dependencies
82+
check_syntax
83+
executables
84+
callhierarchy
85+
document_symbol_params
86+
get_project_attribute_value
87+
initialization
88+
object_dir
89+
project_file
90+
source_dirs
91+
workspace_symbol_params
92+
TEMPLATE
93+
```

doc/conf.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
9+
project = "Ada & SPARK extension for VS Code"
10+
project_copyright = "2024-2025, AdaCore"
11+
author = "AdaCore"
12+
13+
# -- General configuration ---------------------------------------------------
14+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15+
16+
extensions = [
17+
"myst_parser",
18+
]
19+
20+
exclude_patterns = [
21+
"_build",
22+
"Thumbs.db",
23+
".DS_Store",
24+
# 'ada_language_server.wiki/Custom-colors-in-VS-Code.md',
25+
# 'ada_language_server.wiki/Getting-Started.md',
26+
"ada_language_server.wiki/Home.md",
27+
# 'ada_language_server.wiki/Project-file-editing.md',
28+
# 'ada_language_server.wiki/Set-workspace-specific-environment-variables.md',
29+
"ada_language_server.wiki/Supported-LSP-requests.md",
30+
# 'ada_language_server.wiki/Working-on-a-remote-machine.md',
31+
# 'build.md',
32+
"gitpod.md",
33+
"protocol.md",
34+
"specification-3-14.md",
35+
"specification-3-15.md",
36+
"specification-3-16.md",
37+
]
38+
39+
# -- Options for HTML output -------------------------------------------------
40+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
41+
42+
html_theme = "sphinx_rtd_theme"
43+
44+
myst_heading_anchors = 3

doc/executables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ We introduce two commands, the first one:
2020

2121
Which provides the mains for the project, with a response type:
2222

23-
```typesript
23+
```typescript
2424
type GlsMainResult = string[];
2525
```
2626

@@ -30,6 +30,6 @@ The second one is:
3030

3131
Which provides the executables for the project, with a response type:
3232

33-
```typesript
33+
```typescript
3434
type GlsExecutableResult = string[];
3535
```

doc/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. Ada & SPARK extension for VS Code documentation master file, created by
2+
sphinx-quickstart on Thu Dec 26 19:26:17 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Ada & SPARK extension for VS Code documentation
7+
===============================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
Tutorial: Using Ada in VS Code <ada_language_server.wiki/Getting-Started.md>
14+
refactoring_tools
15+
settings
16+
traces
17+
tips_and_tricks
18+
build
19+
Developing on the Ada Language Server <HACKING.md>
20+
Protocol extensions <README.md>

doc/object_dir.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ type ObjDirResponse = string;
1616

1717
And a new command with out arguments:
1818

19-
method: `als-object-dir`
19+
method: `als-object-dir`
2020

2121
Returning the project file of the loaded project like this:
2222

23-
result: `ObjDirResponse`
23+
result: `ObjDirResponse`

doc/project_file.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export type ProjectFileResponse = string; // The Path to the GPR project file
1515

1616
And a new command with out arguments:
1717

18-
command: `als-project-file`
18+
command: `als-project-file`
1919

2020
Returning the project file of the loaded project like this:
2121

22-
result: `ProjectFileResponse`
22+
result: `ProjectFileResponse`

doc/refactoring_tools.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
[Source](https://github.com/AdaCore/ada_language_server/blob/master/source/ada/lsp-ada_handlers-named_parameters_commands.ads)
2929

30-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/named_parameters/)
30+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/named_parameters/)
3131

3232
![named_parameters](https://user-images.githubusercontent.com/22893717/166944482-cfebab94-adf8-4de5-9018-8415be94f8f5.gif)
3333

@@ -44,7 +44,7 @@
4444

4545
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-subprogram_signature.ads)
4646

47-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/add_parameter/)
47+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/add_parameter/)
4848

4949
![add_parameter](https://user-images.githubusercontent.com/22893717/166926928-f6f5243c-6008-435f-9c2f-40aec0517936.gif)
5050

@@ -58,7 +58,7 @@
5858

5959
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-subprogram_signature-remove_parameter.ads)
6060

61-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/remove_parameter)
61+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/remove_parameter)
6262

6363
![remove parameter](https://user-images.githubusercontent.com/22893717/166926891-d621fb59-8524-4ba8-abfc-74c12fed2adf.gif)
6464

@@ -72,7 +72,7 @@
7272

7373
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-subprogram_signature.ads)
7474

75-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/move_parameter)
75+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/move_parameter)
7676

7777
![move_parameter](https://user-images.githubusercontent.com/22893717/166927234-ba038012-25be-476e-bd29-d85c10a5b2d3.gif)
7878

@@ -85,7 +85,7 @@
8585

8686
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-subprogram_signature.ads)
8787

88-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/change_parameter_mode)
88+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/change_parameter_mode)
8989

9090
![change_parameter_mode](https://user-images.githubusercontent.com/22893717/166927346-cbaa9789-eb44-44df-8a9a-c2b770d3a93e.gif)
9191

@@ -99,7 +99,7 @@
9999

100100
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-subprogram_signature-change_parameters_type.ads)
101101

102-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/change_parameter_type)
102+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/change_parameter_type)
103103

104104
![change_parameter_type](https://user-images.githubusercontent.com/22893717/166927382-b04c5415-dc3e-49e1-9ef3-2840579447d8.gif)
105105

@@ -113,7 +113,7 @@
113113

114114
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-subprogram_signature-change_parameters_default_value.ads)
115115

116-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/change_parameter_default_value)
116+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/change_parameter_default_value)
117117

118118
![change_parameter_default_value](https://user-images.githubusercontent.com/22893717/166927617-f6f33bc4-d660-44ce-b836-bf02b839887e.gif)
119119

@@ -128,7 +128,7 @@
128128

129129
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-extract_subprogram.ads)
130130

131-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/extract_subprogram)
131+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/extract_subprogram)
132132

133133
![extract_subprogram](https://user-images.githubusercontent.com/22893717/166927664-c61af27f-a446-4e3a-acbe-71b7fa88e925.gif)
134134

@@ -141,7 +141,7 @@
141141

142142
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-pull_up_declaration.ads)
143143

144-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/pull_up_declaration)
144+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/pull_up_declaration)
145145

146146
![pull_up_declaration](https://user-images.githubusercontent.com/22893717/166927695-e6b9e016-1374-4aa5-9640-60aaf1a4b7fe.gif)
147147

@@ -155,7 +155,7 @@
155155

156156
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-suppress_separate.ads)
157157

158-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/suppress_separate)
158+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/suppress_separate)
159159

160160
![suppress_separate](https://user-images.githubusercontent.com/22893717/166927780-441fdb3f-271f-4f69-99ff-367e8eef301e.gif)
161161

@@ -169,7 +169,7 @@
169169

170170
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-introduce_parameter.ads)
171171

172-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/introduce_parameter)
172+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/introduce_parameter)
173173

174174
![introduce parameter](https://user-images.githubusercontent.com/22893717/181477996-564a1365-33df-4227-bb82-e9ed802b4ed0.gif)
175175

@@ -181,7 +181,7 @@
181181

182182
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-replace_type.ads)
183183

184-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/replace_type)
184+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/replace_type)
185185

186186
![replace type](https://user-images.githubusercontent.com/22893717/217803466-ae5500fe-a071-4fe9-a669-24cd9c82917a.gif)
187187

@@ -193,7 +193,7 @@
193193

194194
[Source](https://github.com/AdaCore/lal-refactor/blob/edge/src/lal_refactor-auto_import.adb)
195195

196-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/auto_import)
196+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/auto_import)
197197

198198
![auto import](https://user-images.githubusercontent.com/22893717/217804710-e686ef22-227b-4e81-8bb1-1f218e5709df.gif)
199199

@@ -205,6 +205,6 @@
205205

206206
[Source](https://github.com/AdaCore/lal-refactor/blob/main/src/lal_refactor-sort_dependencies.ads)
207207

208-
[Demo Source](../integration/vscode/Code%20Samples/refactoring_demos/sort_dependencies)
208+
[Demo Source](https://github.com/AdaCore/ada_language_server/blob/master/integration/vscode/Code%20Samples/refactoring_demos/sort_dependencies)
209209

210210
![replace type](https://user-images.githubusercontent.com/22893717/217805066-ee69e6d6-4c9e-4075-8eb6-1fca7793c428.gif)

0 commit comments

Comments
 (0)