-
-
Notifications
You must be signed in to change notification settings - Fork 168
feat(ide): rust-analyzer using built-in analysis engine to accelerate inlay hints generation #1527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat(ide): rust-analyzer using built-in analysis engine to accelerate inlay hints generation #1527
Conversation
checker without outer Makefile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request modernizes the rust-analyzer configuration to use Cargo's built-in analysis engine instead of Makefile-based diagnostics, enabling more efficient inlay hints generation and better IDE integration.
Key Changes:
- Enabled Cargo's unstable build-std feature in
.cargo/config.tomlfor no_std kernel development - Configured default build target to x86_64 in Cargo config (can be changed for other architectures)
- Removed Makefile-based rust-analyzer diagnostics from VS Code settings
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
kernel/.cargo/config.toml |
Uncommented unstable build-std features and added default build target pointing to x86_64 target specification |
.zed/settings.json |
Added new Zed editor configuration with rust-analyzer settings, linkedProjects, and disabled allTargets checking |
.vscode/settings.json |
Removed Makefile-based check override and explicit cargo target settings, added allTargets false configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.vscode/settings.json
Outdated
| "rust-analyzer.check.allTargets": false, | ||
| "esbonio.sphinx.confDir": "", | ||
| "rust-analyzer.linkedProjects": [ | ||
| "./kernel/Cargo.toml", |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linkedProjects configuration differs between VS Code and Zed editor settings. VS Code only includes kernel/Cargo.toml, while Zed includes kernel/Cargo.toml, build-scripts/Cargo.toml, and user/apps/tests/syscall/gvisor/runner/Cargo.toml. This creates an inconsistent development experience across different IDEs. Consider either adding the additional projects to VS Code settings or documenting why they differ.
| "./kernel/Cargo.toml", | |
| "./kernel/Cargo.toml", | |
| "./build-scripts/Cargo.toml", | |
| "./user/apps/tests/syscall/gvisor/runner/Cargo.toml" |
|
TODO: Resolve static check issue |
|
Issue: After changing default cargo config, |
3c4ff24 to
0572cee
Compare
update github actions
behavior, and is cross IDE
48cc558 to
2ec7f6d
Compare
|
Will close #1594 |
|
@fslongjin 把ide的目标变更做进 .cargo/config.toml 了,并且把内核从 workspace 中抽出来,这样方便区分 std 和 no-std 环境,对IDE友好(不用指定linkedProject)。跑测试也方便:见 kernel static test 的部分 另一个也可以看看 #1598 ? |
|
但由于变更了目录所以变动有点大 |
|
对于不同架构的编译的切换怎么弄? |
|
.cargo/config.toml里把默认build目标改了咯,反正改内联提示都是要改的() |
|
也许需要更新一下文档里面描述的,切换架构的开发步骤。 |
rust-analyzer 现已支持 Cargo config 构建目标指定
不再使用
kernel/src/Makefile作为 rust-analyzer 诊断来源,以更高效地生成错误内联如果要更改目标,将
kernel/.cargo/config.toml下的build.target切换为其他目标即可另一个是,改动.cargo/config后,
cargo clippy --fix可以直接跑了(虽然按之前的写法,clippy fix命令用 Makefile wrap 一下也没问题)