rust-lang / rust-lang/rust-analyzer
Doesn't work with generated CUDA bindings with VSCode remote
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: rust-analyzer version: 0.3.1689-standalone
rustc version: rustc 1.72.0 (5680fa18f 2023-08-23)
relevant settings: vscode 1.83.0 (local and remote code-server); neovim 0.9.1 (remote); ubuntu 20.04 (remote)
Problem Description
I am trying to generate Rust bindings for CUDA library with bindgen. When I use rust-analyzer in vscode with vscode-remote, the plugin cannot analyze the symbols correctly. I cannot get either auto-complete or hover for the generated code.
I have enabled the proc-macro and build.rs related settings in vscode, without special changes for settings. No warning/error/rust-analyzer output is shown during my tests.
The generated bindings are approximately 9k LoC.
Different RA version tested (pre-release, versions 6 months/12 months ago)
Reproduction
Minimal reproduction: https://github.com/XOR-op/ra_completion_test (Note: CUDA installation required for headers)
- CUDA binding with vscode-remote: failed to analyze the symbols
- CUDA binding on local machine with vscode/neovim: succeeded to analyze the symbols (same RA version)
- Another smaller binding with vscode-remote on the same machine as of the first, and the same configuration: succeeded to analyze the symbols
TL;DR: in my test, only the combination of vscode-remote+this project failed
Suspecious reasons
- Possibly exceed token limit similar to #15648 with 9k LoC. However, the local RA (vscode/neovim) works as intended.
- Errors in my configuration: however, on the same local machine & remote machine, another binding project works. I don't have per-project settings.
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
Start with the minimal reproduction at github.com/XOR-op/ra_completion_test, using the stated CUDA, VSCode Remote, Ubuntu 20.04, and rust-analyzer versions. Compare the failing CUDA binding project with the smaller remote binding and the locally working setup. Done means the generated symbols provide autocomplete and hover in VSCode Remote without unexplained rust-analyzer errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100