You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: CPP tree-sitter -> .h files parsed with C grammar instead of C++ — classes and methods missing from graph #898
.h header files are dispatched to tree_sitter_c instead of tree_sitter_cpp. This silently drops all C++ constructs (classes, virtual methods, namespaces, templates) during
AST extraction.
Root Causes
Dispatch table maps .h → extract_c instead of extract_cpp
_CPP_CONFIG missing field_declaration in function_types — method declarations in class bodies (e.g. pure virtuals) are skipped
_get_cpp_func_name doesn't handle field_identifier — method names inside class bodies use field_identifier, not identifier
Impact
~500-600 method nodes missing from the graph. Abstract interfaces appear as empty nodes with only a namespace entry.
Proposed Fix
Map .h → extract_cpp (tree_sitter_cpp is a superset of C, safe for mixed codebases)
Add field_declaration to _CPP_CONFIG.function_types with a guard to skip data members
Extend _get_cpp_func_name to recognize field_identifier and unwrapped function_declarator children
.h files remain on the C grammar (routing them to C++ broke Linux-kernel/POSIX-style headers that use class/new as identifiers); .hpp/.hxx/.hh already used C++
Fixed the field_declaration extraction branch — the previous child type filter (field_declarator) doesn't exist in tree-sitter-cpp's AST so the block was a no-op; now uses children_by_field_name("declarator") which correctly handles int x, y; (multiple declarators) and static const int MAX = 100; (init_declarator)
Extended _get_cpp_func_name to handle field_identifier, destructor_name, and operator_name node types
Activity
safishamsi commentedon May 16, 2026
Fixed in v0.8.7.
Three changes:
.hfiles remain on the C grammar (routing them to C++ broke Linux-kernel/POSIX-style headers that useclass/newas identifiers);.hpp/.hxx/.hhalready used C++field_declarationextraction branch — the previous child type filter (field_declarator) doesn't exist in tree-sitter-cpp's AST so the block was a no-op; now useschildren_by_field_name("declarator")which correctly handlesint x, y;(multiple declarators) andstatic const int MAX = 100;(init_declarator)_get_cpp_func_nameto handlefield_identifier,destructor_name, andoperator_namenode typesfix #898 #895 #899: C++ header extraction, dedup cross-file merge, in…
fix review findings from #898 #895 #899 corrections
diwanmail commentedon May 16, 2026
Will this change fix c++ . Lh header files with virtual methods?
fix Graphify-Labs#898 Graphify-Labs#895 Graphify-Labs#899: C++ header…
fix review findings from Graphify-Labs#898 Graphify-Labs#895 Graphify…
fix Graphify-Labs#898 Graphify-Labs#895 Graphify-Labs#899: C++ header…
fix review findings from Graphify-Labs#898 Graphify-Labs#895 Graphify…