From ba2dfd5eea4125cc9fb8074382915b0852d208f0 Mon Sep 17 00:00:00 2001 From: Kirill Starkov Date: Fri, 28 Jun 2024 15:54:40 +0800 Subject: [PATCH] fix panic 2 --- src/ast/ast_module.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ast/ast_module.rs b/src/ast/ast_module.rs index bcc7a7145..b58359fbb 100644 --- a/src/ast/ast_module.rs +++ b/src/ast/ast_module.rs @@ -387,7 +387,11 @@ impl AstModule { ); let symbol_to_search_res = |x: &AstSymbolInstanceRc| { let symbol_declaration = x.borrow().symbol_info_struct(); - let content = symbol_declaration.get_content(&code.to_string()).unwrap_or_default(); + let content = if symbol_declaration.file_path == doc.path { + symbol_declaration.get_content(&code.to_string()).unwrap_or_default() + } else { + symbol_declaration.get_content_from_file_blocked().unwrap_or_default() + }; let usefulness = *guid_to_usefulness .get(&symbol_declaration.guid) .expect("Guid has not found in `guid_to_usefulness` dict, \