Skip to content

Commit c48970f

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents 25a20d4 + c88e870 commit c48970f

23 files changed

+334
-2737
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ end_of_line = lf
88
trim_trailing_whitespace = true
99
insert_final_newline = true
1010

11+
[*.tokens]
12+
insert_final_newline = false
13+
1114
[*.py]
1215
indent_size = 4
1316

.github/workflows/build-binaries.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,23 @@ function fix_rpath ()
9393
install_name_tool -add_rpath @executable_path $1
9494
}
9595

96+
# Get architecture and platform information from node.
97+
NODE_ARCH=$(node -e "console.log(process.arch)")
98+
NODE_PLATFORM=$(node -e "console.log(process.platform)")
99+
ALS_EXEC_DIR=integration/vscode/ada/$NODE_ARCH/$NODE_PLATFORM
100+
96101
if [ $RUNNER_OS = macOS ]; then
97-
cp -v -f /usr/local/opt/gmp/lib/libgmp.10.dylib integration/vscode/ada/darwin/
98-
fix_rpath integration/vscode/ada/darwin/ada_language_server
102+
cp -v -f /usr/local/opt/gmp/lib/libgmp.10.dylib $ALS_EXEC_DIR
103+
fix_rpath $ALS_EXEC_DIR/ada_language_server
99104
fi
100105

101106
if [ "$DEBUG" != "debug" ]; then
102-
# Here it's better to match an exact extension rather than mathing
103-
# ada_language_server* because when running locally, the latter could match
104-
# ada_language_server.dSYM from a previous run if it exists.
107+
cd $ALS_EXEC_DIR
105108
if [ $RUNNER_OS = Windows ]; then
106-
ALS=`ls integration/vscode/ada/*/ada_language_server.exe`
109+
ALS=ada_language_server.exe
107110
else
108-
ALS=`ls integration/vscode/ada/*/ada_language_server`
111+
ALS=ada_language_server
109112
fi
110-
cd `dirname $ALS`
111-
ALS=`basename ${ALS}`
112113
if [ $RUNNER_OS = macOS ]; then
113114
# On macOS using objcopy from binutils to strip debug symbols to a
114115
# separate file doesn't work. Namely, the last step `objcopy

.github/workflows/build-binaries.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ jobs:
107107
uses: actions/upload-artifact@v3
108108
with:
109109
name: als-${{ runner.os }}-${{ matrix.debug }}
110-
path: integration/vscode/ada/[ldw]*/*
110+
# We know that only one of the following entries will match on a given
111+
# run, so we use globs here to try to avoid warnings on unmatched
112+
# entries
113+
path: |
114+
integration/vscode/ada/arm*
115+
integration/vscode/ada/x64*
111116
package:
112117
if: ${{ github.event_name == 'push' }}
113118
needs: build

.github/workflows/pack-binaries.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,15 @@ function make_change_log()
1818
}
1919

2020
chmod -R -v +x als-*-$DEBUG
21-
for X in Linux macOS Windows ; do mv -v -f als-$X-$DEBUG/* integration/vscode/ada/; done
22-
rm -rf -v integration/vscode/ada/{linux,darwin,win32}/*.{debug,dSYM}
21+
22+
for X in Linux macOS Windows ; do
23+
rsync -rva als-$X-$DEBUG/ integration/vscode/ada/
24+
done
25+
26+
# VS Code is supported on arm, arm64 and x64 so we only consider those
27+
# architectures
28+
rm -rf -v integration/vscode/ada/{arm,arm64,x64}/{linux,darwin,win32}/*.{debug,dSYM}
29+
2330
pushd integration/vscode/ada
2431
sed -i -e "/version/s/[0-9][0-9.]*/$TAG/" package.json
2532
[ -z "$DEBUG" ] || sed -i -e '/^ "name"/s/ada/ada-debug/' \
@@ -38,4 +45,4 @@ vsce package || true
3845
popd
3946
mv -v integration/vscode/ada/*.vsix .
4047
git checkout integration/vscode/ada/package.json
41-
rm -rf integration/vscode/ada/{linux,darwin,win32}
48+
rm -rf integration/vscode/ada/{arm,arm64,x64}/{linux,darwin,win32}

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,16 @@ ENV/
9797
# Expected testsuite output
9898
testsuite/.als/inout.txt
9999

100-
# Generated integration packages
100+
# Locations of ALS executable in VS Code extension. VS Code is supported on arm,
101+
# arm64 and x64 so we only consider those architectures.
102+
integration/vscode/ada/arm/
103+
integration/vscode/ada/arm64/
104+
integration/vscode/ada/x64/
105+
106+
# Previous locations of ALS executable in VS Code extension
101107
integration/vscode/ada/linux/
108+
integration/vscode/ada/win32/
109+
integration/vscode/ada/darwin/
102110

103111
# GNAT Studio clangd options
104112
.clang-format

.gitlab-ci.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,6 @@ build_and_test:
6363
- VSCODE_BUILD_SPACE=$ANOD_DEFAULT_SANDBOX_DIR/x86_64-linux/$VSCODE_BUILD_SPACE_NAME
6464
- echo -e "\e[0Ksection_end:`date +%s`:test_vscode\r\e[0K"
6565

66-
- echo -e "\e[0Ksection_start:`date +%s`:lsif[collapsed=true]\r\e[0KBuild lsif report"
67-
# Build the lsif report
68-
- anod install lsif-ada
69-
- ( cd $ANOD_DEFAULT_SANDBOX_DIR ;
70-
eval `anod printenv lsif-ada`;
71-
eval `anod printenv stable-gnat`;
72-
eval `anod printenv ada_libfswatch`;
73-
eval `anod printenv stable-templates_parser`;
74-
eval `anod printenv stable-langkit_support`;
75-
eval `anod printenv stable-libgpr2 --qualifier=bare`;
76-
eval `anod printenv stable-libadalang`;
77-
eval `anod printenv stable-libadalang-tools`;
78-
export GPR_PROJECT_PATH=` pwd `/x86_64-linux/als/src/subprojects/gnatdoc/gnat:$GPR_PROJECT_PATH;
79-
export GPR_PROJECT_PATH=` pwd `/x86_64-linux/als/src/subprojects/VSS/gnat:$GPR_PROJECT_PATH;
80-
cd $ANOD_DEFAULT_SANDBOX_DIR/x86_64-linux/als/src;
81-
lsif-ada gnat/lsp_server.gpr > $CI_PROJECT_DIR/dump.lsif 2>/dev/null ||
82-
touch $CI_PROJECT_DIR/dump.lsif )
83-
- echo -e "\e[0Ksection_end:`date +%s`:lsif\r\e[0K"
84-
8566
# Job artifacts must be produced in the project directory, so we do it at
8667
# the end of the job to avoid changing Anod checkouts halfway through the
8768
# job and triggering useless rebuilds.
@@ -96,6 +77,9 @@ build_and_test:
9677
--failure-exit-code 1
9778
--xunit-output $CI_PROJECT_DIR/vscode_xunit_output.xml
9879
$VSCODE_BUILD_SPACE/results/new/ || FAILED=true
80+
# Temporarily use the original JUnit report until e3-testsuite-report is
81+
# fixed. See it/e3-testsuite#7.
82+
- cp -f $VSCODE_BUILD_SPACE/results/mocha/test-results.xml $CI_PROJECT_DIR/vscode_xunit_output.xml
9983
# Include Anod logs
10084
- cp -r $ANOD_DEFAULT_SANDBOX_DIR/log $CI_PROJECT_DIR/anod-logs
10185
- echo -e "\e[0Ksection_end:`date +%s`:prepare_artifacts\r\e[0K"
@@ -106,7 +90,8 @@ build_and_test:
10690
when: always # Upload on errors too
10791
reports:
10892
junit: [als_xunit_output.xml, vscode_xunit_output.xml]
109-
lsif: dump.lsif
93+
paths:
94+
- anod-logs/
11095

11196
.run_ci_common: &run_ci_common
11297
stage: run_downstream_ci

.vscode/launch.json

Lines changed: 68 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,18 @@
2525
// debug instance on the same workspace as the development instance.
2626
// So you can checkout a second copy of the ALS repository under
2727
// ../als-rt and use it with the following line.
28-
"${workspaceFolder}/../als-rt"
28+
// "${workspaceFolder}/../als-rt"
29+
"${workspaceFolder}/integration/vscode/ada/test/TestWorkspace"
2930
],
30-
"preLaunchTask": "npm: compile"
31+
"preLaunchTask": "npm: compile",
32+
"env": {
33+
// This is necessary to make the "child" vscode inherit the PATH
34+
// variable set in the workspace settings. Without it in some setups
35+
// (e.g. vscode remote) the child vscode does not get visibility
36+
// over the Ada toolchain available in the parent vscode
37+
// environment.
38+
"PATH": "${env:PATH}"
39+
}
3140
},
3241
{
3342
"name": "Extension Tests",
@@ -43,30 +52,21 @@
4352
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/index",
4453
"${workspaceFolder}/integration/vscode/ada/test/TestWorkspace"
4554
],
55+
// Below we make the executables of node modules visible to the tests.
56+
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
57+
// tests.
4658
"env": {
59+
// This is necessary to make the "child" vscode inherit the PATH
60+
// variable set in the workspace settings. Without it in some setups
61+
// (e.g. vscode remote) the child vscode does not get visibility
62+
// over the Ada toolchain available in the parent vscode
63+
// environment.
64+
"PATH": "${env:PATH}",
4765
// This is custom env var that we use in
4866
// integration/vscode/ada/test/suite/index.ts to prevent timeouts in
4967
// tests when debugging
5068
"MOCHA_TIMEOUT": "0"
5169
},
52-
// Below we make the executables of node modules visible to the tests.
53-
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
54-
// tests.
55-
"windows": {
56-
"env": {
57-
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin;${env:PATH}"
58-
}
59-
},
60-
"osx": {
61-
"env": {
62-
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin:${env:PATH}"
63-
}
64-
},
65-
"linux": {
66-
"env": {
67-
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin:${env:PATH}"
68-
}
69-
},
7070
"preLaunchTask": "npm: pretest"
7171
},
7272
{
@@ -83,7 +83,16 @@
8383
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/index",
8484
"${workspaceFolder}/integration/vscode/ada/test/TestWorkspace"
8585
],
86+
// Below we make the executables of node modules visible to the tests.
87+
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
88+
// tests.
8689
"env": {
90+
// This is necessary to make the "child" vscode inherit the PATH
91+
// variable set in the workspace settings. Without it in some setups
92+
// (e.g. vscode remote) the child vscode does not get visibility
93+
// over the Ada toolchain available in the parent vscode
94+
// environment.
95+
"PATH": "${env:PATH}",
8796
// This is custom env var that we use in
8897
// integration/vscode/ada/test/suite/index.ts to prevent timeouts in
8998
// tests when debugging
@@ -94,24 +103,6 @@
94103
// integration/vscode/ada/test/suite/highlighting.test.ts
95104
"MOCHA_ALS_UPDATE": "1"
96105
},
97-
// Below we make the executables of node modules visible to the tests.
98-
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
99-
// tests.
100-
"windows": {
101-
"env": {
102-
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin;${env:PATH}"
103-
}
104-
},
105-
"osx": {
106-
"env": {
107-
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin:${env:PATH}"
108-
}
109-
},
110-
"linux": {
111-
"env": {
112-
"PATH": "${workspaceFolder}/integration/vscode/ada/node_modules/.bin:${env:PATH}"
113-
}
114-
},
115106
"preLaunchTask": "npm: pretest"
116107
},
117108
{
@@ -121,6 +112,45 @@
121112
"target": ".obj/server/ada_language_server",
122113
"cwd": "${workspaceRoot}",
123114
"valuesFormatting": "parseText"
115+
},
116+
{
117+
"name": "Extension Tests (Test Name Regexp)",
118+
"type": "extensionHost",
119+
"request": "launch",
120+
"runtimeExecutable": "${execPath}",
121+
"outFiles": [
122+
"${workspaceFolder}/integration/vscode/ada/out/**/*.js",
123+
"!**/node_modules/**"
124+
],
125+
"args": [
126+
"--extensionDevelopmentPath=${workspaceFolder}/integration/vscode/ada",
127+
"--extensionTestsPath=${workspaceFolder}/integration/vscode/ada/out/test/suite/index",
128+
"${workspaceFolder}/integration/vscode/ada/test/TestWorkspace"
129+
],
130+
// Below we make the executables of node modules visible to the tests.
131+
// In particular, vscode-tmgrammar-snap is used for syntax highlighting
132+
// tests.
133+
"env": {
134+
"MOCHA_GREP": "${input:testPattern}",
135+
// This is necessary to make the "child" vscode inherit the PATH
136+
// variable set in the workspace settings. Without it in some setups
137+
// (e.g. vscode remote) the child vscode does not get visibility
138+
// over the Ada toolchain available in the parent vscode
139+
// environment.
140+
"PATH": "${env:PATH}",
141+
// This is custom env var that we use in
142+
// integration/vscode/ada/test/suite/index.ts to prevent timeouts in
143+
// tests when debugging
144+
"MOCHA_TIMEOUT": "0"
145+
},
146+
"preLaunchTask": "npm: pretest"
147+
}
148+
],
149+
"inputs": [
150+
{
151+
"id": "testPattern",
152+
"description": "A regexp of tests to run",
153+
"type": "promptString"
124154
}
125155
]
126156
}

.vscode/settings.json.tmpl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"ada.projectFile": "gnat/lsp_server.gpr",
33
"ada.scenarioVariables": {
44
// Use static linking in local development to enable running the
5-
// ada_language_server executable after relaction into the VS Code
5+
// ada_language_server executable after relocation into the VS Code
66
// extension.
77
"LIBRARY_TYPE": "static"
88
"ada.onTypeFormatting.indentOnly": true,
@@ -32,7 +32,16 @@
3232
// Alternatively, dependencies can be obtained from different locations
3333
// and GPR_PROJECT_PATH can be set prior to invoking VS Code, making them
3434
// also visible if not overwritten in the subprojects/ directory.
35-
"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}"
35+
"GPR_PROJECT_PATH": "${workspaceFolder}/subprojects/VSS/gnat:${workspaceFolder}/subprojects/gnatdoc/gnat:${workspaceFolder}/subprojects/libadalang-tools/src:${workspaceFolder}/subprojects/lal-refactor/gnat:${workspaceFolder}/subprojects/spawn/gnat:${workspaceFolder}/subprojects/stubs:${workspaceFolder}/subprojects/prefix/share/gpr:${env:GPR_PROJECT_PATH}",
36+
"LIBRARY_TYPE": "static"
37+
},
38+
"terminal.integrated.env.linux": {
39+
"GPR_PROJECT_PATH": "${workspaceFolder}/subprojects/VSS/gnat:${workspaceFolder}/subprojects/gnatdoc/gnat:${workspaceFolder}/subprojects/libadalang-tools/src:${workspaceFolder}/subprojects/lal-refactor/gnat:${workspaceFolder}/subprojects/spawn/gnat:${workspaceFolder}/subprojects/stubs:${workspaceFolder}/subprojects/prefix/share/gpr:${env:GPR_PROJECT_PATH}",
40+
"LIBRARY_TYPE": "static"
41+
},
42+
"terminal.integrated.env.windows": {
43+
"GPR_PROJECT_PATH": "${workspaceFolder}/subprojects/VSS/gnat:${workspaceFolder}/subprojects/gnatdoc/gnat:${workspaceFolder}/subprojects/libadalang-tools/src:${workspaceFolder}/subprojects/lal-refactor/gnat:${workspaceFolder}/subprojects/spawn/gnat:${workspaceFolder}/subprojects/stubs:${workspaceFolder}/subprojects/prefix/share/gpr:${env:GPR_PROJECT_PATH}",
44+
"LIBRARY_TYPE": "static"
3645
},
3746
// To develop the VS Code extension, it is recommended to open the workspace
3847
// defined at integration/vscode/ada. Nonetheless, this configuration allows

0 commit comments

Comments
 (0)