rust-analyzer/crates
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
..
base_db internal: introduce minicore -- a subset of libcore for testing 2021-06-15 21:03:08 +03:00
cfg tree-wide: make rustdoc links spiky so they are clickable 2021-06-13 21:58:05 -07:00
flycheck Use package root as cargo check working directory 2021-05-12 19:50:52 -07:00
hir Nest all the or-patterns! 2021-06-17 17:37:14 +02:00
hir_def Minor clippy perf fixes 2021-06-18 14:40:51 +03:00
hir_expand Minor clippy perf fixes 2021-06-18 14:40:51 +03:00
hir_ty Minor clippy perf fixes 2021-06-18 14:40:51 +03:00
ide Minor clippy perf fixes 2021-06-18 14:40:51 +03:00
ide_assists Merge #9321 2021-06-18 16:47:58 +00:00
ide_completion Lift ast -> hir out of the for_each 2021-06-18 12:42:13 -04:00
ide_db Feat: inline generics in const and func trait completions 2021-06-17 19:54:28 -04:00
ide_diagnostics internal: document that we don't #[ignore] tests 2021-06-15 11:46:47 +03:00
ide_ssr clippy::redundant_field_names 2021-06-13 09:40:22 +05:30
mbe Nest all the or-patterns! 2021-06-17 17:37:14 +02:00
parser Complete repr attribute parameters 2021-06-17 21:15:49 +02:00
paths tree-wide: make rustdoc links spiky so they are clickable 2021-06-13 21:58:05 -07:00
proc_macro_api Minor clippy perf fixes 2021-06-18 14:40:51 +03:00
proc_macro_srv Merge #9260 2021-06-14 07:16:48 +00:00
proc_macro_test Build test-macros in a build script 2021-06-09 17:16:52 +02:00
profile Merge #9260 2021-06-14 07:16:48 +00:00
project_model Avoid string allocation 2021-06-18 14:46:18 +03:00
rust-analyzer simplify 2021-06-17 17:58:26 +02:00
stdx tree-wide: make rustdoc links spiky so they are clickable 2021-06-13 21:58:05 -07:00
syntax Fix parser tests for 1.53 2021-06-17 18:09:44 +02:00
test_utils Minor clippy perf fixes 2021-06-18 14:40:51 +03:00
text_edit Avoid turning completion objects into builders 2020-11-16 23:16:41 +02:00
toolchain Add description for crates that will be published 2020-08-24 13:07:22 +02:00
tt Merge #9260 2021-06-14 07:16:48 +00:00
vfs Nest all the or-patterns! 2021-06-17 17:37:14 +02:00
vfs-notify Fix slow tests sometimes failing 2021-02-12 16:31:16 +01:00