Skip to content

Commit

Permalink
[IMP] server: refactor hooks to handle function evaluations
Browse files Browse the repository at this point in the history
  • Loading branch information
fda-odoo committed Oct 1, 2024
1 parent 5cd5df0 commit 61d7343
Show file tree
Hide file tree
Showing 4 changed files with 310 additions and 271 deletions.
1 change: 1 addition & 0 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ tracing-appender = "0.2.3"
tracing-panic = "0.1.2"
winapi = { version = "0.3.9", features = ["winbase", "processthreadsapi", "synchapi", "handleapi"] }
ctrlc = "3.4.4"
once_cell = "1.20.1"
[target.'cfg(target_os = "linux")'.dependencies]
nix = { version = "0.29.0", features = ["process"] }
4 changes: 1 addition & 3 deletions server/src/core/python_arch_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ impl PythonArchEval {
} else {
//then Symbol must be a function
symbol.borrow_mut().as_func_mut().replace_diagnostics(BuildSteps::ARCH_EVAL, self.diagnostics.clone());
PythonArchEvalHooks::on_function_eval(session.sync_odoo, self.sym_stack.first().unwrap().clone());
}
let mut symbol = self.sym_stack.first().unwrap().borrow_mut();
symbol.set_build_status(BuildSteps::ARCH_EVAL, BuildStatus::DONE);
Expand Down Expand Up @@ -337,9 +338,6 @@ impl PythonArchEval {
fn _visit_assign(&mut self, session: &mut SessionInfo, assign_stmt: &StmtAssign) {
let assigns = python_utils::unpack_assign(&assign_stmt.targets, None, Some(&assign_stmt.value));
for assign in assigns.iter() {
if assign.target.id.to_string() == "AbstractModel" {
println!("here");
}
let variable = self.sym_stack.last().unwrap().borrow_mut().get_positioned_symbol(&assign.target.id.to_string(), &assign.target.range);
if let Some(variable_rc) = variable {
let parent = variable_rc.borrow().parent().as_ref().unwrap().upgrade().unwrap().clone();
Expand Down
Loading

0 comments on commit 61d7343

Please sign in to comment.