Skip to content

Add Support for C++ Templates #359

@Shashankss1205

Description

@Shashankss1205
  • Description: A feature for generic programming, allowing functions and classes to operate with any data type.
  • Graphing Strategy: Model as a :Template node, with relationships pointing to specific instantiations.

Implementation Steps

  1. Modify the C++ Parser (.../languages/cpp.py)

    • Add a Tree-sitter query to identify template definitions.
    • Create a _find_templates method.
    • Return the results from parse under the key "templates".
  2. Update the Generic Graph Builder (.../tools/graph_builder.py)

    • In create_schema(), add a uniqueness constraint for the :Template label.
    • In add_file_to_graph(), update item_mappings to include (file_data.get('templates', []), 'Template').
    • (Advanced) A separate step would be required to identify template instantiations and create relationships.

Metadata

Metadata

Assignees

Labels

Hacktoberfest25This issue is created as a part of Hacktoberfest 2025 programgood first issueGood for newcomers

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions