支持新的 netlist

This commit is contained in:
锦恢 2025-01-02 01:12:50 +08:00
parent 7d1b9e6154
commit ff1037f0d3
3 changed files with 13 additions and 3 deletions

7
Cargo.lock generated
View File

@ -99,6 +99,12 @@ dependencies = [
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
[[package]]
name = "anyhow"
version = "1.0.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04"
[[package]] [[package]]
name = "async-trait" name = "async-trait"
version = "0.1.83" version = "0.1.83"
@ -337,6 +343,7 @@ dependencies = [
name = "digital-lsp" name = "digital-lsp"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"anyhow",
"bincode", "bincode",
"dirs-next", "dirs-next",
"flexi_logger", "flexi_logger",

View File

@ -27,6 +27,7 @@ structopt = "0.3.26"
strum = "0.26.1" strum = "0.26.1"
strum_macros = "0.26.1" strum_macros = "0.26.1"
xml = "0.8.16" xml = "0.8.16"
anyhow = "1.0.95"
[dev-dependencies] [dev-dependencies]
tempdir = "0.3.7" tempdir = "0.3.7"

View File

@ -50,7 +50,7 @@ fn make_test_code_lens(
"parent": null "parent": null
}); });
let command = Command { let command = Command {
title: "Test".to_string(), title: "Simulate".to_string(),
command: "digital-ide.tool.icarus.simulateFile".to_string(), command: "digital-ide.tool.icarus.simulateFile".to_string(),
arguments: Some(vec![module_data_item]) arguments: Some(vec![module_data_item])
}; };
@ -69,10 +69,12 @@ fn make_run_code_lens(
module: &core::hdlparam::Module module: &core::hdlparam::Module
) -> CodeLens { ) -> CodeLens {
let file = serde_json::json!(path_string); let file = serde_json::json!(path_string);
let module_name = serde_json::json!(module.name.to_string());
let command = Command { let command = Command {
title: "Run".to_string(), title: "Netlist".to_string(),
command: "digital-ide.netlist.show".to_string(), command: "digital-ide.netlist.show".to_string(),
arguments: Some(vec![file]) arguments: Some(vec![file, module_name])
}; };
let code_lens = CodeLens { let code_lens = CodeLens {
range: module.range.to_lsp_range(), range: module.range.to_lsp_range(),