diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-18 17:47:58 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-18 17:47:58 +0100 |
commit | 0657812bc2f95037b5e2efbe8fbfc80fb28492c1 (patch) | |
tree | 1e2df163514b45efc2af9b159bd44f62be0cf9a6 /editors | |
parent | 7eb843b218b5e10b39a5171f5b9689ec6c2d71c3 (diff) | |
parent | b3e5c648e0def7a359a75b2b5023c18aceda83d3 (diff) |
Merge #9321
9321: Inline generics in const and function trait completions r=Veykril a=RDambrosio016
This PR does a couple of things:
- moves path_transform from ide_assists to ide_db to be shared by both assists and completions
- when completing a const or a function for a trait, it will "inline" any generics in those associated items instead
of leaving the generic's name. For example:
```rust
trait Foo<T> {
const BAR: T;
fn foo() -> T;
}
struct Bar;
impl Foo<u32> for Bar {
// autocompletes to this
fn foo() -> u32;
// and not this (old)
fn foo() -> T;
// also works for associated consts and where clauses
const BAR: u32 = /* */
}
```
Currently this does not work for const generics, because `PathTransform` does not seem to account for them. If this should work on const generics too, `PathTransform` will need to be changed. However, it is uncommon to implement a trait only for a single const value, so this isnt a huge concern.
Co-authored-by: rdambrosio <[email protected]>
Diffstat (limited to 'editors')
0 files changed, 0 insertions, 0 deletions