Skip to content

Commit b8a7d43

Browse files
committed
Merge commit 'aa9bc8612514d216f84eec218dfd19ab83f3598a' into sync-from-ra
2 parents 51f714c + aa9bc86 commit b8a7d43

File tree

598 files changed

+57728
-17647
lines changed

Some content is hidden

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

598 files changed

+57728
-17647
lines changed

src/tools/rust-analyzer/.github/actions/github-release/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ perform github releases but they all tend to have their set of drawbacks.
1010
Additionally nothing handles deleting releases which we need for our rolling
1111
`dev` release.
1212

13-
To handle all this this action rolls-its-own implementation using the
13+
To handle all this, this action rolls its own implementation using the
1414
actions/toolkit repository and packages published there. These run in a Docker
1515
container and take various inputs to orchestrate the release from the build.
1616

src/tools/rust-analyzer/.github/workflows/autopublish.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
shell: bash
3333
run: |
3434
git config --global user.email "runner@gha.local"
35-
git config --global user.name "Github Action"
35+
git config --global user.name "GitHub Action"
3636
rm Cargo.lock
3737
# Fix names for crates that were published before switch to kebab-case.
3838
cargo workspaces rename --from base-db base_db

src/tools/rust-analyzer/.github/workflows/ci.yaml

+42-11
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,35 @@ env:
1818
RUSTUP_MAX_RETRIES: 10
1919

2020
jobs:
21+
changes:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
pull-requests: read
25+
outputs:
26+
typescript: ${{ steps.filter.outputs.typescript }}
27+
steps:
28+
- uses: actions/checkout@v3
29+
- uses: dorny/paths-filter@4067d885736b84de7c414f582ac45897079b0a78
30+
id: filter
31+
with:
32+
filters: |
33+
typescript:
34+
- 'editors/code/**'
35+
proc_macros:
36+
- 'crates/proc-macro-api/**'
37+
- 'crates/proc-macro-srv/**'
38+
- 'crates/proc-macro-srv-cli/**'
39+
- 'crates/proc-macro-test/**'
40+
2141
rust:
42+
needs: changes
2243
if: github.repository == 'rust-lang/rust-analyzer'
2344
name: Rust
2445
runs-on: ${{ matrix.os }}
2546
env:
2647
CC: deny_c
48+
RUST_CHANNEL: "${{ needs.changes.outputs.proc_macros == 'true' && 'nightly' || 'stable'}}"
49+
USE_SYSROOT_ABI: "${{ needs.changes.outputs.proc_macros == 'true' && '--features sysroot-abi' || ''}}"
2750

2851
strategy:
2952
fail-fast: false
@@ -35,30 +58,31 @@ jobs:
3558
uses: actions/checkout@v3
3659
with:
3760
ref: ${{ github.event.pull_request.head.sha }}
38-
fetch-depth: 20
3961

4062
- name: Install Rust toolchain
4163
run: |
42-
rustup update --no-self-update stable
64+
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
4365
rustup component add rustfmt rust-src
4466
4567
- name: Cache Dependencies
46-
uses: Swatinem/rust-cache@76686c56f2b581d1bb5bda44b51f7e24bd9b8b8e
68+
uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894
69+
with:
70+
key: ${{ env.RUST_CHANNEL }}
4771

4872
- name: Bump opt-level
4973
if: matrix.os == 'ubuntu-latest'
5074
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
5175

5276
- name: Compile (tests)
53-
run: cargo test --no-run --locked
77+
run: cargo test --no-run --locked ${{ env.USE_SYSROOT_ABI }}
5478

5579
# It's faster to `test` before `build` ¯\_(ツ)_/¯
5680
- name: Compile (rust-analyzer)
5781
if: matrix.os == 'ubuntu-latest'
58-
run: cargo build --quiet
82+
run: cargo build --quiet ${{ env.USE_SYSROOT_ABI }}
5983

6084
- name: Test
61-
run: cargo test -- --nocapture --quiet
85+
run: cargo test ${{ env.USE_SYSROOT_ABI }} -- --nocapture --quiet
6286

6387
- name: Run analysis-stats on rust-analyzer
6488
if: matrix.os == 'ubuntu-latest'
@@ -90,7 +114,7 @@ jobs:
90114
rustup target add ${{ env.targets }} ${{ env.targets_ide }}
91115
92116
- name: Cache Dependencies
93-
uses: Swatinem/rust-cache@76686c56f2b581d1bb5bda44b51f7e24bd9b8b8e
117+
uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894
94118

95119
- name: Check
96120
run: |
@@ -102,6 +126,7 @@ jobs:
102126
done
103127
104128
typescript:
129+
needs: changes
105130
if: github.repository == 'rust-lang/rust-analyzer'
106131
name: TypeScript
107132
strategy:
@@ -114,45 +139,51 @@ jobs:
114139
steps:
115140
- name: Checkout repository
116141
uses: actions/checkout@v3
142+
if: needs.changes.outputs.typescript == 'true'
117143

118144
- name: Install Nodejs
119145
uses: actions/setup-node@v3
120146
with:
121147
node-version: 16
148+
if: needs.changes.outputs.typescript == 'true'
122149

123150
- name: Install xvfb
124-
if: matrix.os == 'ubuntu-latest'
151+
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
125152
run: sudo apt-get install -y xvfb
126153

127154
- run: npm ci
128155
working-directory: ./editors/code
156+
if: needs.changes.outputs.typescript == 'true'
129157

130158
# - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
131159
# if: runner.os == 'Linux'
132160
# working-directory: ./editors/code
133161

134162
- run: npm run lint
135163
working-directory: ./editors/code
164+
if: needs.changes.outputs.typescript == 'true'
136165

137166
- name: Run VS Code tests (Linux)
138-
if: matrix.os == 'ubuntu-latest'
167+
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
139168
env:
140169
VSCODE_CLI: 1
141170
run: xvfb-run npm test
142171
working-directory: ./editors/code
143172

144173
- name: Run VS Code tests (Windows)
145-
if: matrix.os == 'windows-latest'
174+
if: matrix.os == 'windows-latest' && needs.changes.outputs.typescript == 'true'
146175
env:
147176
VSCODE_CLI: 1
148177
run: npm test
149178
working-directory: ./editors/code
150179

151180
- run: npm run pretest
152181
working-directory: ./editors/code
182+
if: needs.changes.outputs.typescript == 'true'
153183

154184
- run: npm run package --scripts-prepend-node-path
155185
working-directory: ./editors/code
186+
if: needs.changes.outputs.typescript == 'true'
156187

157188
end-success:
158189
name: bors build finished
@@ -165,7 +196,7 @@ jobs:
165196

166197
end-failure:
167198
name: bors build finished
168-
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
199+
if: github.event.pusher.name == 'bors' && !success()
169200
runs-on: ubuntu-latest
170201
needs: [rust, rust-cross, typescript]
171202
steps:

src/tools/rust-analyzer/.github/workflows/publish-libs.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ on:
33
workflow_dispatch:
44
push:
55
branches:
6-
- main
6+
- master
77
paths:
8-
- 'lib/**'
8+
- "lib/**"
99

1010
jobs:
1111
publish-libs:
@@ -29,7 +29,7 @@ jobs:
2929
shell: bash
3030
run: |
3131
git config --global user.email "runner@gha.local"
32-
git config --global user.name "Github Action"
32+
git config --global user.name "GitHub Action"
3333
# Remove r-a crates from the workspaces so we don't auto-publish them as well
3434
sed -i 's/ "crates\/\*"//' ./Cargo.toml
3535
cargo workspaces publish --yes --exact --from-git --no-git-commit --allow-dirty

src/tools/rust-analyzer/.github/workflows/release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ jobs:
270270
- name: Publish Extension (Code Marketplace, nightly)
271271
if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
272272
working-directory: ./editors/code
273-
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
273+
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release
274274

275275
- name: Publish Extension (OpenVSX, nightly)
276276
if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')

src/tools/rust-analyzer/.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
},
7373
{
7474
// Used for testing the extension with a local build of the LSP server (in `target/release`)
75-
// with all other extendions loaded.
75+
// with all other extensions loaded.
7676
"name": "Run With Extensions",
7777
"type": "extensionHost",
7878
"request": "launch",

0 commit comments

Comments
 (0)