Skip to content

Commit 95a585a

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents fcb76c5 + dbae26f commit 95a585a

File tree

17 files changed

+236
-48
lines changed

17 files changed

+236
-48
lines changed

.github/workflows/build-binaries.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ set -x -e
66
DEBUG=$1 # Value is '' or 'debug'
77
RUNNER_OS=$2 # ${{ runner.os }} is Linux, Windiws, maxOS
88
TAG=$3 # For master it's 23.0.999, while for tag it's the tag itself
9+
NO_REBASE=$4 # Specify this to skip the rebase over the edge branch. Used for local debugging.
10+
911
prefix=/tmp/ADALIB_DIR
1012

1113
if [ $RUNNER_OS = Windows ]; then
@@ -29,7 +31,7 @@ echo PATH=$PATH
2931
BRANCH=master
3032

3133
# Rebase PR on edge branch
32-
if [[ ${GITHUB_REF##*/} != 2*.[0-9]*.[0-9]* ]]; then
34+
if [[ -z "$NO_REBASE" && ${GITHUB_REF##*/} != 2*.[0-9]*.[0-9]* ]]; then
3335
git config user.email "`git log -1 --pretty=format:'%ae'`"
3436
git config user.name "`git log -1 --pretty=format:'%an'`"
3537
git config core.autocrlf
@@ -79,7 +81,7 @@ make -C subprojects/templates-parser setup prefix=$prefix \
7981
ENABLE_SHARED=no \
8082
${DEBUG:+BUILD=debug} build-static install-static
8183

82-
make LIBRARY_TYPE=static all check
84+
make LIBRARY_TYPE=static VERSION=$TAG all check
8385

8486
function fix_rpath ()
8587
{
@@ -96,7 +98,14 @@ if [ $RUNNER_OS = macOS ]; then
9698
fi
9799

98100
if [ "$DEBUG" != "debug" ]; then
99-
ALS=`ls integration/vscode/ada/*/ada_language_server*`
101+
# Here it's better to match an exact extension rather than mathing
102+
# ada_language_server* because when running locally, the latter could match
103+
# ada_language_server.dSYM from a previous run if it exists.
104+
if [ $RUNNER_OS = Windows ]; then
105+
ALS=`ls integration/vscode/ada/*/ada_language_server.exe`
106+
else
107+
ALS=`ls integration/vscode/ada/*/ada_language_server`
108+
fi
100109
cd `dirname $ALS`
101110
ALS=`basename ${ALS}`
102111
if [ $RUNNER_OS = macOS ]; then

.github/workflows/pack-binaries.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function make_change_log()
1919

2020
chmod -R -v +x als-*-$DEBUG
2121
for X in Linux macOS Windows ; do mv -v -f als-$X-$DEBUG/* integration/vscode/ada/; done
22-
rm -f -v integration/vscode/ada/{linux,darwin,win32}/*.debug
22+
rm -f -v integration/vscode/ada/{linux,darwin,win32}/*.{debug,dSYM}
2323
pushd integration/vscode/ada
2424
sed -i -e "/version/s/[0-9][0-9.]*/$TAG/" package.json
2525
[ -z "$DEBUG" ] || sed -i -e '/^ "name"/s/ada/ada-debug/' \

.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+
}

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Server executable file:
22
ROOTDIR=$(shell pwd)
33

4+
# ALS version
5+
VERSION ?=
46
# Location of home dir for tests
57
export ALS_HOME=$(ROOTDIR)/testsuite
68

@@ -74,10 +76,10 @@ all: coverage-instrument
7476
$(GPRBUILD) -P gnat/tester.gpr -p $(BUILD_FLAGS)
7577
$(GPRBUILD) -d -ws -c -u -P gnat/lsp_server.gpr -p $(BUILD_FLAGS) s-memory.adb
7678
$(GPRBUILD) -P gnat/lsp_server.gpr -p $(COVERAGE_BUILD_FLAGS) \
77-
-XVERSION=$(TRAVIS_TAG)
79+
-XVERSION=$(VERSION)
7880
$(GPRBUILD) -P gnat/codec_test.gpr -p $(COVERAGE_BUILD_FLAGS)
7981
$(GPRBUILD) -P gnat/lsp_client.gpr -p $(COVERAGE_BUILD_FLAGS) \
80-
-XVERSION=$(TRAVIS_TAG)
82+
-XVERSION=$(VERSION)
8183
mkdir -p integration/vscode/ada/$(PLATFORM)
8284
cp -f $(ALS)$(EXE) integration/vscode/ada/$(PLATFORM)
8385

@@ -92,7 +94,7 @@ ifneq ($(COVERAGE),)
9294
# Remove artifacts from previous instrumentations, so that stale units that
9395
# are not overriden by new ones don't get in our way.
9496
rm -rf .obj/*/gnatcov-instr
95-
$(COVERAGE_INSTR) -XVERSION=$(TRAVIS_TAG) \
97+
$(COVERAGE_INSTR) -XVERSION=$(VERSION) \
9698
-Pgnat/lsp_server.gpr --projects lsp_server --projects lsp
9799
$(COVERAGE_INSTR) -Pgnat/tester.gpr --projects lsp
98100
$(COVERAGE_INSTR) -Pgnat/codec_test.gpr --projects lsp

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ To build the language server you need:
8080
Project files of the libraries must be available via the `GPR_PROJECT_PATH`
8181
environment variable.
8282

83-
To run the language server you need `gnatls` (parts of GNAT installation)
83+
If you intend to use VS Code on this workspace, it is recommended to check out
84+
these dependencies under `subprojects/` or install them under
85+
`subprojects/prefix`. That will make them automatically visible to the VS Code
86+
Ada extension in this workspace.
87+
88+
To run the language server you need `gnatls` (part of GNAT installation)
8489
somewhere in the path.
8590

8691
## Usage

doc/HACKING.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ about memory usage, allowing to track down which parts of the program consumes
3636
the most memory.
3737
This is very useful to resolve unexpected memory consumption issues.
3838

39+
## Getting symbolic backtrace
40+
41+
To get a symbolic backtrace you need the debug information files. For the
42+
release you can download them from
43+
[GitHub Release](https://github.com/AdaCore/ada_language_server/releases)
44+
Assets. Assets contain an archive per platform with the ALS
45+
executable and debug information files (`.debug` file on Linux/Windows and
46+
`.dSYM` directory for Mac OS X). Extract the debug information to the directory
47+
containing ALS (usually this is
48+
`$HOME/.vscode/extensions/adacore.ada-*/{darwin,linux,win32}`)
49+
and run
50+
51+
addr2line ada_language_server <hex backtrace>
52+
53+
On Mac OX X use [atos](https://www.unix.com/man-page/osx/1/atos/) instead.
54+
3955
### Writing tests
4056

4157
To write a functional test for Ada Language Server:
@@ -116,16 +132,16 @@ Release notes
116132
```
117133
118134
Then push it to GitHub with `git push 22.0.3` or `git push --tags`.
119-
The travis CI will publish the extension on the marketplace.
135+
The GitHub CI will publish the extension on the marketplace and the
136+
[Open VSX Registry](https://open-vsx.org). It also makes GitHub Release and
137+
put archives with ALS executables and debug information files.
120138
121139
## Source directories
122140
123141
The repository contains the following folders:
124142
125143
* `doc/` - documentation of the project and LSP extensions
126144
* `gnat/` - GNAT project files
127-
* `integration/appveyor/` - Appveyor CI (Windows) integration scripts
128-
* `integration/travis/` - Travis CI (Linux and Mac OS) integration scripts
129145
* `integration/vscode/ada/` - VS Code extension sources
130146
* `scripts/` - some support scripts
131147
* `ada_language_server/source/ada/` - LSP implementation for Ada language

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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"request": "launch",
88
"runtimeExecutable": "${execPath}",
99
"args": [
10-
"--extensionDevelopmentPath=${workspaceFolder}"
10+
"--extensionDevelopmentPath=${workspaceFolder}",
11+
"${workspaceFolder}/debug.code-workspace"
1112
],
12-
"preLaunchTask": "npm: compile",
13+
"preLaunchTask": "npm: compile"
1314
},
1415
{
1516
"name": "Extension Tests",
@@ -24,4 +25,4 @@
2425
"preLaunchTask": "npm: pretest"
2526
}
2627
]
27-
}
28+
}

0 commit comments

Comments
 (0)