Skip to content

Commit 20db3dc

Browse files
authored
Merge branch 'main' into gyb
2 parents 62bfd9b + a3a18c5 commit 20db3dc

File tree

186 files changed

+13259
-3745
lines changed

Some content is hidden

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

186 files changed

+13259
-3745
lines changed

.devcontainer/Dockerfile

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

33
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
44
&& apt-get -q update \
@@ -13,7 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
1313

1414
RUN mkdir -p /usr/local/nvm
1515
ENV NVM_DIR /usr/local/nvm
16-
ENV NODE_VERSION v20.18.2
16+
ENV NODE_VERSION v20.19.0
1717
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
1818
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"
1919
ENV NODE_PATH $NVM_DIR/versions/node/$NODE_VERSION/bin

.eslintrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"parser": "@typescript-eslint/parser",
44
"parserOptions": {
55
"ecmaVersion": 2020,
6-
"sourceType": "module"
6+
"sourceType": "module",
7+
"project": true
78
},
89
"plugins": ["@typescript-eslint"],
910
"rules": {
@@ -13,6 +14,8 @@
1314
// TODO "@typescript-eslint/semi" rule moved to https://eslint.style
1415
"semi": "error",
1516
"no-console": "warn",
17+
"@typescript-eslint/no-floating-promises": ["warn", { "checkThenables": true }],
18+
"@typescript-eslint/await-thenable": "warn",
1619
// Mostly fails tests, ex. expect(...).to.be.true returns a Chai.Assertion
1720
"@typescript-eslint/no-unused-expressions": "off",
1821
"@typescript-eslint/no-non-null-assertion": "off",

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ updates:
1919
- dependency-name: "@vscode/vsce"
2020
update-types: ["version-update:semver-major"]
2121
- dependency-name: "@types/vscode"
22-
- dependency-name: "mocha"
22+
- dependency-name: "octokit"
2323
update-types: ["version-update:semver-major"]
2424
groups:
2525
all-dependencies:

.github/workflows/nightly.yml

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,65 +11,93 @@ jobs:
1111
runs-on: ubuntu-latest
1212
container:
1313
image: swift:6.0-jammy
14+
outputs:
15+
artifact-id: ${{ steps.archive.outputs.artifact-id }}
1416
steps:
1517
- name: Checkout repository
1618
uses: actions/checkout@v4
1719
- name: Build Extension
1820
run: |
19-
export NODE_VERSION=v20.18.2
20-
export NODE_PATH=/usr/local/nvm/versions/node/v20.18.2/bin
21+
export NODE_VERSION=v20.19.0
22+
export NODE_PATH=/usr/local/nvm/versions/node/v20.19.0/bin
2123
export NVM_DIR=/usr/local/nvm
2224
. .github/workflows/scripts/setup-linux.sh
2325
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
2426
npm ci
25-
npm run compile
2627
npm run package
2728
npm run preview-package
29+
for file in *.vsix; do
30+
name="$(basename "$file" .vsix)-${{github.run_number}}.vsix"
31+
echo "Created bundle $name"
32+
mv "$file" "$name"
33+
done
34+
git config --global --add safe.directory $PWD
35+
git rev-parse HEAD > vscode-swift-sha.txt
2836
- name: Archive production artifacts
37+
id: archive
2938
uses: actions/upload-artifact@v4
30-
if: always()
39+
if: ${{ env.ACT != 'true' }}
3140
with:
41+
if-no-files-found: error
3242
name: vscode-swift-extension
3343
path: |
3444
*.vsix
45+
vscode-swift-sha.txt
46+
3547
tests_release:
3648
name: Test Release
49+
needs: package
3750
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
3851
with:
52+
needs_token: true
3953
# Linux
54+
linux_exclude_swift_versions: '[{"swift_version": "nightly-6.1"}]'
4055
linux_env_vars: |
41-
NODE_VERSION=v20.18.2
42-
NODE_PATH=/usr/local/nvm/versions/node/v20.18.2/bin
56+
NODE_VERSION=v20.19.0
57+
NODE_PATH=/usr/local/nvm/versions/node/v20.19.0/bin
4358
NVM_DIR=/usr/local/nvm
4459
CI=1
60+
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
61+
GITHUB_REPOSITORY=${{github.repository}}
4562
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
4663
linux_build_command: ./scripts/test.sh
4764
# Windows
65+
windows_exclude_swift_versions: '[{"swift_version": "nightly-6.1"},{"swift_version": "nightly"}]' # Missing https://github.com/swiftlang/swift/pull/80144
4866
windows_env_vars: |
4967
CI=1
50-
windows_pre_build_command: .github\workflows\scripts\windows\install-nodejs.ps1
68+
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
69+
VSCODE_SWIFT_VSIX=vscode-swift.vsix
70+
GITHUB_REPOSITORY=${{github.repository}}
71+
windows_pre_build_command: .github\workflows\scripts\windows\setup.ps1
5172
windows_build_command: scripts\test_windows.ps1
5273
enable_windows_docker: false
5374

5475
tests_insiders:
5576
name: Test Insiders
77+
needs: package
5678
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
5779
with:
80+
needs_token: true
5881
# Linux
59-
linux_exclude_swift_versions: '[{"swift_version": "5.8"}, {"swift_version": "5.9"}, {"swift_version": "5.10"}, {"swift_version": "6.0"}, {"swift_version": "nightly-6.1"}, {"swift_version": "nightly-main"}]'
82+
linux_exclude_swift_versions: '[{"swift_version": "5.8"}, {"swift_version": "5.9"}, {"swift_version": "5.10"}, {"swift_version": "6.0"}, {"swift_version": "nightly-6.1"}, {"swift_version": "nightly-6.2"}, {"swift_version": "nightly-main"}]'
6083
linux_env_vars: |
61-
NODE_VERSION=v20.18.2
62-
NODE_PATH=/usr/local/nvm/versions/node/v20.18.2/bin
84+
NODE_VERSION=v20.19.0
85+
NODE_PATH=/usr/local/nvm/versions/node/v20.19.0/bin
6386
NVM_DIR=/usr/local/nvm
6487
CI=1
6588
VSCODE_VERSION=insiders
89+
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
90+
GITHUB_REPOSITORY=${{github.repository}}
6691
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
6792
linux_build_command: ./scripts/test.sh
6893
# Windows
69-
windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "6.0"}, {"swift_version": "nightly-6.1"}, {"swift_version": "nightly"}]'
94+
windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "6.0"}, {"swift_version": "nightly-6.1"}, {"swift_version": "nightly-6.2"}, {"swift_version": "nightly"}]'
7095
windows_env_vars: |
7196
CI=1
7297
VSCODE_VERSION=insiders
73-
windows_pre_build_command: .github\workflows\scripts\windows\install-nodejs.ps1
98+
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
99+
VSCODE_SWIFT_VSIX=vscode-swift.vsix
100+
GITHUB_REPOSITORY=${{github.repository}}
101+
windows_pre_build_command: .github\workflows\scripts\windows\setup.ps1
74102
windows_build_command: scripts\test_windows.ps1
75103
enable_windows_docker: false

.github/workflows/pull_request.yml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,64 @@ on:
55
types: [opened, reopened, synchronize]
66

77
jobs:
8+
package:
9+
name: Package Extension
10+
runs-on: ubuntu-latest
11+
container:
12+
image: swift:6.0-jammy
13+
outputs:
14+
artifact-id: ${{ steps.archive.outputs.artifact-id }}
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Build Extension
19+
run: |
20+
export NODE_VERSION=v20.19.0
21+
export NODE_PATH=/usr/local/nvm/versions/node/v20.19.0/bin
22+
export NVM_DIR=/usr/local/nvm
23+
. .github/workflows/scripts/setup-linux.sh
24+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
25+
npm ci
26+
npm run package
27+
npm run preview-package
28+
for file in *.vsix; do
29+
name="$(basename "$file" .vsix)-${{github.run_number}}.vsix"
30+
echo "Created bundle $name"
31+
mv "$file" "$name"
32+
done
33+
git config --global --add safe.directory $PWD
34+
git rev-parse HEAD > vscode-swift-sha.txt
35+
- name: Archive production artifacts
36+
id: archive
37+
uses: actions/upload-artifact@v4
38+
if: ${{ env.ACT != 'true' }}
39+
with:
40+
if-no-files-found: error
41+
name: vscode-swift-extension
42+
path: |
43+
*.vsix
44+
vscode-swift-sha.txt
45+
846
tests:
947
name: ${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && 'Full Test Run' || 'Test'}}
1048
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
1149
with:
1250
# Linux
13-
linux_exclude_swift_versions: '[{"swift_version": "nightly-6.1"},{"swift_version": "nightly-main"}]'
51+
linux_exclude_swift_versions: '[{"swift_version": "nightly-6.1"},{"swift_version": "nightly-6.2"},{"swift_version": "nightly-main"}]'
1452
linux_env_vars: |
15-
NODE_VERSION=v20.18.2
16-
NODE_PATH=/usr/local/nvm/versions/node/v20.18.2/bin
53+
NODE_VERSION=v20.19.0
54+
NODE_PATH=/usr/local/nvm/versions/node/v20.19.0/bin
1755
NVM_DIR=/usr/local/nvm
1856
CI=1
1957
FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}}
2058
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
2159
linux_build_command: ./scripts/test.sh
2260
# Windows
23-
windows_exclude_swift_versions: '[{"swift_version": "nightly-6.1"},{"swift_version": "nightly"}]'
61+
windows_exclude_swift_versions: '[{"swift_version": "nightly-6.1"},{"swift_version": "nightly-6.2"},{"swift_version": "nightly"}]'
2462
windows_env_vars: |
2563
CI=1
2664
FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}}
27-
windows_pre_build_command: .github\workflows\scripts\windows\install-nodejs.ps1
65+
windows_pre_build_command: .github\workflows\scripts\windows\setup.ps1
2866
windows_build_command: scripts\test_windows.ps1
2967
enable_windows_docker: false
3068

.github/workflows/scripts/setup-linux.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,21 @@
1313
##
1414
##===----------------------------------------------------------------------===##
1515

16-
export NODE_VERSION=v20.18.2
17-
export NODE_PATH=/usr/local/nvm/versions/node/v20.18.2/bin
16+
export NODE_VERSION=v20.19.0
17+
export NODE_PATH=/usr/local/nvm/versions/node/v20.19.0/bin
1818
export NVM_DIR=/usr/local/nvm
1919

2020
apt-get update && apt-get install -y rsync curl gpg libasound2 libgbm1 libgtk-3-0 libnss3 xvfb build-essential
2121
mkdir -p $NVM_DIR
2222
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
23-
/bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"
24-
echo "$NODE_PATH" >> "$GITHUB_PATH"
23+
# shellcheck disable=SC1091
24+
. $NVM_DIR/nvm.sh && nvm install $NODE_VERSION
25+
echo "$NODE_PATH" >> "$GITHUB_PATH"
26+
27+
env | sort
28+
29+
if [ -n "$VSCODE_SWIFT_VSIX_ID" ]; then
30+
npm ci --ignore-scripts
31+
npx tsx scripts/download_vsix.ts
32+
export VSCODE_SWIFT_VSIX="vscode-swift.vsix"
33+
fi

.github/workflows/scripts/windows/install-nodejs.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$NODEJS='https://nodejs.org/dist/v20.18.2/node-v20.18.2-x64.msi'
1+
$NODEJS='https://nodejs.org/dist/v20.19.0/node-v20.19.0-x64.msi'
22
$NODEJS_SHA256='c2654d3557abd59de08474c6dd009b1d358f420b8e4010e4debbf130b1dfb90a'
33
Set-Variable ErrorActionPreference Stop
44
Set-Variable ProgressPreference SilentlyContinue
@@ -21,4 +21,4 @@ if ($Process.ExitCode -eq 0) {
2121
Write-Host ('FAILED ({0})' -f $Process.ExitCode)
2222
exit 1
2323
}
24-
Remove-Item -Force $env:TEMP\node.msi
24+
Remove-Item -Force $env:TEMP\node.msi
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Install node.js
2+
. .github\workflows\scripts\windows\install-nodejs.ps1
3+
4+
# Download the VSIX archived upstream
5+
npm ci -ignore-script node-pty
6+
$Process = Start-Process npx "tsx scripts/download_vsix.ts" -Wait -PassThru -NoNewWindow
7+
if ($Process.ExitCode -eq 0) {
8+
Write-Host 'SUCCESS'
9+
} else {
10+
Write-Host ('FAILED ({0})' -f $Process.ExitCode)
11+
exit 1
12+
}

.gitignore

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1+
# Build Outputs
2+
*.vsix
13
out
24
dist
35
coverage
46
test-results
7+
userdocs/userdocs.docc/.docc-build
8+
9+
# Generated Assets
10+
assets/documentation-webview
11+
assets/icons
12+
assets/swift-docc-render
13+
assets/test/**/Package.resolved
14+
15+
# Node
516
node_modules
6-
default.profraw
7-
*.vsix
17+
18+
# Hidden Directories
819
.vscode-test
920
.build
1021
.index-build
22+
23+
# macOS
1124
.DS_Store
12-
assets/documentation-webview
13-
assets/test/**/Package.resolved
14-
assets/swift-docc-render
25+
26+
# Miscellaneous
27+
default.profraw
1528
ud
16-
userdocs/userdocs.docc/.docc-build

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.18.2
1+
20.19.0

0 commit comments

Comments
 (0)