Skip to content

Commit b8cdeb2

Browse files
gkorlandCopilot
andcommitted
fix: rewrite C analyzer to follow AbstractAnalyzer interface
The previous implementation bypassed the AbstractAnalyzer interface entirely, using non-existent types (Function, Struct), missing methods (graph.add_function, graph.add_struct), wrong File constructor args, and text/bytes confusion. This rewrite: - Properly extends AbstractAnalyzer with super().__init__() - Implements all required abstract methods (get_entity_label, get_entity_name, get_entity_docstring, get_entity_types, add_symbols, etc.) - Uses self._captures() for correct QueryCursor-based tree-sitter queries - Adds get_include_paths() helper for #include directive extraction - Enables C/H support in source_analyzer.py (uncommented import, added to analyzers dict, LSP setup, and file globbing) - Rewrites test_c_analyzer.py as standalone unit tests (no DB required) - Adds #include directives to test fixture (src.c) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 797706b commit b8cdeb2

File tree

5 files changed

+207
-597
lines changed

5 files changed

+207
-597
lines changed

api/analyzers/c/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)