fix primitives module name | add primitives request

This commit is contained in:
light-ly 2024-11-12 23:05:43 +08:00
parent 6039bdf2c8
commit 397946438c
2 changed files with 11 additions and 1 deletions

View File

@ -143,7 +143,7 @@ fn xml_parse_text(text: &str) -> Option<(String, String, FastHdlparam)> {
invalid: Vec::new() invalid: Vec::new()
}, },
content: Vec::new(), content: Vec::new(),
file_type: "primitive".to_string() file_type: "primitives".to_string()
}; };
let res_text = syntax_tree.text.text().to_string(); let res_text = syntax_tree.text.text().to_string();
@ -230,6 +230,9 @@ fn xml_parse_text(text: &str) -> Option<(String, String, FastHdlparam)> {
} }
} }
for module in hdlparam.content.iter_mut() {
module.name = res_inst_name.clone();
}
Some((res_inst_name, res_text, hdlparam)) Some((res_inst_name, res_text, hdlparam))
} else { } else {
None None

View File

@ -304,6 +304,13 @@ fn do_vhdl_fast(
}) })
} }
fn do_primitives_judge(name: &str, backend: &Arc<Backend>) -> bool {
let sources = &backend.server.srcs;
let primitive_text = sources.primitive_text.clone();
let primitive_map = primitive_text.name_to_text.read().unwrap();
primitive_map.contains_key(name)
}
// #[derive(Clone)] // #[derive(Clone)]
// pub struct UpdateFastApi; // pub struct UpdateFastApi;