MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / hint_label

Function hint_label

tests/integration/inlay_hints.rs:39–44  ·  view source on GitHub ↗

Extract the label string from an InlayHint.

(hint: &InlayHint)

Source from the content-addressed store, hash-verified

37
38/// Extract the label string from an InlayHint.
39fn hint_label(hint: &InlayHint) -> String {
40 match &hint.label {
41 InlayHintLabel::String(s) => s.clone(),
42 InlayHintLabel::LabelParts(parts) => parts.iter().map(|p| p.value.as_str()).collect(),
43 }
44}
45
46/// Collect the labels from a slice of hints.
47fn labels(hints: &[&InlayHint]) -> Vec<String> {

Calls 4

cloneMethod · 0.80
iterMethod · 0.80
as_strMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected