Link to the specific source line

This commit is contained in:
Aleksey Kladov 2020-05-31 15:36:20 +02:00
parent f20775d7eb
commit 899570ad7a
5 changed files with 90 additions and 36 deletions

View file

@ -64,7 +64,7 @@ impl Assist {
assert_eq!(lines.next().unwrap().as_str(), "->");
assert_eq!(lines.next().unwrap().as_str(), "```");
let after = take_until(lines.by_ref(), "```");
let location = Location::new(path.to_path_buf());
let location = Location::new(path.to_path_buf(), block.line);
acc.push(Assist { id, location, doc, before, after })
}
@ -90,6 +90,7 @@ impl fmt::Display for Assist {
writeln!(
f,
"[discrete]\n=== `{}`
**Source:** {}
{}
@ -101,6 +102,7 @@ impl fmt::Display for Assist {
```rust
{}```",
self.id,
self.location,
self.doc,
hide_hash_comments(&before),
hide_hash_comments(&after)