Skip to content

Commit 65c655e

Browse files
committed
[FIX] workspace symbol: fix range for xml files if location.range capability is not available
1 parent 1c12fa2 commit 65c655e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/src/features/workspace_symbols.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,13 @@ impl WorkspaceSymbolFeature {
114114
})
115115
} else {
116116
let file_info = session.sync_odoo.get_file_mgr().borrow().get_file_info(path);
117+
let Some(range) = range else {
118+
return;
119+
};
117120
if let Some(file_info) = file_info {
118121
lsp_types::OneOf::Left(Location::new(
119122
FileMgr::pathname2uri(path),
120-
file_info.borrow().text_range_to_range(symbol.range())
123+
file_info.borrow().text_range_to_range(range)
121124
))
122125
} else {
123126
return;

0 commit comments

Comments
 (0)