Files
codebase-memory-mcp/src
Martin Vogel 5b60045c55 fix(cpp): resolve implicit destructor, copy-ctor, and conversion-operator calls
Three C++ constructs invoke a member implicitly with no textual call node, so
the call walk produced nothing for the c-LSP to attach its resolution to
(callable=0, no CALLS edge):

  - delete p;        -> destructor   T::~T
  - T a = b;         -> copy/move ctor T::T
  - if (obj) { ... } -> conversion   T::operator bool

Synthesize a textual call sourced to the enclosing function at each trigger so
the lsp_{destructor,copy_constructor,conversion} resolution binds. The
destructor callee QN embeds the type (T.~T) which is not textually available
from `delete p`, so it joins via the reason gate (c_lsp stashes the operand
text); the other two join by callee short-name (the declared type / the
type-independent operator bool).

Two underlying defects surfaced and are fixed:

  - The conversion check evaluated the type of the `condition_clause` node
    (the `( expr )` wrapper, which has no type) instead of the inner
    expression, so `if (obj)` never resolved obj's type. Unwrap the clause.

  - A conversion operator's `operator_cast` node spans the full
    "operator bool() const" in this grammar (params + cv-qualifiers folded in),
    so the method was indexed under that malformed name and member lookups for
    "operator bool" missed. Add cbm_func_name_node_text to normalize it to
    "operator bool", shared by the defs and unified extractors so the def name
    and call-scope QN agree.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-06-28 09:55:27 +02:00
..