Skip to content

Commit bb6caf4

Browse files
committed
Add another note about rust-analyzer
1 parent 82139f9 commit bb6caf4

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ target
22
dist
33
site/public/*
44
.vscode
5+
!examples/wasm_threads/.vscode
56
.idea/
67
.DS_Store
78
/vendor
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// The build-std flag requires an explicit target.
3+
// This breaks the usual rust-analyzer setup.
4+
// But setting the target manually for the workspace fixes that.
5+
// "rust-analyzer.cargo.target": "x86_64-unknown-linux-gnu",
6+
"rust-analyzer.cargo.target": "wasm32-unknown-unknown",
7+
}

examples/wasm_threads/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ If you get errors such as
4242
> [Chrome] SharedArrayBuffer transfer requires self.crossOriginIsolated.
4343
4444
Then the headers did not set correctly. You can check the response headers on the `/` file in the network tab of the browser developer tools.
45+
46+
## Using rust-analyzer
47+
48+
Since we use the build-std flag in the toolchain file, and that requires an explicit target to be set for compilation etc., this will break rust-analyzer in many setups. This can be solved by specifying an explicit target for the workspace, such as with the provided [config file for vscode](./.vscode/settings.json).

0 commit comments

Comments
 (0)