Skip to content

Commit fee6bbc

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr/codeclown/119480
2 parents 9a4acba + 1e8565d commit fee6bbc

File tree

3,536 files changed

+270774
-118065
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,536 files changed

+270774
-118065
lines changed

.devcontainer/README.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,98 @@
11
# Code - OSS Development Container
22

3-
This repository includes configuration for a development container for working with Code - OSS in an isolated local container or using [GitHub Codespaces](https://github.com/features/codespaces).
3+
This repository includes configuration for a development container for working with Code - OSS in a local container or using [GitHub Codespaces](https://github.com/features/codespaces).
44

5-
> **Tip:** The default VNC password is `vscode`. The VNC server runs on port `5901` with a web client at `6080`. For better performance, we recommend using a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/). Applications like the macOS Screen Sharing app will not perform as well.
5+
> **Tip:** The default VNC password is `vscode`. The VNC server runs on port `5901` and a web client is available on port `6080`.
66
77
## Quick start - local
88

99
1. Install Docker Desktop or Docker for Linux on your local machine. (See [docs](https://aka.ms/vscode-remote/containers/getting-started) for additional details.)
1010

11-
2. **Important**: Docker needs at least **4 Cores and 6 GB of RAM (8 GB recommended)** to run full build. If you on macOS, or using the old Hyper-V engine for Windows, update these values for Docker Desktop by right-clicking on the Docker status bar item, going to **Preferences/Settings > Resources > Advanced**.
11+
2. **Important**: Docker needs at least **4 Cores and 6 GB of RAM (8 GB recommended)** to run a full build. If you are on macOS, or are using the old Hyper-V engine for Windows, update these values for Docker Desktop by right-clicking on the Docker status bar item and going to **Preferences/Settings > Resources > Advanced**.
1212

1313
> **Note:** The [Resource Monitor](https://marketplace.visualstudio.com/items?itemName=mutantdino.resourcemonitor) extension is included in the container so you can keep an eye on CPU/Memory in the status bar.
1414
1515
3. Install [Visual Studio Code Stable](https://code.visualstudio.com/) or [Insiders](https://code.visualstudio.com/insiders/) and the [Remote - Containers](https://aka.ms/vscode-remote/download/containers) extension.
1616

1717
![Image of Remote - Containers extension](https://microsoft.github.io/vscode-remote-release/images/remote-containers-extn.png)
1818

19-
> Note that the Remote - Containers extension requires the Visual Studio Code distribution of Code - OSS. See the [FAQ](https://aka.ms/vscode-remote/faq/license) for details.
19+
> **Note:** The Remote - Containers extension requires the Visual Studio Code distribution of Code - OSS. See the [FAQ](https://aka.ms/vscode-remote/faq/license) for details.
2020
21-
4. Press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> and select **Remote-Containers: Clone Repository in Container Volume...**.
21+
4. Press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd> and select **Remote-Containers: Clone Repository in Container Volume...**.
2222

23-
> **Tip:** While you can use your local source tree instead, operations like `yarn install` can be slow on macOS or using the Hyper-V engine on Windows. We recommend the "clone repository in container" approach instead since it uses "named volume" rather than the local filesystem.
23+
> **Tip:** While you can use your local source tree instead, operations like `yarn install` can be slow on macOS or when using the Hyper-V engine on Windows. We recommend the "clone repository in container" approach instead since it uses "named volume" rather than the local filesystem.
2424
2525
5. Type `https://github.com/microsoft/vscode` (or a branch or PR URL) in the input box and press <kbd>Enter</kbd>.
2626

27-
6. After the container is running, open a web browser and go to [http://localhost:6080](http://localhost:6080) or use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to `localhost:5901` and enter `vscode` as the password.
27+
6. After the container is running, open a web browser and go to [http://localhost:6080](http://localhost:6080), or use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to `localhost:5901` and enter `vscode` as the password.
2828

29-
Anything you start in VS Code or the integrated terminal will appear here.
29+
Anything you start in VS Code, or the integrated terminal, will appear here.
3030

3131
Next: **[Try it out!](#try-it)**
3232

3333
## Quick start - GitHub Codespaces
3434

35-
> **IMPORTANT:** You need to use a "Standard" sized codespace or larger (4-core, 8GB) since VS Code needs 6GB of RAM to compile. This is now the default for GitHub Codespaces, but do not downgrade to "Basic" unless you do not intend to compile.
35+
1. From the [microsoft/vscode GitHub repository](https://github.com/microsoft/vscode), click on the **Code** dropdown, select **Open with Codespaces**, and then click on **New codespace**. If prompted, select the **Standard** machine size (which is also the default).
3636

37-
1. From the [microsoft/vscode GitHub repository](https://github.com/microsoft/vscode), click on the **Code** dropdown, select **Open with Codespaces**, and the **New codespace**
37+
> **Note:** You will not see these options within GitHub if you are not in the Codespaces beta.
3838
39-
> Note that you will not see these options if you are not in the beta yet.
39+
2. After the codespace is up and running in your browser, press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd> and select **Ports: Focus on Ports View**.
4040

41-
2. After the codespace is up and running in your browser, press <kbd>F1</kbd> and select **Ports: Focus on Ports View**.
41+
3. You should see **VNC web client (6080)** under in the list of ports. Select the line and click on the globe icon to open it in a browser tab.
4242

43-
3. You should see port `6080` under **Forwarded Ports**. Select the line and click on the globe icon to open it in a browser tab.
44-
45-
> If you do not see port `6080`, press <kbd>F1</kbd>, select **Forward a Port** and enter port `6080`.
43+
> **Tip:** If you do not see the port, <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd>, select **Forward a Port** and enter port `6080`.
4644
4745
4. In the new tab, you should see noVNC. Click **Connect** and enter `vscode` as the password.
4846

49-
Anything you start in VS Code or the integrated terminal will appear here.
47+
Anything you start in VS Code, or the integrated terminal, will appear here.
5048

5149
Next: **[Try it out!](#try-it)**
5250

5351
### Using VS Code with GitHub Codespaces
5452

55-
You will likely see better performance when accessing the codespace you created from VS Code since you can use a[VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/). Here's how to do it.
53+
You may see improved VNC responsiveness when accessing a codespace from VS Code client since you can use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/). Here's how to do it.
54+
55+
1. Install [Visual Studio Code Stable](https://code.visualstudio.com/) or [Insiders](https://code.visualstudio.com/insiders/) and the the [GitHub Codespaces extension](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces).
5656

57-
1. [Create a codespace](#quick-start---github-codespaces) if you have not already.
57+
> **Note:** The GitHub Codespaces extension requires the Visual Studio Code distribution of Code - OSS.
5858
59-
2. Set up [VS Code for use with GitHub Codespaces](https://docs.github.com/github/developing-online-with-codespaces/using-codespaces-in-visual-studio-code)
59+
2. After the VS Code is up and running, press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd>, choose **Codespaces: Create New Codespace**, and use the following settings:
60+
- `microsoft/vscode` for the repository.
61+
- Select any branch (e.g. **main**) - you select a different one later.
62+
- Choose **Standard** (4-core, 8GB) as the size.
6063

61-
3. After the VS Code is up and running, press <kbd>F1</kbd>, choose **Codespaces: Connect to Codespace**, and select the codespace you created.
64+
4. After you have connected to the codespace, you can use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to `localhost:5901` and enter `vscode` as the password.
6265

63-
4. After you've connected to the codespace, use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to `localhost:5901` and enter `vscode` as the password.
66+
> **Tip:** You may also need change your VNC client's **Picture Quaility** setting to **High** to get a full color desktop.
6467
65-
5. Anything you start in VS Code or the integrated terminal will appear here.
68+
5. Anything you start in VS Code, or the integrated terminal, will appear here.
6669

6770
Next: **[Try it out!](#try-it)**
6871

6972
## Try it!
7073

7174
This container uses the [Fluxbox](http://fluxbox.org/) window manager to keep things lean. **Right-click on the desktop** to see menu options. It works with GNOME and GTK applications, so other tools can be installed if needed.
7275

73-
Note you can also set the resolution from the command line by typing `set-resolution`.
76+
> **Note:** You can also set the resolution from the command line by typing `set-resolution`.
7477
7578
To start working with Code - OSS, follow these steps:
7679

77-
1. In your local VS Code, open a terminal (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>\`</kbd>) and type the following commands:
80+
1. In your local VS Code client, open a terminal (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>\`</kbd>) and type the following commands:
7881

7982
```bash
8083
yarn install
8184
bash scripts/code.sh
8285
```
8386

84-
Note that a previous run of `yarn install` will already be cached, so this step should simply pick up any recent differences.
85-
86-
2. After the build is complete, open a web browser or a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to the desktop environnement as described in the quick start and enter `vscode` as the password.
87+
2. After the build is complete, open a web browser or a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to the desktop environment as described in the quick start and enter `vscode` as the password.
8788

8889
3. You should now see Code - OSS!
8990

9091
Next, let's try debugging.
9192
9293
1. Shut down Code - OSS by clicking the box in the upper right corner of the Code - OSS window through your browser or VNC viewer.
9394
94-
2. Go to your local VS Code client, and use Run / Debug view to launch the **VS Code** configuration. (Typically the default, so you can likely just press <kbd>F5</kbd>).
95+
2. Go to your local VS Code client, and use the **Run / Debug** view to launch the **VS Code** configuration. (Typically the default, so you can likely just press <kbd>F5</kbd>).
9596
9697
> **Note:** If launching times out, you can increase the value of `timeout` in the "VS Code", "Attach Main Process", "Attach Extension Host", and "Attach to Shared Process" configurations in [launch.json](../.vscode/launch.json). However, running `scripts/code.sh` first will set up Electron which will usually solve timeout issues.
9798

.devcontainer/cache/before-cache.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

3-
# This file establishes a basline for the reposuitory before any steps in the "prepare.sh"
3+
# This file establishes a basline for the repository before any steps in the "prepare.sh"
44
# are run. Its just a find command that filters out a few things we don't need to watch.
55

66
set -e
77

8-
SCRIPT_PATH="$(cd "$(dirname $0)" && pwd)"
8+
SCRIPT_PATH="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
99
SOURCE_FOLDER="${1:-"."}"
1010

1111
cd "${SOURCE_FOLDER}"

.devcontainer/cache/build-cache-image.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
22

3-
# This file simply wraps the dockeer build command used to build the image with the
4-
# cached result of the commands from "prepare.sh" and pushes it to the specified
5-
# container image registry.
3+
# This file simply wraps the docker build command to build an image that includes
4+
# a cache.tar file with the result of "prepare.sh" inside of it. See cache.Dockerfile
5+
# for the steps that are actually taken to do this.
66

77
set -e
88

9-
SCRIPT_PATH="$(cd "$(dirname $0)" && pwd)"
9+
SCRIPT_PATH="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
1010
CONTAINER_IMAGE_REPOSITORY="$1"
1111
BRANCH="${2:-"main"}"
1212

.devcontainer/cache/cache-diff.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# This file is used to archive off a copy of any differences in the source tree into another location
4-
# in the image. Once the codespace is up, this will be restored into its proper location (which is
5-
# quick and happens parallel to other startup activities)
4+
# in the image. Once the codespace / container is up, this will be restored into its proper location.
65

76
set -e
87

9-
SCRIPT_PATH="$(cd "$(dirname $0)" && pwd)"
8+
SCRIPT_PATH="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
109
SOURCE_FOLDER="${1:-"."}"
1110
CACHE_FOLDER="${2:-"/usr/local/etc/devcontainer-cache"}"
1211

.devcontainer/cache/cache.Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# This dockerfile is used to build up from a base image to create an image with cached results of running "prepare.sh".
1+
# This dockerfile is used to build up from a base image to create an image a cache.tar file containing the results of running "prepare.sh".
22
# Other image contents: https://github.com/microsoft/vscode-dev-containers/blob/master/repository-containers/images/github.com/microsoft/vscode/.devcontainer/base.Dockerfile
3-
FROM mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:dev
43

4+
# This first stage generates cache.tar
5+
FROM mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:dev as cache
56
ARG USERNAME=node
67
COPY --chown=${USERNAME}:${USERNAME} . /repo-source-tmp/
78
RUN mkdir /usr/local/etc/devcontainer-cache \
@@ -10,5 +11,12 @@ RUN mkdir /usr/local/etc/devcontainer-cache \
1011
cd /repo-source-tmp \
1112
&& .devcontainer/cache/before-cache.sh \
1213
&& .devcontainer/prepare.sh \
13-
&& .devcontainer/cache/cache-diff.sh" \
14-
&& rm -rf /repo-source-tmp
14+
&& .devcontainer/cache/cache-diff.sh"
15+
16+
# This second stage starts fresh and just copies in cache.tar from the previous stage. The related
17+
# devcontainer.json file is then setup to have postCreateCommand fire restore-diff.sh to expand it.
18+
FROM mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:dev as dev-container
19+
ARG USERNAME=node
20+
ARG CACHE_FOLDER="/usr/local/etc/devcontainer-cache"
21+
RUN mkdir -p "${CACHE_FOLDER}" && chown "${USERNAME}:${USERNAME}" "${CACHE_FOLDER}"
22+
COPY --from=cache ${CACHE_FOLDER}/cache.tar ${CACHE_FOLDER}/

.devcontainer/cache/restore-diff.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

3-
# This file restores the results of the "prepare.sh" into their proper locations
4-
# once the container has been created. It runs as a postCreateCommand which
5-
# in GitHub Codespaces occurs parallel to other startup activities and does not
6-
# really add to the overal startup time given how quick the operation ends up being.
3+
# This file expands the cache.tar file in the image that contains the results of "prepare.sh"
4+
# on top of the source tree. It runs as a postCreateCommand which runs after the container/codespace
5+
# is already up where you would typically run a command like "yarn install".
76

87
set -e
98

.devcontainer/devcontainer.json

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,38 @@
33

44
// Image contents: https://github.com/microsoft/vscode-dev-containers/blob/master/repository-containers/images/github.com/microsoft/vscode/.devcontainer/base.Dockerfile
55
"image": "mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:branch-main",
6-
7-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/node/workspace/vscode,type=bind,consistency=cached",
8-
"workspaceFolder": "/home/node/workspace/vscode",
96
"overrideCommand": false,
107
"runArgs": [ "--init", "--security-opt", "seccomp=unconfined"],
118

129
"settings": {
13-
"terminal.integrated.shell.linux": "/bin/bash",
1410
"resmon.show.battery": false,
1511
"resmon.show.cpufreq": false
1612
},
1713

18-
// noVNC, VNC, debug ports
19-
"forwardPorts": [6080, 5901, 9222],
14+
// noVNC, VNC
15+
"forwardPorts": [6080, 5901],
16+
"portsAttributes": {
17+
"6080": {
18+
"label": "VNC web client (noVNC)",
19+
"onAutoForward": "silent"
20+
},
21+
"5901": {
22+
"label": "VNC TCP port",
23+
"onAutoForward": "silent"
24+
}
25+
},
2026

2127
"extensions": [
2228
"dbaeumer.vscode-eslint",
2329
"mutantdino.resourcemonitor"
2430
],
2531

2632
// Optionally loads a cached yarn install for the repo
27-
"postCreateCommand": ".devcontainer/cache/restore-diff.sh",
33+
"postCreateCommand": ".devcontainer/cache/restore-diff.sh && sudo chown node:node /workspaces",
34+
35+
"remoteUser": "node",
2836

29-
"remoteUser": "node"
37+
"hostRequirements": {
38+
"memory": "6gb"
39+
}
3040
}

.devcontainer/prepare.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

3-
# This file contains the steps that should be run when creating the intermediary image that contains
4-
# contents for that should be in the image by default. It will be used to build up from the base image
5-
# to create an image that speeds up first time use of the dev container by "caching" the results
6-
# of these commands. Developers can still run these commands without an issue once the container is
7-
# up, but only differences will be processed which also speeds up the first time these operations occur.
3+
# This file contains the steps that should be run when building a "cache" image with contents that should be
4+
# layered directly **on top of the source tree** once a dev container is created. This avoids having to run long
5+
# running commands like "yarn install" from the ground up. Developers (and should) still run these commands
6+
# after the actual dev container is created, but only differences will be processed.
87

98
yarn install
109
yarn electron

.eslintignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**/vs/css.build.js
44
**/vs/css.js
55
**/vs/loader.js
6-
**/insane/**
6+
**/dompurify/**
77
**/marked/**
88
**/semver/**
99
**/test/**/*.js
@@ -16,3 +16,8 @@
1616
**/extensions/markdown-language-features/notebook-out/**
1717
**/extensions/typescript-basics/test/colorize-fixtures/**
1818
**/extensions/**/dist/**
19+
**/extensions/typescript-language-features/test-workspace/**
20+
21+
# These files are not linted by `yarn eslint`, so we exclude them from being linted in the editor.
22+
# This ensures that if we add new rules and they pass CI, there are also no errors in the editor.
23+
/resources/web/code-web.js

0 commit comments

Comments
 (0)