mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
![]() feat: Introduce term search to rust-analyzer # Introduce term search to `rust-analyzer` _I've marked this as draft as there might be some shortcomings, please point them out so I can fix them. Otherwise I think it is kind of ready as I think I'll rather introduce extra functionality in follow up PRs._ Term search (or I guess expression search for rust) is a technique to generate code by basically making the types match. Consider the following program ```rust fn wrap(arg: i32) -> Option<i32> { todo!(); } ``` From the types of values in scope and constructors of `Option`, we can produce the expected result of wrapping the argument in `Option` Dependently typed languages such as `Idris2` and `Agda` have similar tools to help with proofs, but this can be also used in everyday development as a "auto-complete". # Demo videos |
||
---|---|---|
.. | ||
consteval | ||
diagnostics | ||
infer | ||
layout | ||
mir | ||
tests | ||
autoderef.rs | ||
builder.rs | ||
chalk_db.rs | ||
chalk_ext.rs | ||
consteval.rs | ||
db.rs | ||
diagnostics.rs | ||
display.rs | ||
infer.rs | ||
inhabitedness.rs | ||
interner.rs | ||
lang_items.rs | ||
layout.rs | ||
lib.rs | ||
lower.rs | ||
mapping.rs | ||
method_resolution.rs | ||
mir.rs | ||
primitive.rs | ||
test_db.rs | ||
tests.rs | ||
tls.rs | ||
traits.rs | ||
utils.rs |