Skip to content

Commit 5c48cdb

Browse files
committed
wip
1 parent 24f3d01 commit 5c48cdb

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

server/src/constants.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub const EXTENSION_VERSION: &str = "0.4.1";
99
pub const DEBUG_ODOO_BUILDER: bool = false;
1010
pub const DEBUG_MEMORY: bool = false;
1111
pub const DEBUG_THREADS: bool = false;
12-
pub const DEBUG_STEPS: bool = false;
12+
pub const DEBUG_STEPS: bool = true;
1313

1414
pub type Tree = (Vec<OYarn>, Vec<OYarn>);
1515

server/src/core/import_resolver.rs

+13
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,19 @@ pub fn resolve_import_stmt(session: &mut SessionInfo, source_file_symbol: &Rc<Re
135135
result[name_index as usize].name = name.split(".").map(|s| oyarn!("{}", s)).next().unwrap();
136136
result[name_index as usize].found = true;
137137
result[name_index as usize].symbol = name_symbol.as_ref().unwrap().clone();
138+
//we found name_symbol and will return it. But in the case of "import A.B.C", even if we will return A, we need to effectively import B then
139+
//C as it can have effects on the codebase
140+
let name_split: Vec<OYarn> = name.split(".").map(|s| oyarn!("{}", s)).collect();
141+
if name_split.len() > 1 {
142+
_get_or_create_symbol(
143+
session,
144+
&entry,
145+
source_path.as_str(),
146+
from_symbol.clone(),
147+
&Vec::from_iter(name_split[1..name_split.len()-1].iter().cloned()),
148+
None,
149+
None);
150+
}
138151
continue;
139152
}
140153
let name_split: Vec<OYarn> = name.split(".").map(|s| oyarn!("{}", s)).collect();

0 commit comments

Comments
 (0)