summaryrefslogtreecommitdiff
path: root/support/texlab/src/features/completion/begin_command.rs
blob: 699b06c067bfbc24974593628b7f5560c85977a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use lsp_types::CompletionParams;

use crate::features::cursor::CursorContext;

use super::types::{InternalCompletionItem, InternalCompletionItemData};

pub fn complete_begin_command(
    context: &CursorContext<CompletionParams>,
    items: &mut Vec<InternalCompletionItem>,
) -> Option<()> {
    let range = context.cursor.command_range(context.offset)?;

    items.push(InternalCompletionItem::new(
        range,
        InternalCompletionItemData::BeginCommand,
    ));
    Some(())
}