mirror of
https://github.com/Dummi26/mers.git
synced 2025-12-13 19:06:16 +01:00
improve support for #include in language server
This commit is contained in:
@@ -27,8 +27,10 @@ impl MersStatement for IncludeMers {
|
||||
info: &mut info::Info<super::Local>,
|
||||
comp: CompInfo,
|
||||
) -> Result<Box<dyn program::run::MersStatement>, CheckError> {
|
||||
let mut inc_info = info.duplicate();
|
||||
inc_info.global.enable_hooks = false;
|
||||
let compiled: Arc<Box<dyn crate::program::run::MersStatement>> =
|
||||
match self.include.compile(&mut info.duplicate(), comp) {
|
||||
match self.include.compile(&mut inc_info, comp) {
|
||||
Ok(v) => Arc::new(v),
|
||||
Err(e) => {
|
||||
return Err(CheckError::new()
|
||||
|
||||
@@ -26,8 +26,11 @@ impl MersStatement for Chain {
|
||||
if init_to.is_some() {
|
||||
return Err("can't init to statement type Chain".to_string().into());
|
||||
}
|
||||
let prev_enable_hooks = info.global.enable_hooks;
|
||||
info.global.enable_hooks = false;
|
||||
let arg = self.first.check(info, None)?;
|
||||
let func = self.chained.check(info, None)?;
|
||||
info.global.enable_hooks = prev_enable_hooks;
|
||||
let mut o = Type::empty();
|
||||
for func in &func.types {
|
||||
if let Some(func) = func
|
||||
|
||||
Reference in New Issue
Block a user