bevyengine / bevyengine/bevy-website
Dynamic linking does not work by default on some IDEs
- Dominant language
- JavaScript
- Stars
- 249
- Forks
- 450
- Avg merge
- 16h 20m
- Merged PRs (30d)
- 6
Description
## Describe the issue
The [instructions to enable dynamic linking](https://bevy.org/learn/quick-start/getting-started/setup/#dynamic-linking) are not sufficient for dynamic linking to work as expected for all IDEs. By default, Rust analyzer's output can overwrite cached files from previous compilations and force a recompile. This can be resolved by using a separate target directory for Rust analyzer's output. However, additional steps (i.e. editing settings.json) are required before this will work as expected.
## Proposed Solution
Adding a comment in the dynamic linking section of Bevy setup to fix the IDE configuration would help new users to get dynamic linking working as expected. For example, Zed requires adding the following to its settings.json:
```json
{
"lsp": {
"rust-analyzer": {
"initialization_options": {
"rust": {
"analyzerTargetDir": true
}
}
}
}
}
```
## Additional Information (optional)
I have not tested this on other IDEs, but I saw online that the change to VS Code's settings.json might be the following:
```json
{
"rust-analyzer.cargo.targetDir": true
}
```
A user on the Bevy Discord server reported that Neovim works by default.
More research and testing would be required to confirm fixes for other IDEs.
Contributor guide
Research direction
Start with the dynamic linking section in the Bevy setup documentation linked in the issue, then verify the Rust analyzer target-directory settings for Zed and VS Code. Document the confirmed settings and clarify which IDEs need extra configuration; the work is done when the instructions let users enable dynamic linking without unwanted recompiles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100