mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-10 12:19:28 +00:00
Add debugging info when a symbol is not found (#15330)
Release Notes: - N/A Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
parent
70e895a8c7
commit
64add2f222
1 changed files with 15 additions and 1 deletions
|
@ -532,7 +532,21 @@ impl EditOperation {
|
||||||
.path_candidates
|
.path_candidates
|
||||||
.iter()
|
.iter()
|
||||||
.find(|item| item.string == symbol)
|
.find(|item| item.string == symbol)
|
||||||
.context("symbol not found")?;
|
.with_context(|| {
|
||||||
|
format!(
|
||||||
|
"symbol {:?} not found in path {:?}.\ncandidates: {:?}.\nparse status: {:?}. text:\n{}",
|
||||||
|
symbol,
|
||||||
|
path,
|
||||||
|
outline
|
||||||
|
.path_candidates
|
||||||
|
.iter()
|
||||||
|
.map(|candidate| &candidate.string)
|
||||||
|
.collect::<Vec<_>>(),
|
||||||
|
*parse_status.borrow(),
|
||||||
|
buffer.read_with(&cx, |buffer, _| buffer.text()).unwrap_or_else(|_| "error".to_string())
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
|
||||||
buffer.update(&mut cx, |buffer, _| {
|
buffer.update(&mut cx, |buffer, _| {
|
||||||
let outline_item = &outline.items[candidate.id];
|
let outline_item = &outline.items[candidate.id];
|
||||||
let symbol_range = outline_item.range.to_point(buffer);
|
let symbol_range = outline_item.range.to_point(buffer);
|
||||||
|
|
Loading…
Reference in a new issue