去除 vhdl_parser 中的补全项目
This commit is contained in:
parent
99786868b9
commit
509fd1a506
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1416,6 +1416,7 @@ dependencies = [
|
||||
name = "sv-parser"
|
||||
version = "0.13.3"
|
||||
dependencies = [
|
||||
"log",
|
||||
"nom",
|
||||
"nom-greedyerror",
|
||||
"sv-parser-error",
|
||||
|
@ -39,16 +39,16 @@ pub fn completion(server: &LSPServer, params: &CompletionParams) -> Option<Compl
|
||||
};
|
||||
let escape_path = to_escape_path(&path);
|
||||
let project_file = escape_path.as_path();
|
||||
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::<Vec<CompletionItem>>();
|
||||
// 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::<Vec<CompletionItem>>();
|
||||
|
||||
let response = match ¶ms.context {
|
||||
Some(context) => match context.trigger_kind {
|
||||
@ -64,7 +64,7 @@ pub fn completion(server: &LSPServer, params: &CompletionParams) -> Option<Compl
|
||||
&doc.text_document.uri,
|
||||
)?;
|
||||
|
||||
completion_items.items.extend(vhdl_project_completion_items);
|
||||
// completion_items.items.extend(vhdl_project_completion_items);
|
||||
|
||||
completion_items.items.dedup_by_key(|i| i.label.to_string());
|
||||
Some(completion_items)
|
||||
@ -97,7 +97,7 @@ pub fn completion(server: &LSPServer, params: &CompletionParams) -> Option<Compl
|
||||
make_module_completions(server, &token, &language_id)
|
||||
);
|
||||
|
||||
completion_items.items.extend(vhdl_project_completion_items);
|
||||
// completion_items.items.extend(vhdl_project_completion_items);
|
||||
|
||||
// 去重
|
||||
completion_items.items.dedup_by_key(|i| i.label.to_string());
|
||||
@ -135,7 +135,7 @@ pub fn completion(server: &LSPServer, params: &CompletionParams) -> Option<Compl
|
||||
.collect(),
|
||||
);
|
||||
|
||||
comps.items.extend(vhdl_project_completion_items);
|
||||
// comps.items.extend(vhdl_project_completion_items);
|
||||
|
||||
comps.items.dedup_by_key(|i| i.label.clone());
|
||||
Some(comps)
|
||||
@ -320,7 +320,7 @@ fn make_instantiation_code(module: &crate::core::hdlparam::Module) -> String {
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
snippet_codes.push(");\n".to_string());
|
||||
snippet_codes.push("\n);\n".to_string());
|
||||
}
|
||||
|
||||
snippet_codes.join("")
|
||||
|
Loading…
x
Reference in New Issue
Block a user