Skip to content

calls_out (cpp/ts/c#): generic calls name<T>( missed; cpp own Class::method( header and Type var(args) counted as calls #3644

Closed

Description

@squid-protocol

Part of #3641. The shapes are validated in docs/self_scan/graph_comparison_ledger.json.

Misses (tree-sitter-only; calls per C3). A template or type-argument list between the name and ( defeats \b(name)\s*\(:

language shape occurrences examples
cpp template_function+generic 154 back_inserter<vector<wstring> >(…), static_cast<int>(…), pair<A,int>(…)
cpp qualified_identifier+generic 118 Object::cast_to<EditorDock>(…)
typescript engine-attributes-to-another-function 130 new Array<ExpressionRef>(), new Set<Property>()

The TypeScript label is misleading: the engine does see the name elsewhere in the file, but it misses this generic call.

Counted but not calls (GitGalaxy-only):

  • cpp qualified_identifier<function_declarator, 793, the largest shape in the ledger. An out-of-class definition's own header VBufStorage_buffer_t::getLineOffsets( is captured as a call to getLineOffsets. Recursion-dropping compares the qualified unit name with the bare callee, so it never matches. Example: cpp/NVDA/storage.cpp:1066.
  • cpp init_declarator<declaration, 51. In EditorProgress progress("…", …) and MutexLock lock(m), the engine captures the variable (progress, lock) as a callee. The constructor called is the type, EditorProgress, per C3.

Fix direction:

  • Compare recursion against the unit's leaf name.
  • Allow a bounded, one-level-nested <…> step before (. Keep a < b (c) comparisons out by requiring < right after the identifier and >( at the end.
  • For Type var(, take the type when an identifier is preceded by a type name at declaration position.

Measure: call_graph_accuracy.py --buckets 3 (cpp today: 87.7% raw precision, 95.6% recall).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-engine

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions