summaryrefslogtreecommitdiff
path: root/support/texlab/crates/texlab/src/features/inlay_hint.rs
blob: ddd8ff26d8c0a115049d6dd19cf42c8754e582d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use base_db::Workspace;

use crate::util::{from_proto, to_proto};

pub fn find_all(
    workspace: &Workspace,
    params: lsp_types::InlayHintParams,
) -> Option<Vec<lsp_types::InlayHint>> {
    let params = from_proto::inlay_hint_params(workspace, params)?;
    let hints = inlay_hints::find_all(&params)?
        .into_iter()
        .filter_map(|hint| to_proto::inlay_hint(hint, &params.feature.document.line_index))
        .collect();

    Some(hints)
}