Commit b8cdeb2
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- api/analyzers
- c
- tests
- source_files/c
5 files changed
+207
-597
lines changedWhitespace-only changes.
0 commit comments