Repository navigation
rust-intelligence 0.3.0
Live type inference behind the LSP: dependencies and the standard library come from the rustc-built index, while the workspace's own code is parsed, name-resolved and type-inferred by ridx itself, on saved and on edited buffers alike. Figures below are from the 38-method, 7-corpus content-parity suite against rust-analyzer (serde, ripgrep, tokio, rust-analyzer, bevy, clap, regex), before (the last state without live inference in the LSP) and after (602f4a19), on the same index.
Added
textDocument/typeDefinitionfrom the inferred type: every type the inferred type names (Vec<Foo>leads toVec,Fooand the allocator). Parity89.22%→93.43%.textDocument/completionafter.from the receiver's inferred type: fields and methods of the full receiver type with autoderef, traits in scope, bounds of type parameters and of a trait'sSelf,#[doc(hidden)]items of other crates hidden, postfix snippets (let,letm,for,match,ifl,lete,while,if,not,break,drop) chosen by the receiver's type and the expression's position as rust-analyzer does, andawait/await.memberon futures. Parity78.36%→95.52%(1920/2010); exact label-set matches292→1326; median latency2.90 ms→1.76 ms.#[cfg(test)]code answered from the unit that compiles it (a library's test harness), for type queries and completion.
Changed
textDocument/references:Selfinside an impl counts as a reference to its struct, enum or union. Parity80.37%→82.20%.textDocument/inlayHint: recorded types are merged from every unit compiling the file, so test-module bindings get hints. Parity94.31%→95.08%.- Trait solving: bounds that land on a type parameter are checked against that parameter's declared bounds; compiler-implemented traits without an indexed definition (
Destruct) no longer fail bound checks; type references no longer resolve to a same-path derive macro instead of the trait.
Notes
- Refactoring assists stay compile-safe:
Inline into all callersis not offered where the inlined body would reference private items from another module or crate, although rust-analyzer offers it there (code_actionparity stays at58%). - Latency:
typeDefinitionmedian0.54 ms(0.16 msbefore; the inferred answer costs a parse and a function inference on the first query in a file). Peak server memory onbevyis unchanged at about 1 GB.