Repository: astral-sh/ruff
File: crates/ty_server/src/server/api/requests/inlay_hints.rs (Rust)

Code before:
                    position: hint
                        .position
                        .to_lsp_position(db, file, snapshot.encoding())?
                        .local_position(),
                    label: inlay_hint_label(&hint.label, db, snapshot.encoding()),
                    kind: Some(inlay_hint_kind(&hint.kind)),
                    tooltip: None,
                    padding_left: None,
                    padding_right: None,
                    data: None,
                    text_edits: Some(
                        hint.text_edits
                            .into_iter()
                            .filter_map(|text_edit| {
                                inlay_hint_text_edit(text_edit, db, file, snapshot.encoding())
                            })
                            .collect(),
                    ),
                })
            })
            .collect();

        Ok(Some(inlay_hints))
    }
}

impl RetriableRequestHandler for InlayHintRequestHandler {}

fn inlay_hint_kind(inlay_hint_kind: &InlayHintKind) -> lsp_types::InlayHintKind {
    match inlay_hint_kind {
        InlayHintKind::Type => lsp_types::InlayHintKind::TYPE,
        InlayHintKind::CallArgumentName => lsp_types::InlayHintKind::PARAMETER,
    }
}

fn inlay_hint_label(
    inlay_hint_label: &InlayHintLabel,
    db: &ProjectDatabase,
    encoding: PositionEncoding,
) -> lsp_types::InlayHintLabel {
    let mut label_parts = Vec::new();
    for part in inlay_hint_label.parts() {
        label_parts.push(lsp_types::InlayHintLabelPart {
            value: part.text().into(),
            location: part
                .target()
                .and_then(|target| target.to_location(db, encoding)),
            tooltip: None,
            command: None,
        });
    }

Review comment (suggestion):
```suggestion
            "Inlay hints computed in {:?}",
```

What's the motivation for printing all inlay hints? I worry that this gets very verbose very quickly. 




Code after:
            .filter_map(|hint| {
                Some(lsp_types::InlayHint {
                    position: hint
                        .position
                        .to_lsp_position(db, file, snapshot.encoding())?
                        .local_position(),
                    label: inlay_hint_label(&hint.label, db, snapshot.encoding()),
                    kind: Some(inlay_hint_kind(&hint.kind)),
                    tooltip: None,
                    padding_left: None,
                    padding_right: None,
                    data: None,
                    text_edits: Some(
                        hint.text_edits
                            .into_iter()
                            .filter_map(|text_edit| {
                                inlay_hint_text_edit(text_edit, db, file, snapshot.encoding())
                            })
                            .collect(),
                    ),
                })
            })
            .collect();

        tracing::debug!(
            "Inlay hint request returned {} hints in {:?}",
            inlay_hints.len(),
            start.elapsed()
        );

        Ok(Some(inlay_hints))
    }
}

impl RetriableRequestHandler for InlayHintRequestHandler {}

fn inlay_hint_kind(inlay_hint_kind: &InlayHintKind) -> lsp_types::InlayHintKind {
    match inlay_hint_kind {
        InlayHintKind::Type => lsp_types::InlayHintKind::TYPE,
        InlayHintKind::CallArgumentName => lsp_types::InlayHintKind::PARAMETER,
    }
}

fn inlay_hint_label(
    inlay_hint_label: &InlayHintLabel,
    db: &ProjectDatabase,
    encoding: PositionEncoding,
) -> lsp_types::InlayHintLabel {
    let mut label_parts = Vec::new();
    for part in inlay_hint_label.parts() {
        label_parts.push(lsp_types::InlayHintLabelPart {