完成 xilinx 原语适配

This commit is contained in:
锦恢 2024-11-14 16:18:47 +08:00
parent ce267363fb
commit b01ff8e371
5 changed files with 16 additions and 3 deletions

Binary file not shown.

View File

@ -253,6 +253,11 @@ fn do_vhdl_fast(
if let Some(design_file) = vhdl_parse(&pathbuf) { if let Some(design_file) = vhdl_parse(&pathbuf) {
if let Some(mut fast) = make_fast_from_design_file(&design_file) { if let Some(mut fast) = make_fast_from_design_file(&design_file) {
fast.file_type = file_type.to_string(); 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()); hdl_param.update_fast(path.to_string(), fast.clone());
return Ok(fast); return Ok(fast);
} }

View File

@ -1,5 +1,6 @@
use std::future; use std::future;
use std::sync::Arc; use std::sync::Arc;
use log::info;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use tower_lsp::jsonrpc::Result; use tower_lsp::jsonrpc::Result;
use crate::server::Backend; use crate::server::Backend;

View File

@ -207,7 +207,10 @@ impl LanguageServer for Backend {
info!("extensionPath: {:?}", configure.extension_path); info!("extensionPath: {:?}", configure.extension_path);
info!("toolChain: {:?}", configure.tool_chain); 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( let text_document_sync = TextDocumentSyncCapability::Options(
TextDocumentSyncOptions { TextDocumentSyncOptions {

View File

@ -248,8 +248,10 @@ impl Sources {
} }
} }
pub fn init_primitive(&self, extension_path: &str) { pub fn init_primitive(&self, tool_chain: &str, extension_path: &str) {
let primitive_bin = extension_path.to_string() + "/resources/dide-lsp/static/primitive.bin"; 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) { if let Some(primitive_xml) = crate::core::primitive_parser::load_primitive_bin(&primitive_bin) {
let primitive_text_handle = self.primitive_text.clone(); let primitive_text_handle = self.primitive_text.clone();
let hdl_param_handle = self.hdl_param.clone(); let hdl_param_handle = self.hdl_param.clone();
@ -645,12 +647,14 @@ pub fn sv_parser_pipeline(
return; return;
} }
info!("debug, parse: {:?}", path);
let syntax_tree = recovery_sv_parse_with_retry( let syntax_tree = recovery_sv_parse_with_retry(
doc, doc,
uri, uri,
last_change_range, last_change_range,
include_dirs include_dirs
); );
info!("finish parse {:?}", path);
// 更新 scope tree // 更新 scope tree
let mut scope_tree = match &syntax_tree { let mut scope_tree = match &syntax_tree {