Skip to content

[FIX] server: fix error on hover with no main EP #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
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