From 509fd1a50644741d7c4b418fe2692772c03d05d3 Mon Sep 17 00:00:00 2001 From: LSTM-Kirigaya <1193466151@qq.com> Date: Mon, 2 Dec 2024 00:30:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=20vhdl=5Fparser=20=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E8=A1=A5=E5=85=A8=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 1 + src/completion/vhdl.rs | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d6cd34b..4542a3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1416,6 +1416,7 @@ dependencies = [ name = "sv-parser" version = "0.13.3" dependencies = [ + "log", "nom", "nom-greedyerror", "sv-parser-error", diff --git a/src/completion/vhdl.rs b/src/completion/vhdl.rs index 83efd78..e74a366 100644 --- a/src/completion/vhdl.rs +++ b/src/completion/vhdl.rs @@ -39,16 +39,16 @@ pub fn completion(server: &LSPServer, params: &CompletionParams) -> Option>(); + + // let Some(source) = global_project.project.get_source(project_file) else { + // return None + // }; + // let cursor = from_lsp_pos(params.text_document_position.position); + // let vhdl_project_completion_items = global_project.project + // .list_completion_options(&source, cursor) + // .into_iter() + // .map(|item| vhdl_ls::VHDLServer::completion_item_to_tower_lsp_item(item)) + // .collect::>(); let response = match ¶ms.context { Some(context) => match context.trigger_kind { @@ -64,7 +64,7 @@ pub fn completion(server: &LSPServer, params: &CompletionParams) -> Option Option Option String { } i += 1; } - snippet_codes.push(");\n".to_string()); + snippet_codes.push("\n);\n".to_string()); } snippet_codes.join("")