rust-analyzer
rust-analyzer copied to clipboard
vscode single file has no hints
rust-analyzer version: 0.3.2070-standalone
rustc version: 1.77.2
editor or extension: vscode v0.3.2070
Just create an add.rs in the root of a JS repo, it has no hints.
You need a proper cargo workspace structure to work with rust code - except passing it directly to rustc with some flags -.
Such single .rs file doesn't have any necessary informations like dependencies, editions, etc.
Same issue for me, while playing VSCode LeetCode.
@GF-Huang Do you have a Cargo project your file is included in?
@GF-Huang Do you have a Cargo project your file is included in?
No, because I want single file analysis.
@GF-Huang rust-analyzer does not support full analysis for single file (the closest will be cargo script). If you want IDE services, you need to create a Cargo project.
@GF-Huang rust-analyzer does not support full analysis for single file (the closest will be cargo script). If you want IDE services, you need to create a Cargo project.
when?
@simon-eon When what?
@GF-Huang rust-analyzer does not support full analysis for single file (the closest will be cargo script). If you want IDE services, you need to create a Cargo project.
But if I only want to write my algorithm in a single file like leetcode 1.twoSum.rs 2.addTwoNumbers.rs ... like this How to solve the problem of intelligent prompts without inlay hints and standard libraries in VSC?
@jinhuid Just create a Cargo project. That's not too much of a burden, and with cargo script it's even easier.
We will support standalone files properly at some point, but right now that is not really supported (well) due to implementation problems