Skip to content

Commit ab46514

Browse files
committed
wip
1 parent 45c232e commit ab46514

File tree

3 files changed

+177
-120
lines changed

3 files changed

+177
-120
lines changed

server/src/core/evaluation.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,13 @@ impl Evaluation {
10871087
if bases.len() != 1 {
10881088
return AnalyzeAstResult::from_only_diagnostics(diagnostics);
10891089
}
1090+
let parent_file_or_func = parent.clone().borrow().parent_file_or_function().as_ref().unwrap().upgrade().unwrap();
1091+
let is_in_validation = match parent_file_or_func.borrow().typ().clone() {
1092+
SymType::FILE | SymType::PACKAGE(_) | SymType::FUNCTION => {
1093+
parent_file_or_func.borrow().build_status(BuildSteps::VALIDATION) == BuildStatus::IN_PROGRESS
1094+
},
1095+
_ => {false}
1096+
};
10901097
let value = Evaluation::expr_to_str(session, &sub.slice, parent.clone(), max_infer, &mut diagnostics);
10911098
diagnostics.extend(value.1);
10921099
if let Some(value) = value.0 {
@@ -1105,6 +1112,7 @@ impl Evaluation {
11051112
context.as_mut().unwrap().insert(S!("args"), ContextValue::STRING(value));
11061113
let old_range = context.as_mut().unwrap().remove(&S!("range"));
11071114
context.as_mut().unwrap().insert(S!("range"), ContextValue::RANGE(sub.slice.range()));
1115+
context.as_mut().unwrap().insert(S!("is_in_validation"), ContextValue::BOOLEAN(is_in_validation));
11081116
let hook_result = hook(session, &get_item_eval.symbol, context, &mut diagnostics, Some(parent.clone()));
11091117
if let Some(hook_result) = hook_result {
11101118
match hook_result {
@@ -1119,6 +1127,7 @@ impl Evaluation {
11191127
}
11201128
}
11211129
context.as_mut().unwrap().remove(&S!("args"));
1130+
context.as_mut().unwrap().remove(&S!("is_in_validation"));
11221131
context.as_mut().unwrap().insert(S!("range"), old_range.unwrap());
11231132
}
11241133
}

0 commit comments

Comments
 (0)