mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 12:18:33 +00:00
Merge #5280
5280: Re-enable IDE features for incomplete impl blocs r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
7566d7da8a
@ -450,8 +450,9 @@ impl Ctx {
|
|||||||
|
|
||||||
// We cannot use `assoc_items()` here as that does not include macro calls.
|
// We cannot use `assoc_items()` here as that does not include macro calls.
|
||||||
let items = impl_def
|
let items = impl_def
|
||||||
.item_list()?
|
.item_list()
|
||||||
.items()
|
.into_iter()
|
||||||
|
.flat_map(|it| it.items())
|
||||||
.filter_map(|item| {
|
.filter_map(|item| {
|
||||||
self.collect_inner_items(item.syntax());
|
self.collect_inner_items(item.syntax());
|
||||||
let assoc = self.lower_assoc_item(&item)?;
|
let assoc = self.lower_assoc_item(&item)?;
|
||||||
|
@ -638,4 +638,21 @@ fn f() {}
|
|||||||
expect![[""]],
|
expect![[""]],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn completes_type_or_trait_in_impl_block() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
trait MyTrait {}
|
||||||
|
struct MyStruct {}
|
||||||
|
|
||||||
|
impl My<|>
|
||||||
|
"#,
|
||||||
|
expect![[r#"
|
||||||
|
st MyStruct
|
||||||
|
tt MyTrait
|
||||||
|
tp Self
|
||||||
|
"#]],
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ pub struct CompletionItem {
|
|||||||
score: Option<CompletionScore>,
|
score: Option<CompletionScore>,
|
||||||
}
|
}
|
||||||
|
|
||||||
// We use custom debug for CompletionItem to make `insta`'s diffs more readable.
|
// We use custom debug for CompletionItem to make snapshot tests more readable.
|
||||||
impl fmt::Debug for CompletionItem {
|
impl fmt::Debug for CompletionItem {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let mut s = f.debug_struct("CompletionItem");
|
let mut s = f.debug_struct("CompletionItem");
|
||||||
|
Loading…
Reference in New Issue
Block a user