You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -114,64 +120,62 @@ instead of specifying it via the requests listed just above.
114
120
See [WiKi page](https://github.com/AdaCore/ada_language_server/wiki/Supported-LSP-requests)
115
121
for the list of supported requests.
116
122
117
-
### Protocol extensions
123
+
### Protocol Extensions
118
124
119
125
The Ada Language Server supports some features that are not in the official
120
126
[Language Server Protocol](https://microsoft.github.io/language-server-protocol)
121
127
specification. See [corresponding document](doc/README.md).
122
128
123
-
## How to use the VScode extension
124
-
125
-
### Current limitations and differences compared to GNAT Studio
126
-
127
-
The VSCode extension has a few limitations and some differences compared to [GNAT Studio](https://github.com/AdaCore/gnatstudio):
128
-
129
-
***Indentation/formatting**: it does not support automatic indentation when adding a newline and range/document
130
-
formatting might no succeed on incomplete/illegal code.
131
-
132
-
***Toooling support**: we currently provide minimal support for *SPARK* (see *Prove/Examine* tasks in the [Auto-detected tasks](#auto-detected-tasks) section), but there is no support for tools such as *CodePeer*, *GNATcheck*, *GNATtest* or *GNATcoverage*.
133
-
134
-
***Alire support**: if the root folder contains an `alire.toml` file and
135
-
there is `alr` executable in the `PATH`, then the language server fetches
136
-
the project's search path, environment variables and the project's file
137
-
name from the crate description.
138
-
139
-
***Project support**: there is no `Scenario` view: users should configure scenarios via the *ada.scenarioVariables* setting (see the settings list available [here](doc/refactoring_tools.md)). You can execute the *Ada: Reload project* command to reload your project after saving the new scenario values (use the *Ctrl+P* shortcut to invoke the **Command Palette**, allowing you to execute commands).
129
+
## VS Code Extension
140
130
141
-
Source directories from imported projects should be added in a [workspace file](https://code.visualstudio.com/docs/editor/workspaces#_multiroot-workspaces). If you already have a workspace file, the extension will propose you to automatically add all the source directories coming from imported projects to your workspace automatically at startup.
131
+
A VS Code extension based on this Ada Language Server is available on the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=AdaCore.ada).
132
+
It provides a full set of features including syntax highlighting, navigation, building and debugging.
142
133
143
-
### Bug Reporting
134
+
### Getting Started
144
135
145
-
You can use the VS Code `Issue Reporter` to report issues. Just click on the `Help -> Report Issue` menu, select `An extension` for the `File on` entry and `Language Support for Ada` for the extension name. Put as many information you can in the description, like steps to reproduce, stacktraces or system information (VS Code automatically includes it by default). This will create a GitHub issue in the [Ada Language Server](https://github.com/AdaCore/ada_language_server/) repository.
136
+
[Tutorial: Using Adain VS Code](https://github.com/AdaCore/ada_language_server/wiki/Getting-Started).
146
137
147
-
ALS log files can be found under the `~/.als` directory (`%USERPROFILE%/.als` on Windows). Feel free to attach them on the issues, it helps a lot for further investigation, specially when the `ALS.IN` and `ALS.OUT` traces are enabled (more info about traces configuration can be found [here](doc/traces.md).)
138
+
### Configuration
148
139
140
+
You can configure the extension via the `.vscode/settings.json` workspace settings file or the [multi-root workspace file](https://code.visualstudio.com/docs/editor/multi-root-workspaces).
141
+
See the setting list [here](doc/settings.md).
149
142
150
-
### Getting started
143
+
Here is an example config file:
151
144
152
-
[Tutorial: Using Ada in VS Code](https://github.com/AdaCore/ada_language_server/wiki/Getting-Started).
145
+
```json
146
+
{
147
+
"ada.projectFile": "gnatcov.gpr",
148
+
"ada.scenarioVariables": {
149
+
"BINUTILS_BUILD_DIR": "/null",
150
+
"BINUTILS_SRC_DIR": "/null"
151
+
},
152
+
"ada.defaultCharset": "utf-8",
153
+
"ada.enableDiagnostics": false,
154
+
"ada.renameInComments": false
155
+
}
156
+
```
153
157
154
158
### Refactoring
155
159
156
160
See a [dedicated document](doc/refactoring_tools.md) with the list of available refactorings.
157
161
158
-
### Auto-detected tasks
162
+
### Tasks
159
163
160
-
The extension includes a task provider. It provides the following "auto-detected" tasks
164
+
The extension provides the following auto-detected tasks
161
165
(under `/Terminal/Run Task...` menu):
162
166
163
-
*"ada: Build current project" - launch `gprbuild` to build the current GPR project
164
-
*"ada: Check current file" - launch `gprbuild` to check errors in the current editor
165
-
*"ada: Clean current project" - launch `gprclean` to clean the current GPR project
166
-
*"ada: Examine project" - launch `gnatprove` in flow analysis mode on the current GPR project
167
-
*"ada: Examine file" - launch `gnatprove` in flow analysis mode on the file in the current editor
168
-
*"ada: Examine subprogram" - launch `gnatprove` in flow analysis mode on the current subprogram in the current editor
169
-
*"ada: Prove project" - launch `gnatprove` on the current GPR project
170
-
*"ada: Prove file" - launch `gnatprove` on the file in the current editor
171
-
*"ada: Prove subprogram" - launch `gnatprove` on the current subprogram in the current editor
172
-
*"ada: Prove selected region" - launch `gnatprove` on the selected region in the current editor
173
-
*"ada: Prove line" - launch `gnatprove` on the cursor line in the current editor
174
-
*"ada: Clean project for proof" - launch `gnatprove` on the current GPR project to clean proof artefacts
167
+
*`ada: Build current project` - launch `gprbuild` to build the current GPR project
168
+
*`ada: Check current file` - launch `gprbuild` to check errors in the current editor
169
+
*`ada: Clean current project` - launch `gprclean` to clean the current GPR project
170
+
*`spark: Examine project` - launch `gnatprove` in flow analysis mode on the current GPR project
171
+
*`spark: Examine file` - launch `gnatprove` in flow analysis mode on the file in the current editor
172
+
*`spark: Examine subprogram` - launch `gnatprove` in flow analysis mode on the current subprogram in the current editor
173
+
*`spark: Prove project` - launch `gnatprove` on the current GPR project
174
+
*`spark: Prove file` - launch `gnatprove` on the file in the current editor
175
+
*`spark: Prove subprogram` - launch `gnatprove` on the current subprogram in the current editor
176
+
*`spark: Prove selected region` - launch `gnatprove` on the selected region in the current editor
177
+
*`spark: Prove line` - launch `gnatprove` on the cursor line in the current editor
178
+
*`spark: Clean project for proof` - launch `gnatprove` on the current GPR project to clean proof artefacts
175
179
176
180
You can bind keyboard shortcuts to them by adding to the `keybindings.json` file:
177
181
@@ -184,35 +188,34 @@ You can bind keyboard shortcuts to them by adding to the `keybindings.json` file
184
188
}
185
189
```
186
190
187
-
#### Short demo
188
-
189
-
[A demo for auto-detected tasks](https://github.com/AdaCore/ada_language_server/wiki/auto_detected_tasks.mp4)
191
+
#### Task Customization
190
192
191
-
#### Task customization
192
-
You can [customize autodetected tasks](https://code.visualstudio.com/docs/editor/tasks#_customizing-autodetected-tasks)
193
-
by providing extra tool command line options via `args` property in the `tasks.json`:
193
+
You can [customize auto-detected tasks](https://code.visualstudio.com/docs/editor/tasks#_customizing-autodetected-tasks)
194
+
by providing extra tool command line options via the `args` property of the `configuration` object in the `tasks.json`:
194
195
195
196
```json
196
197
{
197
-
"version": "2.0.0",
198
-
"tasks": [
199
-
{
200
-
"type": "gnat",
201
-
"taskKind": "buildProject",
202
-
"problemMatcher": [
203
-
"$ada"
204
-
],
205
-
"group": "build",
206
-
"label": "ada: Build project",
207
-
"args": ["-gargs", "-vh"]
208
-
}
209
-
]
198
+
"version": "2.0.0",
199
+
"tasks": [
200
+
{
201
+
"type": "ada",
202
+
"configuration": {
203
+
"kind": "buildProject",
204
+
"projectFile": "${config:ada.projectFile}",
205
+
"args": ["-gargs", "-vh"]
206
+
},
207
+
"problemMatcher": ["$ada"],
208
+
"group": "build",
209
+
"label": "ada: Build current project with custom options"
210
+
}
211
+
]
210
212
}
211
213
```
212
214
213
-
### Commands and shortcuts
215
+
### Commands and Shortcuts
214
216
215
-
The extension contributes a few commands and corresponding key bindings.
217
+
The extension contributes commands and a few default key bindings.
218
+
Below are a few examples, and other commands can be found by searching for `Ada:` in the command list.
216
219
217
220
#### Ada: Go to other file
218
221
@@ -229,36 +232,29 @@ The default shortcut is `Alt+Shift+B`.
229
232
This command reloads the current project.
230
233
The default shortcut is `None`.
231
234
232
-
### Launch the extension to debug it
235
+
### Bug Reporting
233
236
234
-
For the moment, this repository includes a vscode extension that is used as the
235
-
reference extension for this implementation.
237
+
You can use the VS Code `Issue Reporter` to report issues. Just click on the `Help -> Report Issue` menu, select `An extension` for the `File on` entry and `Language Support for Ada` for the extension name. Put as many information you can in the description, like steps to reproduce, stacktraces or system information (VS Code automatically includes it by default). This will create a GitHub issue in the [Ada Language Server](https://github.com/AdaCore/ada_language_server/) repository.
236
238
237
-
You can try it by running:
239
+
ALS log files can be found under the `~/.als` directory (`%USERPROFILE%/.als` on Windows). Feel free to attach them on the issues, it helps a lot for further investigation, specially when the `ALS.IN` and `ALS.OUT` traces are enabled (more info about traces configuration can be found [here](doc/traces.md).)
The VS Code extension has a few limitations and some differences compared to [GNAT Studio](https://github.com/AdaCore/gnatstudio):
244
244
245
-
You can configure the extension via the `.vscode/settings.json` settings file.
246
-
See the setting list [here](doc/settings.md).
245
+
***Indentation/formatting**: it does not support automatic indentation when adding a newline and range/document
246
+
formatting might no succeed on incomplete/illegal code.
247
247
248
-
Here is an example config file from the gnatcov project:
248
+
***Tooling support**: we currently provide minimal support for *SPARK* (see *Prove/Examine* tasks in the [Auto-detected tasks](#auto-detected-tasks) section), but there is no support for tools such as *CodePeer*, *GNATcheck*, *GNATtest* or *GNATcoverage*.
249
249
250
-
```json
251
-
{
252
-
"ada.projectFile": "gnatcov.gpr",
253
-
"ada.scenarioVariables": {
254
-
"BINUTILS_BUILD_DIR": "/null",
255
-
"BINUTILS_SRC_DIR": "/null"
256
-
},
257
-
"ada.defaultCharset": "utf-8",
258
-
"ada.enableDiagnostics": false,
259
-
"ada.renameInComments": false
260
-
}
261
-
```
250
+
***Alire support**: if the root folder contains an `alire.toml` file and
251
+
there is `alr` executable in the `PATH`, then the language server fetches
252
+
the project's search path, environment variables and the project's file
253
+
name from the crate description.
254
+
255
+
***Project support**: there is no `Scenario` view: users should configure scenarios via the *ada.scenarioVariables* setting (see the settings list available [here](doc/refactoring_tools.md)). You can execute the *Ada: Reload project* command to reload your project after saving the new scenario values (use the *Ctrl+P* shortcut to invoke the **Command Palette**, allowing you to execute commands).
256
+
257
+
Source directories from imported projects should be added in a [workspace file](https://code.visualstudio.com/docs/editor/workspaces#_multiroot-workspaces). If you already have a workspace file, the extension will propose you to automatically add all the source directories coming from imported projects to your workspace automatically at startup.
Copy file name to clipboardExpand all lines: doc/HACKING.md
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,9 @@ make
30
30
31
31
## Debugging
32
32
33
+
One way to run the ALS is by running the VS Code extension in development mode.
34
+
You can do that using the VS Code workspace at the root of this repository and the launch configuration `(vscode) Launch vscode with the Ada extension`.
35
+
33
36
You can activate traces that show all the server input/output. This is done
34
37
by creating a file `$HOME/.als/traces.cfg` with the following contents:
0 commit comments