do not use associated types placeholder for inlay hint

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This commit is contained in:
Benjamin Coenen 2020-10-28 12:29:42 +01:00
parent 8762b797fd
commit ef2f7bb243
6 changed files with 108 additions and 155 deletions

View file

@ -157,13 +157,14 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String {
(node.value.text_range(), node.value.text().to_string().replace("\n", " "))
};
let macro_prefix = if node.file_id != file_id.into() { "!" } else { "" };
let module = db.module_for_file(node.file_id.original_file(&db));
format_to!(
buf,
"{}{:?} '{}': {}\n",
macro_prefix,
range,
ellipsize(text, 15),
ty.display(&db)
ty.display_test(&db, module).unwrap()
);
}
if include_mismatches {
@ -174,13 +175,14 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String {
for (src_ptr, mismatch) in &mismatches {
let range = src_ptr.value.text_range();
let macro_prefix = if src_ptr.file_id != file_id.into() { "!" } else { "" };
let module = db.module_for_file(src_ptr.file_id.original_file(&db));
format_to!(
buf,
"{}{:?}: expected {}, got {}\n",
macro_prefix,
range,
mismatch.expected.display(&db),
mismatch.actual.display(&db),
mismatch.expected.display_test(&db, module).unwrap(),
mismatch.actual.display_test(&db, module).unwrap(),
);
}
}