Copy a node from an array into a heap-allocated standalone node. */
| 8218 | |
| 8219 | /* Copy a node from an array into a heap-allocated standalone node. */ |
| 8220 | static void copy_node(const cbm_node_t *src, cbm_node_t *dst) { |
| 8221 | dst->id = src->id; |
| 8222 | dst->project = heap_strdup(src->project); |
| 8223 | dst->label = heap_strdup(src->label); |
| 8224 | dst->name = heap_strdup(src->name); |
| 8225 | dst->qualified_name = heap_strdup(src->qualified_name); |
| 8226 | dst->file_path = heap_strdup(src->file_path); |
| 8227 | dst->start_line = src->start_line; |
| 8228 | dst->end_line = src->end_line; |
| 8229 | dst->properties_json = src->properties_json ? heap_strdup(src->properties_json) : NULL; |
| 8230 | } |
| 8231 | |
| 8232 | /* Build a JSON suggestions response for ambiguous or fuzzy results. */ |
| 8233 | static char *snippet_suggestions(const char *input, cbm_node_t *nodes, int count) { |
no test coverage detected