31 lines
746 B
Rust
31 lines
746 B
Rust
use crate::{server::LSPServer, utils::get_language_id_by_uri};
|
|
use tower_lsp::lsp_types::*;
|
|
|
|
pub mod keyword;
|
|
pub mod feature;
|
|
pub mod sys_tasks;
|
|
|
|
pub use sys_tasks::provide_vlog_sys_tasks_completions;
|
|
|
|
mod vhdl;
|
|
mod sv;
|
|
|
|
impl LSPServer {
|
|
pub fn completion(&self, params: CompletionParams) -> Option<CompletionResponse> {
|
|
let language_id = get_language_id_by_uri(¶ms.text_document_position.text_document.uri);
|
|
match language_id.as_str() {
|
|
"vhdl" => vhdl::completion(
|
|
self,
|
|
¶ms
|
|
),
|
|
|
|
"verilog" | "systemverilog" => sv::completion(
|
|
self,
|
|
¶ms
|
|
),
|
|
|
|
_ => None
|
|
}
|
|
}
|
|
}
|