| 1 |
use std::borrow::Cow; |
| 2 |
|
| 3 |
use crate::{diagnostic::LanguageServerId, Transaction}; |
| 4 |
|
| 5 |
#[derive(Debug, PartialEq, Clone)] |
| 6 |
pub struct CompletionItem { |
| 7 |
pub transaction: Transaction, |
| 8 |
pub label: Cow<'static, str>, |
| 9 |
pub kind: Cow<'static, str>, |
| 10 |
|
| 11 |
pub documentation: Option<String>, |
| 12 |
pub provider: CompletionProvider, |
| 13 |
} |
| 14 |
|
| 15 |
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)] |
| 16 |
pub enum CompletionProvider { |
| 17 |
Lsp(LanguageServerId), |
| 18 |
Path, |
| 19 |
Word, |
| 20 |
} |
| 21 |
|
| 22 |
impl From<LanguageServerId> for CompletionProvider { |
| 23 |
fn from(id: LanguageServerId) -> Self { |
| 24 |
CompletionProvider::Lsp(id) |
| 25 |
} |
| 26 |
} |