Skip to content
Merged
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
2 changes: 1 addition & 1 deletion server/src/core/entry_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl EntryPointMgr {
)
}

//iter through all main entry points, sorted by tree lenght (from bigger to smaller)
//iter through all main entry points, sorted by tree length (from bigger to smaller)
pub fn iter_main(&self) -> impl Iterator<Item = &Rc<RefCell<EntryPoint>>>
{
let mut collected = self.main_entry_point.iter().chain(self.addons_entry_points.iter()).collect::<Vec<_>>();
Expand Down
2 changes: 1 addition & 1 deletion server/src/core/odoo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ impl SyncOdoo {
*/
pub fn get_symbol_of_opened_file(session: &mut SessionInfo, path: &PathBuf) -> Option<Rc<RefCell<Symbol>>> {
let path_in_tree = path.to_tree_path();
for entry in session.sync_odoo.entry_point_mgr.borrow().iter_for_import(session.sync_odoo.entry_point_mgr.borrow().main_entry_point.as_ref().unwrap()) {
for entry in session.sync_odoo.entry_point_mgr.borrow().iter_main() {
if (entry.borrow().typ == EntryPointType::MAIN || entry.borrow().addon_to_odoo_path.is_some()) && entry.borrow().is_valid_for(path) {
Comment on lines +803 to 804
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to this (entry.borrow().typ == EntryPointType::MAIN || entry.borrow().addon_to_odoo_path.is_some()) , we loop over public /builtin eps but always skip them.

Also since iter_main chains the iterators, it will be just empty if the option is None, so it guards against unwrap errors and also sorts for performance

let tree = entry.borrow().get_tree_for_entry(path);
let path_symbol = entry.borrow().root.borrow().get_symbol(&tree, u32::MAX);
Expand Down