fix vhdl params/ports in completion

This commit is contained in:
light-ly 2025-01-09 12:08:58 +08:00
parent f2ccd76a65
commit a42b87cd97

View File

@ -573,8 +573,22 @@ impl HdlParam {
if let Some(hdl_file) = fast_map.get(path) { if let Some(hdl_file) = fast_map.get(path) {
// 查找模块 // 查找模块
if let Some(module) = hdl_file.name_to_module.get(name) { 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::<Vec<Entity>>();
// 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(( return Some((
module.clone(), module,
hdl_file.fast.file_type.to_string(), hdl_file.fast.file_type.to_string(),
path.to_string() path.to_string()
)); ));