diff --git a/kclvm/sema/src/advanced_resolver/node.rs b/kclvm/sema/src/advanced_resolver/node.rs index 4a5d1748d..5e0173973 100644 --- a/kclvm/sema/src/advanced_resolver/node.rs +++ b/kclvm/sema/src/advanced_resolver/node.rs @@ -1250,7 +1250,33 @@ impl<'ctx> AdvancedResolver<'ctx> { args: &'ctx [ast::NodeRef], kwargs: &'ctx [ast::NodeRef], ) -> anyhow::Result<()> { - self.do_arguments_symbol_resolve_with_hint(args, kwargs, false, vec![]) + for arg in args.iter() { + self.expr(arg)?; + } + for kw in kwargs.iter() { + if let Some(value) = &kw.node.value { + self.expr(value)?; + } + let (start_pos, end_pos): Range = kw.get_span_pos(); + let value = self.gs.get_symbols_mut().alloc_value_symbol( + ValueSymbol::new(kw.node.arg.node.get_name(), start_pos, end_pos, None, false), + self.ctx.get_node_key(&kw.id), + self.ctx.current_pkgpath.clone().unwrap(), + ); + + if let Some(value) = self.gs.get_symbols_mut().values.get_mut(value.get_id()) { + value.sema_info = SymbolSemanticInfo { + ty: self + .ctx + .node_ty_map + .borrow() + .get(&self.ctx.get_node_key(&kw.id)) + .map(|ty| ty.clone()), + doc: None, + }; + } + } + Ok(()) } pub fn do_arguments_symbol_resolve_with_hint(