Skip to content

Commit 61d7343

Browse files
committed
[IMP] server: refactor hooks to handle function evaluations
1 parent 5cd5df0 commit 61d7343

File tree

4 files changed

+310
-271
lines changed

4 files changed

+310
-271
lines changed

server/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ tracing-appender = "0.2.3"
2828
tracing-panic = "0.1.2"
2929
winapi = { version = "0.3.9", features = ["winbase", "processthreadsapi", "synchapi", "handleapi"] }
3030
ctrlc = "3.4.4"
31+
once_cell = "1.20.1"
3132
[target.'cfg(target_os = "linux")'.dependencies]
3233
nix = { version = "0.29.0", features = ["process"] }

server/src/core/python_arch_eval.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ impl PythonArchEval {
110110
} else {
111111
//then Symbol must be a function
112112
symbol.borrow_mut().as_func_mut().replace_diagnostics(BuildSteps::ARCH_EVAL, self.diagnostics.clone());
113+
PythonArchEvalHooks::on_function_eval(session.sync_odoo, self.sym_stack.first().unwrap().clone());
113114
}
114115
let mut symbol = self.sym_stack.first().unwrap().borrow_mut();
115116
symbol.set_build_status(BuildSteps::ARCH_EVAL, BuildStatus::DONE);
@@ -337,9 +338,6 @@ impl PythonArchEval {
337338
fn _visit_assign(&mut self, session: &mut SessionInfo, assign_stmt: &StmtAssign) {
338339
let assigns = python_utils::unpack_assign(&assign_stmt.targets, None, Some(&assign_stmt.value));
339340
for assign in assigns.iter() {
340-
if assign.target.id.to_string() == "AbstractModel" {
341-
println!("here");
342-
}
343341
let variable = self.sym_stack.last().unwrap().borrow_mut().get_positioned_symbol(&assign.target.id.to_string(), &assign.target.range);
344342
if let Some(variable_rc) = variable {
345343
let parent = variable_rc.borrow().parent().as_ref().unwrap().upgrade().unwrap().clone();

0 commit comments

Comments
 (0)