rust/crates
bors 5855bd8579 Auto merge of #15587 - dfireBird:fix-15128, r=Veykril
Fix autoimport does nothing when importing trait that is as _ imports

Potentially fixes #15128

There are two cases of imports:
1. With simple path
2. With use tree list (or say complex path).

On deeper inspection, the [`recursive_merge`](994df3d6a3/crates/ide-db/src/imports/merge_imports.rs (L87)) function (called by [`try_merge_trees_mut`)](994df3d6a3/crates/ide-db/src/imports/merge_imports.rs (L69)) is meaningful only in the case of complex path (i.e when the UseTree contains a UseTreeList).

The [`recursive_merge`](994df3d6a3/crates/ide-db/src/imports/merge_imports.rs (L87)) function has [match with `Ok` arm](994df3d6a3/crates/ide-db/src/imports/merge_imports.rs (L106)), that is only executed when both LHS and RHS has `PathSegment` with same `NameRef`. The removal of underscore is implemented in this arm in the case of complex path.

For simple paths, the underscore is removed by checking if both LHS and RHS are simple paths and if their `Path` is same (the check is done [here](994df3d6a3/crates/ide-db/src/imports/merge_imports.rs (L74))) and remove the underscore if one is found (I made an assumption here that RHS will always be what rust-analyzer suggests to import, because at this point I'm not sure how to remove underscore with help of `ted::replace`).
2023-09-22 07:39:11 +00:00
..
base-db Fix cfg completions not working 2023-09-08 10:49:15 +02:00
cfg Fix cfg completions not working 2023-09-08 10:49:15 +02:00
flycheck refactor: remove boxing 2023-09-20 23:02:52 +09:00
hir Remove most of the duplication from Semantics{,Impl} via deref 2023-09-13 22:02:28 +00:00
hir-def Auto merge of #15616 - HKalbasi:rustc-deps, r=HKalbasi 2023-09-19 17:41:12 +00:00
hir-expand Emit builtin#format_args in builtin format_args expander 2023-09-06 18:08:20 +02:00
hir-ty Update chalk version 2023-09-19 16:56:59 -07:00
ide Documentation: Add parenthesis to the list of on-typing assists. 2023-09-21 14:58:24 -04:00
ide-assists Auto merge of #15484 - rmehri01:14779_bool_to_enum_assist, r=Veykril 2023-09-22 07:19:12 +00:00
ide-completion Fix cfg completions not working 2023-09-08 10:49:15 +02:00
ide-db Auto merge of #15587 - dfireBird:fix-15128, r=Veykril 2023-09-22 07:39:11 +00:00
ide-diagnostics use code from bug report for regression test 2023-09-17 16:52:32 +03:00
ide-ssr Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-ra 2023-08-21 12:44:09 +03:00
intern refactor: fix clippy lints 2023-09-15 16:43:21 +09:00
limit
load-cargo
mbe Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-ra 2023-08-21 12:44:09 +03:00
parser Auto merge of #15615 - shogo-nakano-desu:refactor/fix-clippy-lints, r=Veykril 2023-09-22 06:46:29 +00:00
paths
proc-macro-api Upgrade Object and related deps 2023-08-14 23:05:45 +08:00
proc-macro-srv Upgrade Object and related deps 2023-08-14 23:05:45 +08:00
proc-macro-srv-cli
proc-macro-test
profile Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-ra 2023-08-21 12:44:09 +03:00
project-model Auto merge of #15560 - davidbarsky:davidbarsky/use-sysroot-rustc-to-determine-cfgs, r=Veykril 2023-09-08 18:14:25 +00:00
rust-analyzer Use proper editor name 2023-09-19 23:34:43 +03:00
rustc-dependencies Switch to in-tree rustc dependencies with a cfg flag 2023-09-15 18:10:11 +03:30
sourcegen
stdx
syntax Auto merge of #15484 - rmehri01:14779_bool_to_enum_assist, r=Veykril 2023-09-22 07:19:12 +00:00
test-utils Emit builtin#format_args in builtin format_args expander 2023-09-06 18:08:20 +02:00
text-edit
toolchain
tt
vfs Ensure resolved hint's file exists 2023-09-02 18:28:36 +03:00
vfs-notify Update notify to 6.1.1 2023-09-04 18:00:12 +02:00