Back to Browse

04 Codeindexer - Function Kinds, Templates & Operator

8 views
May 10, 2026
15:41

In this episode of the Code Indexer series, we move beyond basic function parsing and start handling real C++ complexity. We expand the parser to support: * Function kind detection * Qualified identifiers * Parameter signature extraction * Source span tracking * Template function detection * Forward declarations * Deduplication using function signatures * Operator overload parsing * Friend function handling * Reference and pointer declarator edge cases This video walks through how Tree-sitter actually represents these constructs internally, including why functions like operator shift shift silently disappear when return types use references. We also refactor the parser architecture to avoid duplicated logic and build a cleaner classification pipeline for future extensions. By the end of this video, our code indexer can correctly classify and index complex C++ functions with accurate fully qualified names and semantic kinds. Topics covered: * Tree-sitter C++ AST traversal * function_definition vs function_declarator * qualified_identifier * operator_name * Template detection * Friend declarations * Deduplication strategies * Recursive AST walking * Building scalable code indexing infrastructure 0:00 Introduction and Recap 0:27 Missing constructs: Function Declarators 0:37 Handling Qualified Identifiers 1:03 Friend vs. Method Detection 1:51 Adding Template Function Test Case 2:31 Implementing get_kind logic 4:53 Debugging Qualified Identifier issues 6:26 Template Function Detection Logic 7:34 Handling Friend and Operator Methods 11:43 Deduplication via Function Signatures 12:59 Refactoring Parser Architecture 14:38 Finalizing Operator Name Detection

Download

0 formats

No download links available.

04 Codeindexer - Function Kinds, Templates & Operator | NatokHD