rust-lang / rust-lang/rust-analyzer
Autocompletion for variables not available on wasm32 target
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
With the setting target="wasm32-unknown-unknown", rust-analyzer refuses to autocomplete methods on variables. This behavior doesn't happen on the usual x64 target. Here is screenshot of the issue, where it doesn't recognize the window variable defined outside. Similar things happen for the event_loop variable as well.
This example is from this small example: https://github.com/mbrc12/rust-analyzer-example/ , compiled using wasm-pack build --target web.
Might this be a setup error from my side? My rust-analyzer settings for this project are here: https://github.com/mbrc12/rust-analyzer-example/blob/main/.nlsp/rust_analyzer.json .
Many thanks for the help!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the missing completion in the mbrc12/rust-analyzer-example project using wasm-pack build --target web, and review .nlsp/rust_analyzer.json alongside the target="wasm32-unknown-unknown" setting. Compare completion behavior with the usual x64 target; done means methods on variables such as window and event_loop are offered for the wasm32 target too.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100