diff --git a/copy_server_to_ide.sh b/copy_server_to_ide.sh index 5f70302..835c44d 100644 Binary files a/copy_server_to_ide.sh and b/copy_server_to_ide.sh differ diff --git a/src/request/fast.rs b/src/request/fast.rs index 4dbfaf3..da2f8a8 100644 --- a/src/request/fast.rs +++ b/src/request/fast.rs @@ -253,6 +253,11 @@ fn do_vhdl_fast( if let Some(design_file) = vhdl_parse(&pathbuf) { if let Some(mut fast) = make_fast_from_design_file(&design_file) { fast.file_type = file_type.to_string(); + // for module in &fast.content { + // if module.name == "None" { + // info!("debug, module : {:?}, path: {:?}", module, pathbuf); + // } + // } hdl_param.update_fast(path.to_string(), fast.clone()); return Ok(fast); } diff --git a/src/request/primitives.rs b/src/request/primitives.rs index d41bdd1..87b2897 100644 --- a/src/request/primitives.rs +++ b/src/request/primitives.rs @@ -1,5 +1,6 @@ use std::future; use std::sync::Arc; +use log::info; use serde::{Deserialize, Serialize}; use tower_lsp::jsonrpc::Result; use crate::server::Backend; diff --git a/src/server.rs b/src/server.rs index 44a051f..2d149f8 100644 --- a/src/server.rs +++ b/src/server.rs @@ -207,7 +207,10 @@ impl LanguageServer for Backend { info!("extensionPath: {:?}", configure.extension_path); info!("toolChain: {:?}", configure.tool_chain); - self.server.srcs.init_primitive(&configure.extension_path); + self.server.srcs.init_primitive( + &configure.tool_chain, + &configure.extension_path + ); let text_document_sync = TextDocumentSyncCapability::Options( TextDocumentSyncOptions { diff --git a/src/sources.rs b/src/sources.rs index 9a01801..6f8d2e6 100644 --- a/src/sources.rs +++ b/src/sources.rs @@ -248,8 +248,10 @@ impl Sources { } } - pub fn init_primitive(&self, extension_path: &str) { - let primitive_bin = extension_path.to_string() + "/resources/dide-lsp/static/primitive.bin"; + pub fn init_primitive(&self, tool_chain: &str, extension_path: &str) { + let primitive_bin = format!("{}/resources/dide-lsp/static/{}/primitive.bin", extension_path, tool_chain); + info!("attempt to find primitives in {}", primitive_bin); + if let Some(primitive_xml) = crate::core::primitive_parser::load_primitive_bin(&primitive_bin) { let primitive_text_handle = self.primitive_text.clone(); let hdl_param_handle = self.hdl_param.clone(); @@ -645,12 +647,14 @@ pub fn sv_parser_pipeline( return; } + info!("debug, parse: {:?}", path); let syntax_tree = recovery_sv_parse_with_retry( doc, uri, last_change_range, include_dirs ); + info!("finish parse {:?}", path); // 更新 scope tree let mut scope_tree = match &syntax_tree {