Skip to content

Master borrow def fix fda #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/src/core/odoo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1155,12 +1155,12 @@ impl Odoo {
if params.text_document_position_params.text_document.uri.to_string().ends_with(".py") ||
params.text_document_position_params.text_document.uri.to_string().ends_with(".pyi") {
if let Some(file_symbol) = SyncOdoo::get_symbol_of_opened_file(session, &PathBuf::from(path.clone())) {
let file_info = session.sync_odoo.get_file_mgr().borrow_mut().get_file_info(&path);
let file_info = session.sync_odoo.get_file_mgr().borrow().get_file_info(&path);
if let Some(file_info) = file_info {
if file_info.borrow().file_info_ast.borrow().ast.is_none() {
file_info.borrow_mut().prepare_ast(session);
}
if file_info.borrow_mut().file_info_ast.borrow().ast.is_some() {
if file_info.borrow().file_info_ast.borrow().ast.is_some() {
return Ok(DefinitionFeature::get_location(session, &file_symbol, &file_info, params.text_document_position_params.position.line, params.text_document_position_params.position.character));
}
}
Expand Down
5 changes: 4 additions & 1 deletion server/src/core/python_arch_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ impl PythonArchEval {
panic!("Trying to eval_arch a symbol without any path")
}
let path = self.file.borrow().get_symbol_first_path();
let file_info_rc = session.sync_odoo.get_file_mgr().borrow().get_file_info(&path).expect("File not found in cache").clone();
let Some(file_info_rc) = session.sync_odoo.get_file_mgr().borrow().get_file_info(&path).clone() else {
warn!("File info not found for {}", path);
return;
};
if file_info_rc.borrow().file_info_ast.borrow().ast.is_none() {
file_info_rc.borrow_mut().prepare_ast(session);
}
Expand Down