Extract the class name(s) from a `CompletionItem`'s `data` field. Returns a pipe-separated string of all class names (primary + extras), e.g. `"Lamp|Faucet"`. Returns `None` when the data field is absent or cannot be deserialized.
(item: &CompletionItem)
| 708 | /// extras), e.g. `"Lamp|Faucet"`. Returns `None` when the data |
| 709 | /// field is absent or cannot be deserialized. |
| 710 | fn class_names_from_data(item: &CompletionItem) -> Option<String> { |
| 711 | let data_value = item.data.as_ref()?; |
| 712 | let data: CompletionItemData = serde_json::from_value(data_value.clone()).ok()?; |
| 713 | let mut names = vec![display_class_name(&data.class_name).to_string()]; |
| 714 | for extra in &data.extra_class_names { |
| 715 | names.push(display_class_name(extra).to_string()); |
| 716 | } |
| 717 | Some(names.join("|")) |
| 718 | } |
| 719 | |
| 720 | /// Partition and sort completion items by union membership. |
| 721 | /// |
no test coverage detected