Skip to content

Commit aa4f4ef

Browse files
committed
Improve VS Code workspace
* Support developing/debugging the VS Code extension from the parent workspace. * Include subprojects/* into the GPR_PROJECT_PATH.
1 parent c17d59c commit aa4f4ef

File tree

6 files changed

+137
-32
lines changed

6 files changed

+137
-32
lines changed

.vscode/launch.json

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,57 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
"version": "0.2.0",
5-
"configurations": [
6-
{
7-
"type": "gdb",
8-
"request": "launch",
9-
"name": "Launch Program",
10-
"target": ".obj/server/ada_language_server",
11-
"cwd": "${workspaceRoot}",
12-
"valuesFormatting": "parseText"
13-
}
14-
]
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
"version": "0.2.0",
5+
"configurations": [
6+
{
7+
"name": "Launch Extension",
8+
"type": "extensionHost",
9+
"request": "launch",
10+
"runtimeExecutable": "${execPath}",
11+
"outFiles": [
12+
"${workspaceFolder}/integration/vscode/ada/out/**/*.js",
13+
"!**/node_modules/**"
14+
],
15+
"args": [
16+
"--extensionDevelopmentPath=${workspaceFolder}/integration/vscode/ada",
17+
18+
// It is useful to have workspace available for local debugging. The
19+
// following one is provided within the repository with test folders
20+
// included.
21+
// "${workspaceFolder}/integration/vscode/ada/debug.code-workspace"
22+
23+
// An alternative is to use the ALS workspace itself as a runtime
24+
// workspace for debugging. However it is not possible to start the
25+
// debug instance on the same workspace as the development instance.
26+
// So you can checkout a second copy of the ALS repository under
27+
// ../als-rt and use it with the following line.
28+
"${workspaceFolder}/../als-rt"
29+
],
30+
"preLaunchTask": "npm: compile"
31+
},
32+
{
33+
"name": "Extension Tests",
34+
"type": "extensionHost",
35+
"request": "launch",
36+
"runtimeExecutable": "${execPath}",
37+
"outFiles": [
38+
"${workspaceFolder}/integration/vscode/ada/out/**/*.js",
39+
"!**/node_modules/**"
40+
],
41+
"args": [
42+
"--extensionDevelopmentPath=${workspaceFolder}/integration/vscode/ada",
43+
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/index",
44+
"${workspaceFolder}/integration/vscode/ada/test/SampleProject"
45+
],
46+
"preLaunchTask": "npm: pretest"
47+
},
48+
{
49+
"type": "gdb",
50+
"request": "launch",
51+
"name": "Launch Program",
52+
"target": ".obj/server/ada_language_server",
53+
"cwd": "${workspaceRoot}",
54+
"valuesFormatting": "parseText"
55+
}
56+
]
1557
}

.vscode/settings.json

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,44 @@
11
{
2-
"ada.projectFile": "gnat/lsp_server.gpr",
3-
"python.analysis.extraPaths": [
4-
"testsuite"
5-
]
6-
}
2+
"ada.projectFile": "gnat/lsp_server.gpr",
3+
"python.analysis.extraPaths": ["testsuite"],
4+
"terminal.integrated.env.osx": {
5+
// Dependencies can be provided under the subprojects/ directory. They
6+
// would automatically be included in GPR_PROJECT_PATH by the following
7+
// setting.
8+
//
9+
// Alternatively, dependencies can be obtained from different locations
10+
// and GPR_PROJECT_PATH can be set prior to invoking VS Code, making them
11+
// also visible if not overwritten in the subprojects/ directory.
12+
"GPR_PROJECT_PATH": "${workspaceFolder}/subprojects/VSS/gnat:${workspaceFolder}/subprojects/gnatdoc/gnat:${workspaceFolder}/subprojects/libadalang-tools/src:${workspaceFolder}/subprojects/spawn/gnat:${workspaceFolder}/subprojects/stubs:${workspaceFolder}/subprojects/prefix/share/gpr:${env:GPR_PROJECT_PATH}"
13+
},
14+
// To develop the VS Code extension, it is recommended to open the workspace
15+
// defined at integration/vscode/ada. Nonetheless, this configuration allows
16+
// ESLint to operate on the TypeScript sources of the extension from this
17+
// workspace.
18+
"eslint.workingDirectories": [
19+
{
20+
"directory": "integration/vscode/ada"
21+
}
22+
],
23+
// Please keep the following options in sync with integration/vscode/ada/.vscode/settings.json
24+
"[typescript]": {
25+
"editor.defaultFormatter": "esbenp.prettier-vscode",
26+
"editor.codeActionsOnSave": {
27+
"source.fixAll.eslint": true
28+
}
29+
},
30+
"[json]": {
31+
"editor.formatOnSave": true,
32+
"editor.defaultFormatter": "esbenp.prettier-vscode",
33+
"editor.detectIndentation": false,
34+
"files.trimFinalNewlines": true,
35+
"files.trimTrailingWhitespace": true
36+
},
37+
"[jsonc]": {
38+
"editor.formatOnSave": true,
39+
"editor.defaultFormatter": "esbenp.prettier-vscode",
40+
"editor.detectIndentation": false,
41+
"files.trimFinalNewlines": true,
42+
"files.trimTrailingWhitespace": true
43+
}
44+
}

.vscode/tasks.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"-cargs",
1313
"-gnatef"
1414
],
15-
"problemMatcher": ["$ada"],
15+
"problemMatcher": [
16+
"$ada"
17+
],
1618
"group": {
1719
"kind": "build",
1820
"isDefault": true
@@ -22,8 +24,27 @@
2224
"label": "Run tests",
2325
"type": "shell",
2426
"command": "make check",
25-
"problemMatcher": ["$ada"],
27+
"problemMatcher": [
28+
"$ada"
29+
],
2630
"group": "test"
31+
},
32+
{
33+
"type": "npm",
34+
"script": "compile",
35+
"path": "integration/vscode/ada",
36+
"group": "build",
37+
"problemMatcher": [],
38+
"label": "npm: compile",
39+
"detail": "node ./node_modules/typescript/bin/tsc",
40+
"presentation": {
41+
"echo": true,
42+
"reveal": "silent",
43+
"focus": false,
44+
"panel": "shared",
45+
"showReuseMessage": true,
46+
"clear": false
47+
}
2748
}
2849
]
29-
}
50+
}

integration/vscode/ada/.vscode/extensions.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// See https://go.microsoft.com/fwlink/?LinkId=733558
33
// for the documentation about the extensions.json format
44
"recommendations": [
5-
"dbaeumer.vscode-eslint"
6-
]
7-
}
5+
"dbaeumer.vscode-eslint",
6+
"esbenp.prettier-vscode"
7+
]
8+
}

integration/vscode/ada/.vscode/launch.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
"request": "launch",
88
"runtimeExecutable": "${execPath}",
99
"args": [
10-
"--extensionDevelopmentPath=${workspaceFolder}"
10+
"--extensionDevelopmentPath=${workspaceFolder}",
11+
"${workspaceFolder}/test",
12+
"${workspaceFolder}/testsuite_grammar"
1113
],
12-
"preLaunchTask": "npm: compile",
14+
"preLaunchTask": "npm: compile"
1315
},
1416
{
1517
"name": "Extension Tests",
@@ -24,4 +26,4 @@
2426
"preLaunchTask": "npm: pretest"
2527
}
2628
]
27-
}
29+
}

integration/vscode/ada/.vscode/settings.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"**/node_modules": true,
44
"**/out": true
55
},
6+
// Please keep the following options in sync with ../../../../.vscode/settings.json
67
"[typescript]": {
78
"editor.defaultFormatter": "esbenp.prettier-vscode",
89
"editor.codeActionsOnSave": {
@@ -11,16 +12,16 @@
1112
},
1213
"[json]": {
1314
"editor.formatOnSave": true,
14-
"editor.defaultFormatter": "vscode.json-language-features",
15+
"editor.defaultFormatter": "esbenp.prettier-vscode",
1516
"editor.detectIndentation": false,
1617
"files.trimFinalNewlines": true,
17-
"files.trimTrailingWhitespace": true,
18+
"files.trimTrailingWhitespace": true
1819
},
1920
"[jsonc]": {
2021
"editor.formatOnSave": true,
21-
"editor.defaultFormatter": "vscode.json-language-features",
22+
"editor.defaultFormatter": "esbenp.prettier-vscode",
2223
"editor.detectIndentation": false,
2324
"files.trimFinalNewlines": true,
24-
"files.trimTrailingWhitespace": true,
25+
"files.trimTrailingWhitespace": true
2526
}
26-
}
27+
}

0 commit comments

Comments
 (0)