Skip to content

Commit 4613542

Browse files
committed
Document development environment under macOS on Apple silicon
1 parent 590a07c commit 4613542

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

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

integration/vscode/ada/CONTRIBUTING.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,46 @@
22

33
This document will describe the necessary information required to contribute to the [VS Code](https://code.visualstudio.com/) extension.
44

5+
## Developer Setup
6+
7+
It is recommended to use the VS Code workspace defined at the root of this Git
8+
repository for development of the VS Code Ada extension. Run this initially to install all dependencies:
9+
10+
```
11+
cd integration/vscode/ada; npm install
12+
```
13+
14+
And then use the task `npm: compile` for compilation and the launch
15+
configuration `Launch Extension` for local testing and debugging.
16+
17+
### macOS on Apple M1/M2 processors
18+
19+
On macOS with Apple M1/M2 processors, using a native arm64 `node`/`npm` will
20+
result in an error as the VS Code Ada extension is not yet ready to support the
21+
arm64 architecture on all platforms. To work around this, install and use an
22+
x86_64 version of Node.js. You can download it from the
23+
[Node.js](https://nodejs.org/en/download) website or using an x86_64
24+
installation of [Homebrew](https://brew.sh/).
25+
26+
Homebrew x86_64 can be installed by prefixing the Homebrew installation command
27+
with `arch -x86_64 ...`. By default the x86_64 Homebrew uses the `/usr/local`
28+
prefix while the arm64 Homebrew uses the `/opt/homebrew` prefix so both
29+
installations can co-exist. To use the x86_64 Homebrew, e.g. to install the
30+
x86_64 Node.js, invoke it as follows:
31+
32+
```
33+
arch -x86_64 /usr/local/bin/brew install node npm
34+
```
35+
36+
And then update the `PATH` environment variable to make sure the x86_64 `node` executable gets used:
37+
38+
```
39+
cd integration/vscode/ada; PATH=/usr/local/bin:$PATH npm install
40+
```
41+
42+
Once the initial `npm install` step is done in x86_64 mode, VS Code will be able
43+
to use the installed x86_64 dependencies seemlessly.
44+
545
## Terminology
646

747
### Syntax Highlighter

0 commit comments

Comments
 (0)