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
@@ -190,6 +192,10 @@ The extension provides the following auto-detected tasks
190
192
*`spark: Prove selected region` - launch `gnatprove` on the selected region in the current editor
191
193
*`spark: Prove line` - launch `gnatprove` on the cursor line in the current editor
192
194
*`spark: Clean project for proof` - launch `gnatprove` on the current GPR project to clean proof artefacts
195
+
*`ada: Analyze the project with GNAT SAS`
196
+
*`ada: Analyze the current file with GNAT SAS`
197
+
*`ada: Create a report after a GNAT SAS analysis`
198
+
*`ada: Analyze the project with GNAT SAS and produce a report`
193
199
194
200
You can bind keyboard shortcuts to them by adding to the `keybindings.json` file:
195
201
@@ -205,27 +211,78 @@ You can bind keyboard shortcuts to them by adding to the `keybindings.json` file
205
211
#### Task Customization
206
212
207
213
You can [customize auto-detected tasks](https://code.visualstudio.com/docs/editor/tasks#_customizing-autodetected-tasks)
208
-
by providing extra tool command line options via the `args` property of the `configuration`object in the `tasks.json`:
214
+
by providing extra tool command line options via the `args` property of the object in the `tasks.json`:
209
215
210
216
```json
211
217
{
212
218
"version": "2.0.0",
213
219
"tasks": [
214
220
{
215
221
"type": "ada",
216
-
"configuration": {
217
-
"kind": "buildProject",
218
-
"projectFile": "${config:ada.projectFile}",
219
-
"args": ["-gargs", "-vh"]
222
+
"command": "gprbuild",
223
+
"args": [
224
+
"${command:ada.gprProjectArgs}",
225
+
"-cargs:ada",
226
+
"-gnatef",
227
+
"-gargs",
228
+
"-vh"
229
+
],
230
+
"problemMatcher": ["$ada"],
231
+
"group": "build",
232
+
"label": "ada: Build current project"
233
+
}
234
+
]
235
+
}
236
+
```
237
+
238
+
You can also customize the working directory of the task or the environment variables via the `options` property:
239
+
240
+
```json
241
+
{
242
+
"version": "2.0.0",
243
+
"tasks": [
244
+
{
245
+
"type": "ada",
246
+
"command": "gprbuild",
247
+
"args": [
248
+
"${command:ada.gprProjectArgs}",
249
+
"-cargs:ada",
250
+
"-gnatef"
251
+
],
252
+
"options": {
253
+
"cwd": "${workspaceFolder}/my/subdir",
254
+
"env": {
255
+
"MY_ENV_VAR": "value"
256
+
}
220
257
},
221
258
"problemMatcher": ["$ada"],
222
259
"group": "build",
223
-
"label": "ada: Build current project with custom options"
260
+
"label": "ada: Build current project"
224
261
}
225
262
]
226
263
}
227
264
```
228
265
266
+
#### Tasks for Project Mains
267
+
268
+
If your GPR project defines main programs via the project attribute `Main`, additional tasks are automatically provided for each defined main.
269
+
For example, if the project defines a `main1.adb` and `main2.adb` located under the `src/` source directory, the following tasks will be available:
270
+
271
+
*`ada: Build main - src/main1.adb`
272
+
*`ada: Run main - src/main1.adb`
273
+
*`ada: Build and run main - src/main1.adb`
274
+
*`ada: Build main - src/main2.adb`
275
+
*`ada: Run main - src/main2.adb`
276
+
*`ada: Build and run main - src/main2.adb`
277
+
278
+
#### ALIRE Support
279
+
280
+
When the workspace is an ALIRE project (i.e. it contains an `alire.toml` file), tasks automatically use standard ALIRE commands.
281
+
282
+
For example, the `ada: Build current project` task uses the command `alr build` and the `ada: Clean current project` task uses the command `alr clean`.
283
+
284
+
All other tasks use `alr exec -- ...` to execute the command in the environment provided by ALIRE.
285
+
229
286
### Commands and Shortcuts
230
287
231
288
The extension contributes commands and a few default key bindings.
@@ -259,12 +316,13 @@ The VS Code extension has a few limitations and some differences compared to [GN
259
316
***Indentation/formatting**: it does not support automatic indentation when adding a newline and range/document
260
317
formatting might no succeed on incomplete/illegal code.
261
318
262
-
***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*.
319
+
***Tooling support**: we currently provide support for some *SPARK*, *GNATtest* and *GNAT SAS*[Tasks](#tasks), but there is no support for tools such as *GNATcheck*or *GNATcoverage* yet.
263
320
264
321
***Alire support**: if the root folder contains an `alire.toml` file and
265
322
there is `alr` executable in the `PATH`, then the language server fetches
266
323
the project's search path, environment variables and the project's file
267
-
name from the crate description.
324
+
name from the crate description. [Tasks](#tasks) are also automatically
325
+
invoked with ALIRE in this case.
268
326
269
327
***Project support**: there is no `Scenario` view: users should configure scenarios via the *ada.scenarioVariables* setting (see the settings list available [here](doc/settings.md)). Saving the settings file after changing the values will automatically reload the project and update the
270
328
predefined tasks to take into account the new scenario values.
0 commit comments