Skip to content

Conversation

@mmahrouss
Copy link
Collaborator

No description provided.

@mmahrouss mmahrouss added the bug Something isn't working label Apr 29, 2025
@mmahrouss mmahrouss added this to the 0.6.3 milestone Apr 29, 2025
@mmahrouss mmahrouss requested a review from fda-odoo April 29, 2025 09:26
@mmahrouss mmahrouss self-assigned this Apr 29, 2025
let path_symbol = entry.borrow().root.borrow().get_symbol(&tree, u32::MAX);
if path_symbol.is_empty() {
continue;
if let Some(main_ep) = session.sync_odoo.entry_point_mgr.borrow().main_entry_point.as_ref(){
Copy link
Collaborator

Choose a reason for hiding this comment

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

but this way it means that the code won't work anymore for custom entrypoints if main entry is not set

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the if let is only around the first loop actually.

I am reading carefully.

So first loop actually only affects MAIN | (some) ADDON Entry points due to the condition

Second loop loops over custom entry points only

I think I can write the fix to be more readable in the future, by using iter_main in the first loop

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

@mmahrouss mmahrouss force-pushed the master-fix-hover-no-main-ep-mdms branch from 17c6416 to 5d91a4c Compare April 29, 2025 13:30
Comment on lines +803 to 804
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) {
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

@mmahrouss mmahrouss requested a review from fda-odoo April 30, 2025 12:55
@fda-odoo fda-odoo merged commit 8815310 into master May 22, 2025
1 check passed
@mmahrouss mmahrouss deleted the master-fix-hover-no-main-ep-mdms branch July 8, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants