Skip to content

Commit 043aacd

Browse files
committed
[FIX] move module symbol to validation step even if there is no __init__.py
1 parent f1693aa commit 043aacd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

server/src/core/python_arch_builder.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,14 @@ impl PythonArchBuilder {
146146
session.sync_odoo.add_to_rebuild_arch_eval(self.sym_stack[0].clone());
147147
}
148148
} else if self.file_mode {
149-
drop(file_info);
150-
let mut file_info = file_info_rc.borrow_mut();
151-
file_info.publish_diagnostics(session);
149+
if symbol.borrow().typ() == SymType::PACKAGE(PackageType::MODULE) {
150+
//even if there is no __init__.py, we need to go to rebuild_arch and validation to validate the manifest
151+
session.sync_odoo.add_to_rebuild_arch_eval(self.sym_stack[0].clone());
152+
} else {
153+
drop(file_info);
154+
let mut file_info = file_info_rc.borrow_mut();
155+
file_info.publish_diagnostics(session);
156+
}
152157
}
153158
PythonArchBuilderHooks::on_done(session, &self.sym_stack[0]);
154159
let mut symbol = self.sym_stack[0].borrow_mut();

0 commit comments

Comments
 (0)