Skip to content

Commit 259b5d7

Browse files
committed
[FIX] server: fix custom entry point creation on hover
1 parent ada814f commit 259b5d7

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
@@ -816,6 +816,13 @@ impl SyncOdoo {
816816
pub fn get_symbol_of_opened_file(session: &mut SessionInfo, path: &PathBuf) -> Option<Rc<RefCell<Symbol>>> {
817817
let path_in_tree = path.to_tree_path();
818818
for entry in session.sync_odoo.entry_point_mgr.borrow().iter_main() {
819+
let sym_in_data = entry.borrow().data_symbols.get(path.sanitize().as_str()).cloned();
820+
if let Some(sym) = sym_in_data {
821+
if let Some(sym) = sym.upgrade() {
822+
return Some(sym);
823+
}
824+
continue;
825+
}
819826
if (entry.borrow().typ == EntryPointType::MAIN || entry.borrow().addon_to_odoo_path.is_some()) && entry.borrow().is_valid_for(path) {
820827
let tree = entry.borrow().get_tree_for_entry(path);
821828
let path_symbol = entry.borrow().root.borrow().get_symbol(&tree, u32::MAX);
@@ -828,6 +835,13 @@ impl SyncOdoo {
828835
//Not found? Then return if it is matching a non-public entry strictly matching the file
829836
let mut found_an_entry = false; //there to ensure that a wrongly built entry would create infinite loop
830837
for entry in session.sync_odoo.entry_point_mgr.borrow().custom_entry_points.iter() {
838+
let sym_in_data = entry.borrow().data_symbols.get(path.sanitize().as_str()).cloned();
839+
if let Some(sym) = sym_in_data {
840+
if let Some(sym) = sym.upgrade() {
841+
return Some(sym);
842+
}
843+
continue;
844+
}
831845
if !entry.borrow().is_public() && &path_in_tree == &PathBuf::from(&entry.borrow().path) {
832846
found_an_entry = true;
833847
let tree = entry.borrow().get_tree_for_entry(path);

0 commit comments

Comments
 (0)