Handle `completionItem/resolve` by populating the `documentation` field with rich markdown. Reuses the existing hover methods ([`hover_for_method`], [`hover_for_property`], [`hover_for_constant`], [`hover_for_function`], [`hover_for_class_info`]) so that the documentation shown on selection is identical to what the user sees when hovering over a symbol. For union-type members (where `extra_class
(&self, mut item: CompletionItem)
| 107 | /// rule, deduplicating by declaring class. This mirrors the inline |
| 108 | /// hover behaviour for union member access. |
| 109 | pub(crate) fn handle_completion_resolve(&self, mut item: CompletionItem) -> CompletionItem { |
| 110 | let Some(ref data_value) = item.data else { |
| 111 | return item; |
| 112 | }; |
| 113 | |
| 114 | let Ok(data) = serde_json::from_value::<CompletionItemData>(data_value.clone()) else { |
| 115 | return item; |
| 116 | }; |
| 117 | |
| 118 | let ctx = self.file_context(&data.uri); |
| 119 | let content = self.get_file_content(&data.uri).unwrap_or_default(); |
| 120 | |
| 121 | match data.kind.as_str() { |
| 122 | // ── Class member kinds ────────────────────────────────── |
| 123 | "method" | "property" | "constant" => { |
| 124 | self.resolve_member(&mut item, &data, &ctx, &content); |
| 125 | } |
| 126 | |
| 127 | // ── Standalone function ───────────────────────────────── |
| 128 | "function" => { |
| 129 | self.resolve_function(&mut item, &data, &ctx, &content); |
| 130 | } |
| 131 | |
| 132 | // ── Class / interface / trait / enum reference ─────────── |
| 133 | "class" => { |
| 134 | self.resolve_class(&mut item, &data, &ctx, &content); |
| 135 | } |
| 136 | |
| 137 | // ── Global constant (define / stub) ───────────────────── |
| 138 | "global_constant" => { |
| 139 | self.resolve_global_constant(&mut item, &data); |
| 140 | } |
| 141 | |
| 142 | _ => {} |
| 143 | } |
| 144 | |
| 145 | item |
| 146 | } |
| 147 | |
| 148 | /// Resolve a class member (method, property, or constant). |
| 149 | fn resolve_member( |
no test coverage detected