From a42b87cd9785f80fe087938051d5b479b1a3ffc7 Mon Sep 17 00:00:00 2001 From: light-ly <1505507717@qq.com> Date: Thu, 9 Jan 2025 12:08:58 +0800 Subject: [PATCH] fix vhdl params/ports in completion --- src/core/hdlparam.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/core/hdlparam.rs b/src/core/hdlparam.rs index c96c141..7428225 100644 --- a/src/core/hdlparam.rs +++ b/src/core/hdlparam.rs @@ -573,8 +573,22 @@ impl HdlParam { if let Some(hdl_file) = fast_map.get(path) { // 查找模块 if let Some(module) = hdl_file.name_to_module.get(name) { + + // check vhdl entity params and ports + let entitys = hdl_file.fast.entitys + .iter() + .filter(|ent| ent.name == name) + .cloned() + .collect::>(); + // set entity params and ports to arch + let mut module = module.clone(); + if let Some(entity) = entitys.first() { + module.params = entity.params.clone(); + module.ports = entity.ports.clone(); + } + return Some(( - module.clone(), + module, hdl_file.fast.file_type.to_string(), path.to_string() ));