diff --git a/openviking/parse/parsers/constants.py b/openviking/parse/parsers/constants.py index 174df57b99..cb0bf70123 100644 --- a/openviking/parse/parsers/constants.py +++ b/openviking/parse/parsers/constants.py @@ -97,6 +97,7 @@ ".py", ".java", ".cpp", + ".cc", ".c", ".h", ".hpp", diff --git a/tests/parse/test_directory_parser_routing.py b/tests/parse/test_directory_parser_routing.py index 622f772d71..f7ebb6e3a2 100644 --- a/tests/parse/test_directory_parser_routing.py +++ b/tests/parse/test_directory_parser_routing.py @@ -83,6 +83,7 @@ def tmp_all_parsers(tmp_path: Path) -> Path: bundle.zip -> ZipParser code/ app.py -> text-fallback (is_text_file) + engine.cc -> text-fallback main.js -> text-fallback style.css -> text-fallback config/ @@ -112,6 +113,7 @@ def tmp_all_parsers(tmp_path: Path) -> Path: (tmp_path / "code").mkdir() (tmp_path / "code" / "app.py").write_text("print(1)", encoding="utf-8") + (tmp_path / "code" / "engine.cc").write_text("int main() { return 0; }", encoding="utf-8") (tmp_path / "code" / "main.js").write_text("console.log(1)", encoding="utf-8") (tmp_path / "code" / "style.css").write_text("body{}", encoding="utf-8") @@ -166,7 +168,7 @@ class TestParserSelection: # Extensions that are *processable* (via is_text_file) but have no # dedicated parser in the registry – they fall back to TextParser at # parse-time via ``ParserRegistry.parse``. - TEXT_FALLBACK_EXTENSIONS = {".py", ".js", ".css", ".yaml", ".json", ".toml"} + TEXT_FALLBACK_EXTENSIONS = {".py", ".cc", ".js", ".css", ".yaml", ".json", ".toml"} def test_dedicated_parsers_resolve(self, registry: ParserRegistry) -> None: """get_parser_for_file returns the correct class for each extension.""" diff --git a/tests/parse/test_directory_scan.py b/tests/parse/test_directory_scan.py index cd440dca09..3ec2fc66fd 100644 --- a/tests/parse/test_directory_scan.py +++ b/tests/parse/test_directory_scan.py @@ -35,6 +35,7 @@ def tmp_tree(tmp_path: Path) -> Path: # text (code/config, no dedicated parser or text parser only): .py, .yaml (tmp_path / "main.py").write_text("print(1)", encoding="utf-8") + (tmp_path / "engine.cc").write_text("int main() { return 0; }", encoding="utf-8") (tmp_path / "config.yaml").write_text("key: value", encoding="utf-8") # unsupported: unknown extension @@ -136,6 +137,7 @@ def test_processable_includes_code_or_config( result: DirectoryScanResult = scan_directory(tmp_tree, registry=registry, strict=False) processable_rel = [f.rel_path for f in result.processable] assert "main.py" in processable_rel + assert "engine.cc" in processable_rel assert "config.yaml" in processable_rel assert "src/app.py" in processable_rel