Skip to content

Commit 45b157e

Browse files
committed
[FIX] server: fix custom entry point creation on hover
1 parent 8d0fe5f commit 45b157e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

server/src/core/odoo.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,13 @@ impl SyncOdoo {
814814
pub fn get_symbol_of_opened_file(session: &mut SessionInfo, path: &PathBuf) -> Option<Rc<RefCell<Symbol>>> {
815815
let path_in_tree = path.to_tree_path();
816816
for entry in session.sync_odoo.entry_point_mgr.borrow().iter_main() {
817+
let sym_in_data = entry.borrow().data_symbols.get(path.sanitize().as_str()).cloned();
818+
if let Some(sym) = sym_in_data {
819+
if let Some(sym) = sym.upgrade() {
820+
return Some(sym);
821+
}
822+
continue;
823+
}
817824
if (entry.borrow().typ == EntryPointType::MAIN || entry.borrow().addon_to_odoo_path.is_some()) && entry.borrow().is_valid_for(path) {
818825
let tree = entry.borrow().get_tree_for_entry(path);
819826
let path_symbol = entry.borrow().root.borrow().get_symbol(&tree, u32::MAX);
@@ -826,6 +833,13 @@ impl SyncOdoo {
826833
//Not found? Then return if it is matching a non-public entry strictly matching the file
827834
let mut found_an_entry = false; //there to ensure that a wrongly built entry would create infinite loop
828835
for entry in session.sync_odoo.entry_point_mgr.borrow().custom_entry_points.iter() {
836+
let sym_in_data = entry.borrow().data_symbols.get(path.sanitize().as_str()).cloned();
837+
if let Some(sym) = sym_in_data {
838+
if let Some(sym) = sym.upgrade() {
839+
return Some(sym);
840+
}
841+
continue;
842+
}
829843
if !entry.borrow().is_public() && &path_in_tree == &PathBuf::from(&entry.borrow().path) {
830844
found_an_entry = true;
831845
let tree = entry.borrow().get_tree_for_entry(path);

0 commit comments

Comments
 (0)