use tower_lsp::{ jsonrpc::Result, lsp_types::* };

use crate::backend::Backend;

pub async fn completion(
    _backend: &Backend,
    _params: CompletionParams
) -> Result<Option<CompletionResponse>> {
    let items = vec![
        CompletionItem {
            label: "fn".into(),
            kind: Some(CompletionItemKind::KEYWORD),
            detail: Some("Function".into()),
            ..Default::default()
        },
        CompletionItem {
            label: "struct".into(),
            kind: Some(CompletionItemKind::KEYWORD),
            detail: Some("Struct".into()),
            ..Default::default()
        },
        CompletionItem {
            label: "let".into(),
            kind: Some(CompletionItemKind::KEYWORD),
            detail: Some("Variable".into()),
            ..Default::default()
        },
        CompletionItem {
            label: "return".into(),
            kind: Some(CompletionItemKind::KEYWORD),
            detail: Some("Return".into()),
            ..Default::default()
        }
    ];

    Ok(Some(CompletionResponse::Array(items)))
}
