rust-analyzer/crates/ide_assists/src
bors[bot] 0657812bc2
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 <rdambrosio016@gmail.com>
2021-06-18 16:47:58 +00:00
..
handlers Minor clippy perf fixes 2021-06-18 14:40:51 +03:00
tests tidy 2021-05-24 22:17:16 +03:00
utils clippy::redudant_borrow 2021-06-13 09:24:16 +05:30
assist_config.rs 7526: Rename crate assists to ide_assists. 2021-02-23 00:59:16 +05:30
assist_context.rs cargo fmt 2021-06-13 09:48:15 +05:30
lib.rs Feat: inline generics in const and func trait completions 2021-06-17 19:54:28 -04:00
tests.rs internal: add derive and ord support to minicore 2021-06-18 00:30:22 +03:00
utils.rs Feat: inline generics in const and func trait completions 2021-06-17 19:54:28 -04:00