Change summary
crates/assistant/src/context.rs | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
Detailed changes
@@ -532,7 +532,21 @@ impl EditOperation {
.path_candidates
.iter()
.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, _| {
let outline_item = &outline.items[candidate.id];
let symbol_range = outline_item.range.to_point(buffer);