From ff1037f0d3d24c3197913511ff025f502228557e Mon Sep 17 00:00:00 2001 From: LSTM-Kirigaya <1193466151@qq.com> Date: Thu, 2 Jan 2025 01:12:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=96=B0=E7=9A=84=20netlist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 7 +++++++ Cargo.toml | 1 + src/code_lens/sv.rs | 8 +++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee87264..b4af95c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,6 +99,12 @@ dependencies = [ "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]] name = "async-trait" version = "0.1.83" @@ -337,6 +343,7 @@ dependencies = [ name = "digital-lsp" version = "0.0.1" dependencies = [ + "anyhow", "bincode", "dirs-next", "flexi_logger", diff --git a/Cargo.toml b/Cargo.toml index 6c324b2..1852ddd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ structopt = "0.3.26" strum = "0.26.1" strum_macros = "0.26.1" xml = "0.8.16" +anyhow = "1.0.95" [dev-dependencies] tempdir = "0.3.7" diff --git a/src/code_lens/sv.rs b/src/code_lens/sv.rs index 901a23d..5154f18 100644 --- a/src/code_lens/sv.rs +++ b/src/code_lens/sv.rs @@ -50,7 +50,7 @@ fn make_test_code_lens( "parent": null }); let command = Command { - title: "Test".to_string(), + title: "Simulate".to_string(), command: "digital-ide.tool.icarus.simulateFile".to_string(), arguments: Some(vec![module_data_item]) }; @@ -69,10 +69,12 @@ fn make_run_code_lens( module: &core::hdlparam::Module ) -> CodeLens { let file = serde_json::json!(path_string); + let module_name = serde_json::json!(module.name.to_string()); + let command = Command { - title: "Run".to_string(), + title: "Netlist".to_string(), command: "digital-ide.netlist.show".to_string(), - arguments: Some(vec![file]) + arguments: Some(vec![file, module_name]) }; let code_lens = CodeLens { range: module.range.to_lsp_range(),