Skip to content

Commit f907614

Browse files
committed
Add Gpr tasks to build and run main subprograms
Add a Language Server extension to get the project main sources (glsMains request). Add a Language Server extension to get the project main executables (glsExecutables request). Activate the extension when Gpr or Ada sources are present in the current directory or sub-directory (only 1 level lookup). Add tests to the VS Code extension test-suite, testing the alsCheckSyntax, glsMains and glsExecutables requests.
1 parent 62ec565 commit f907614

39 files changed

+1245
-167
lines changed

Diff for: doc/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ related resources.
4545
* [Reference kinds](reference_kinds.md)
4646
* [Show Dependencies](show_dependencies.md)
4747
* [Check Syntax](check_syntax.md)
48+
* [Executables](executables.md)

Diff for: doc/executables.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Executables
2+
3+
## Short introduction
4+
5+
This implements a functionality to query the mains and the executables for a multi targets project.
6+
7+
## Capabilities
8+
9+
We provide the Build and Run tasks for specific targets in a GPR Projects.
10+
11+
To check these tasks :
12+
- click : `Ctrl + Shift + P `.
13+
- Select `Run Tasks` , then Select `GPR Tasks`.
14+
15+
## Change description
16+
17+
We introduce two requests, the first one:
18+
19+
method: `glsMains`
20+
21+
Which provides the mains for the project, with a response type:
22+
23+
```typesript
24+
type GlsMainResult = {
25+
mains: string[];
26+
};
27+
```
28+
29+
The second one is:
30+
31+
method: `glsExecutables`
32+
33+
Which provides the executables for the project, with a response type:
34+
35+
```typesript
36+
type GlsExecutableResult = {
37+
executables: string[];
38+
};
39+
```

Diff for: integration/vscode/ada/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules
22
.vsix
33
out
44
.vscode-test
5+
**/obj

Diff for: integration/vscode/ada/.vscode/launch.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818
"runtimeExecutable": "${execPath}",
1919
"args": [
2020
"--extensionDevelopmentPath=${workspaceFolder}",
21-
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
22-
],
23-
"outFiles": [
24-
"${workspaceFolder}/out/test/**/*.js"
21+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index",
22+
"${workspaceFolder}/test/SampleProject"
2523
],
2624
"preLaunchTask": "npm: pretest"
2725
}

Diff for: integration/vscode/ada/package.json

+23-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@
1818
"activationEvents": [
1919
"onLanguage:ada",
2020
"onLanguage:gpr",
21+
"workspaceContains:*.gpr",
22+
"workspaceContains:*/*.gpr",
23+
"workspaceContains:*.ad[bs]",
24+
"workspaceContains:*/*.ad[bs]",
25+
"workspaceContains:alire.toml",
2126
"onCommand:workbench.action.tasks.runTask"
2227
],
23-
"main": "./out/extension",
28+
"main": "./out/src/extension",
2429
"icon": "icons/ada.png",
2530
"bugs": "https://github.com/AdaCore/ada_language_server/issues",
2631
"repository": {
@@ -437,6 +442,23 @@
437442
"description": "Extra command arguments"
438443
}
439444
}
445+
},
446+
{
447+
"type": "GPR Tasks",
448+
"required": [
449+
"projectFile",
450+
"mainFile"
451+
],
452+
"properties": {
453+
"projectFile": {
454+
"type": "string",
455+
"description": "The project file"
456+
},
457+
"executable": {
458+
"type": "string",
459+
"description": "The main file"
460+
}
461+
}
440462
}
441463
],
442464
"commands": [

0 commit comments

Comments
 (0)