Skip to content

Commit 4f5f910

Browse files
authored
Merge branch 'main' into remove-5.8-support
2 parents 4eccc58 + 5e18396 commit 4f5f910

File tree

115 files changed

+17842
-3992
lines changed

Some content is hidden

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

115 files changed

+17842
-3992
lines changed

.devcontainer/Dockerfile

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
FROM swiftlang/swift:nightly-6.2-jammy
1+
FROM swiftlang/swift:nightly-jammy
22

3+
# python3-lldb-13 is only needed for swiftly and a great dep to remove to test post-install script ;)
34
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
45
&& apt-get -q update \
56
&& apt-get -q dist-upgrade -y \
@@ -9,8 +10,11 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
910
libsqlite3-dev \
1011
libncurses5-dev \
1112
python3 \
12-
build-essential
13+
python3-lldb-13 \
14+
build-essential \
15+
sudo
1316

17+
# Install nvm / Node.js
1418
RUN mkdir -p /usr/local/nvm
1519
ENV NVM_DIR /usr/local/nvm
1620
ENV NODE_VERSION v20.19.0
@@ -21,3 +25,24 @@ ENV PATH $NODE_PATH:$PATH
2125
RUN npm -v
2226
RUN node -v
2327

28+
# Create a "vscode" user that is a sudoer
29+
RUN useradd -ms /bin/bash vscode
30+
RUN echo "vscode:vscode" | chpasswd
31+
RUN adduser vscode sudo
32+
33+
# Install swiftly
34+
USER vscode
35+
ENV SWIFTLY_HOME_DIR /home/vscode/.swiftly
36+
ENV SWIFTLY_BIN_DIR /home/vscode/.swiftly/bin
37+
ENV SWIFTLY_TOOLCHAINS_DIR /home/vscode/.swiftly/bin
38+
RUN mkdir -p $SWIFTLY_HOME_DIR
39+
RUN cd ~ && curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz && \
40+
tar zxf swiftly-$(uname -m).tar.gz && \
41+
./swiftly init --quiet-shell-followup && \
42+
. "${SWIFTLY_HOME_DIR}/env.sh" && \
43+
hash -r
44+
45+
# Use swiftly toolchain by default
46+
RUN echo "export SWIFTLY_HOME_DIR=$SWIFTLY_HOME_DIR" >> ~/.bashrc
47+
RUN echo "export SWIFTLY_BIN_DIR=$SWIFTLY_BIN_DIR" >> ~/.bashrc
48+
RUN echo '. "${SWIFTLY_HOME_DIR}/env.sh"' >> ~/.bashrc

.devcontainer/devcontainer.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
"features": {
55
"ghcr.io/devcontainers/features/common-utils:2": {
66
"installZsh": "false",
7-
"username": "vscode",
8-
"userUid": "1000",
9-
"userGid": "1000",
107
"upgradePackages": "false"
118
},
129
"ghcr.io/devcontainers/features/git:1": {
@@ -35,7 +32,8 @@
3532
"source=node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume"
3633
],
3734
// Use 'postCreateCommand' to run commands after the container is created.
38-
"postCreateCommand": "sudo chown vscode node_modules && npm install",
35+
// Modify /etc/sudoers.d/vscode to make sure we're always prompted for root password for testing askpass.
36+
"postCreateCommand": "sudo chown vscode node_modules && echo 'vscode ALL=(ALL:ALL) ALL' | sudo tee /etc/sudoers.d/vscode && npm install",
3937
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
4038
"remoteUser": "vscode"
4139
}

.eslintrc.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@
66
"sourceType": "module",
77
"project": true
88
},
9-
"plugins": ["@typescript-eslint"],
9+
"plugins": ["@typescript-eslint", "mocha"],
1010
"rules": {
1111
"curly": "error",
1212
"eqeqeq": "warn",
1313
"no-throw-literal": "warn",
1414
// TODO "@typescript-eslint/semi" rule moved to https://eslint.style
1515
"semi": "error",
1616
"no-console": "warn",
17+
"mocha/no-exclusive-tests": "error",
18+
"no-restricted-syntax": [
19+
"error",
20+
{
21+
"selector": "CallExpression[callee.object.object.callee.name='tag'][callee.property.name='only']",
22+
"message": "Unexpected exclusive mocha test with tag().suite.only() or tag().test.only()"
23+
}
24+
],
1725
"@typescript-eslint/no-floating-promises": ["warn", { "checkThenables": true }],
1826
"@typescript-eslint/await-thenable": "warn",
1927
// Mostly fails tests, ex. expect(...).to.be.true returns a Chai.Assertion

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,10 @@ A clear and concise description of what you expected to happen.
2626
- Visual Studio Code version:
2727
- vscode-swift version:
2828

29+
**Diagnostics Bundle**
30+
The diagnostics bundle can help determine the root cause of bugs much quicker. To share this information execute the `>Swift: Capture Diagnostics Bundle` command and attach the archive to the bug report.
31+
32+
*Select the "Minimal" bundle to only share the Swift extension's log and your configured `swift.` settings. Select the "Full" bundle if you're comfortable sharing the SourceKit-LSP diagnostic bundle and LLDB-DAP logs, which may contain source code*
33+
2934
**Additional context**
3035
Add any other context about the problem here.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
cooldown:
8+
default-days: 7
79
open-pull-requests-limit: 5
810
allow:
911
- dependency-type: direct
@@ -22,6 +24,11 @@ updates:
2224
- dependency-name: "@types/svgicons2svgfont"
2325
- dependency-name: "octokit"
2426
update-types: ["version-update:semver-major"]
27+
- dependency-name: "eslint-plugin-mocha"
28+
update-types: ["version-update:semver-major"]
29+
# Newer versions of fantasticon are broken on Windows.
30+
# https://github.com/tancredi/fantasticon/issues/470
31+
- dependency-name: "fantasticon"
2532
groups:
2633
all-dependencies:
2734
patterns:

.github/workflows/nightly.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
name: Nightly
22

3+
permissions:
4+
contents: read
5+
36
on:
47
schedule:
58
- cron: "0 0 * * *"
69
workflow_dispatch:
10+
inputs:
11+
patchRelease:
12+
description: 'Make a patch release'
13+
required: false
14+
type: boolean
715

816
jobs:
917
package:
@@ -24,7 +32,12 @@ jobs:
2432
. .github/workflows/scripts/setup-linux.sh
2533
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
2634
npm ci
27-
npm run package
35+
if [ "${{github.event.inputs.patchRelease}}" = "true" ]; then
36+
echo "Making patch release\n"
37+
npm run patch-package
38+
else
39+
npm run package
40+
fi
2841
npm run preview-package
2942
for file in *.vsix; do
3043
name="$(basename "$file" .vsix)-${{github.run_number}}.vsix"
@@ -62,7 +75,7 @@ jobs:
6275
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
6376
linux_build_command: ./scripts/test.sh
6477
# Windows
65-
windows_exclude_swift_versions: '[{"swift_version": "nightly-6.1"},{"swift_version": "nightly"}]' # Missing https://github.com/swiftlang/swift/pull/80144
78+
windows_exclude_swift_versions: '[{"swift_version": "nightly-6.1"}, {"swift_version": "nightly"}, {"swift_version": "6.2"}]' # Missing https://github.com/swiftlang/swift/pull/80144
6679
windows_env_vars: |
6780
CI=1
6881
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
@@ -101,3 +114,5 @@ jobs:
101114
windows_pre_build_command: . .github\workflows\scripts\windows\setup.ps1
102115
windows_build_command: Invoke-Program scripts\test_windows.ps1
103116
enable_windows_docker: false
117+
# TODO re-enable when 6.2.1 toolchain working
118+
enable_windows_checks: false

.github/workflows/pull_request.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Pull request
22

3+
permissions:
4+
contents: read
5+
36
on:
47
pull_request:
58
types: [opened, reopened, synchronize]
@@ -61,7 +64,7 @@ jobs:
6164
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
6265
linux_build_command: ./scripts/test.sh
6366
# Windows
64-
windows_exclude_swift_versions: "${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '[{\"swift_version\": \"nightly-6.1\"},{\"swift_version\": \"nightly\"}]' || '[{\"swift_version\": \"nightly-6.1\"},{\"swift_version\": \"nightly-6.2\"},{\"swift_version\": \"nightly\"}]' }}"
67+
windows_exclude_swift_versions: "${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '[{\"swift_version\": \"nightly-6.1\"},{\"swift_version\": \"nightly\", {\"swift_version\": \"6.2\"}}]' || '[{\"swift_version\": \"nightly-6.1\"},{\"swift_version\": \"nightly-6.2\"},{\"swift_version\": \"nightly\"}]' }}"
6568
windows_env_vars: |
6669
CI=1
6770
FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}}

.github/workflows/scripts/windows/setup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
. .github\workflows\scripts\windows\install-nodejs.ps1
33

44
# Download the VSIX archived upstream
5-
npm ci -ignore-script node-pty
5+
npm ci
66
$Process = Start-Process npx "tsx scripts/download_vsix.ts" -Wait -PassThru -NoNewWindow
77
if ($Process.ExitCode -eq 0) {
88
Write-Host 'SUCCESS'

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ coverage
66
test-results
77
userdocs/userdocs.docc/.docc-build
88

9+
# SwiftPM cache for tests
10+
.spm-cache
11+
912
# Generated Assets
1013
assets/documentation-webview
1114
assets/icons

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org/

0 commit comments

Comments
 (0)