rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

No autocompletion for serde's Deserializer trait

Open vultix opened this issue 1 month ago • 1 comments

Rust-analyzer isn't suggesting any of the methods on serde's Deserializer trait unless I manually import the trait. In the example below, I'd expect to see autocomplete for methods like deserialize_any, but those aren't suggested.

rust-analyzer version: 1.91.1 rustc version: 1.91.1 editor or extension: vscode 0.4.2694-standalone

code snippet to reproduce:

cargo new example
cd example
cargo add serde serde-json
fn main() {
    let mut deserializer = serde_json::Deserializer::from_str(r#"{"key": "value"}"#);
    deserializer.des<autocomplete here>
}

vultix avatar Nov 25 '25 15:11 vultix

Indeed, we should offer to insert use serde::Deserializer. Completions work once you add that.

lnicola avatar Nov 25 '25 17:11 lnicola