code-graph-rag 0.0.209__tar.gz → 0.0.246__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {code_graph_rag-0.0.209/code_graph_rag.egg-info → code_graph_rag-0.0.246}/PKG-INFO +1 -1
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/README.md +4 -2
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246/code_graph_rag.egg-info}/PKG-INFO +1 -1
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/code_graph_rag.egg-info/SOURCES.txt +2 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/cli.py +24 -4
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/cli_help.py +5 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/config.py +29 -3
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/constants.py +264 -2
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/cypher_queries.py +64 -5
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/graph_updater.py +4 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/language_spec.py +27 -9
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/logs.py +2 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/main.py +11 -7
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parser_loader.py +16 -2
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/call_processor.py +821 -44
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/call_resolver.py +396 -15
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/class_ingest/mixin.py +73 -12
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/cpp/type_inference.py +41 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/cpp/utils.py +51 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/definition_processor.py +9 -4
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/factory.py +1 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/function_ingest.py +61 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/go/__init__.py +3 -0
- code_graph_rag-0.0.246/codebase_rag/parsers/go/module_paths.py +65 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/go/type_inference.py +97 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/handlers/registry.py +1 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/import_processor.py +163 -78
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/js_ts/ingest.py +28 -1
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/js_ts/type_inference.py +4 -6
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/py/ast_analyzer.py +5 -1
- code_graph_rag-0.0.246/codebase_rag/parsers/rs/__init__.py +3 -0
- code_graph_rag-0.0.246/codebase_rag/parsers/rs/type_inference.py +314 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/rs/utils.py +45 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/stdlib_extractor.py +5 -1
- code_graph_rag-0.0.246/codebase_rag/parsers/type_inference.py +410 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/utils.py +2 -2
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/prompts.py +62 -4
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/services/llm.py +5 -5
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/types_defs.py +1 -1
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/pyproject.toml +1 -1
- code_graph_rag-0.0.209/codebase_rag/parsers/type_inference.py +0 -229
- code_graph_rag-0.0.209/codec/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/LICENSE +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/PYPI_README.md +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/cgr/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/code_graph_rag.egg-info/dependency_links.txt +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/code_graph_rag.egg-info/entry_points.txt +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/code_graph_rag.egg-info/requires.txt +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/code_graph_rag.egg-info/top_level.txt +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/cgr_state.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/decorators.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/docker-compose.yaml +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/embedder.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/exceptions.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/graph_loader.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/mcp/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/mcp/client.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/mcp/server.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/mcp/tools.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/models.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/class_ingest/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/class_ingest/cpp_modules.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/class_ingest/identity.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/class_ingest/method_override.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/class_ingest/node_type.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/class_ingest/parent_extraction.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/class_ingest/relationships.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/class_ingest/utils.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/cpp/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/cpp_frontend/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/cpp_frontend/constants.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/cpp_frontend/frontend.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/cpp_frontend/qn.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/dependency_parser.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/export_detection.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/go/utils.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/handlers/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/handlers/base.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/handlers/cpp.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/handlers/java.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/handlers/js_ts.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/handlers/lua.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/handlers/php.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/handlers/protocol.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/handlers/python.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/handlers/rust.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/java/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/java/method_resolver.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/java/type_inference.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/java/type_resolver.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/java/utils.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/java/variable_analyzer.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/js_ts/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/js_ts/module_system.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/js_ts/utils.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/lua/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/lua/type_inference.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/lua/utils.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/py/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/py/expression_analyzer.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/py/type_inference.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/py/utils.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/py/variable_analyzer.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/python_source_roots.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/parsers/structure_processor.py +0 -0
- {code_graph_rag-0.0.209/codebase_rag/parsers/rs → code_graph_rag-0.0.246/codebase_rag/providers}/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/providers/base.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/providers/litellm.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/readme_sections.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/schema_builder.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/schemas.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/services/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/services/anthropic_token_counter.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/services/graph_service.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/services/protobuf_service.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/stack/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/stack/cli.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/stack/constants.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/stack/health.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/stack/manager.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tool_errors.py +0 -0
- {code_graph_rag-0.0.209/codebase_rag/providers → code_graph_rag-0.0.246/codebase_rag/tools}/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tools/code_retrieval.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tools/codebase_query.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tools/directory_lister.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tools/file_editor.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tools/file_reader.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tools/file_writer.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tools/health_checker.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tools/language.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tools/semantic_search.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tools/shell_command.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/tools/tool_descriptions.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/unixcoder.py +0 -0
- {code_graph_rag-0.0.209/codebase_rag/tools → code_graph_rag-0.0.246/codebase_rag/utils}/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/utils/dependencies.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/utils/fqn_resolver.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/utils/path_utils.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/utils/rich_markdown.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/utils/source_extraction.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/utils/token_utils.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/vector_store.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/workspaces/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/workspaces/cli.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/workspaces/constants.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/workspaces/models.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codebase_rag/workspaces/storage.py +0 -0
- {code_graph_rag-0.0.209/codebase_rag/utils → code_graph_rag-0.0.246/codec}/__init__.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codec/schema_pb2.py +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/codec/schema_pb2.pyi +0 -0
- {code_graph_rag-0.0.209 → code_graph_rag-0.0.246}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-graph-rag
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.246
|
|
4
4
|
Summary: The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Keywords: rag,retrieval-augmented-generation,knowledge-graph,code-analysis,tree-sitter,mcp,mcp-server,llm,graph-database,semantic-search,codebase,memgraph,developer-tools,monorepo
|
|
@@ -82,7 +82,8 @@ An accurate Retrieval-Augmented Generation (RAG) system that analyzes multi-lang
|
|
|
82
82
|
| PHP | Fully Supported | .php | ✓ | ✓ | ✓ | - | Classes, interfaces, traits, enums, namespaces, PHP 8 attributes |
|
|
83
83
|
| Python | Fully Supported | .py | ✓ | ✓ | ✓ | ✓ | Type inference, decorators, nested functions |
|
|
84
84
|
| Rust | Fully Supported | .rs | ✓ | ✓ | ✓ | ✓ | impl blocks, associated functions |
|
|
85
|
-
| TypeScript | Fully Supported | .
|
|
85
|
+
| TypeScript (TSX) | Fully Supported | .tsx | ✓ | ✓ | ✓ | - | All TypeScript features plus JSX elements and components |
|
|
86
|
+
| TypeScript | Fully Supported | .ts | ✓ | ✓ | ✓ | - | Interfaces, type aliases, enums, namespaces, ES6/CommonJS modules |
|
|
86
87
|
| Go | In Development | .go | ✓ | ✓ | ✓ | - | Methods, type declarations |
|
|
87
88
|
| Scala | In Development | .scala, .sc | ✓ | ✓ | ✓ | - | Case classes, objects |
|
|
88
89
|
<!-- /SECTION:supported_languages -->
|
|
@@ -689,6 +690,7 @@ The knowledge graph uses the following node types and relationships:
|
|
|
689
690
|
- **PHP**: `anonymous_function`, `arrow_function`, `class_declaration`, `enum_declaration`, `function_definition`, `interface_declaration`, `method_declaration`, `trait_declaration`
|
|
690
691
|
- **Python**: `class_definition`, `function_definition`
|
|
691
692
|
- **Rust**: `closure_expression`, `enum_item`, `function_item`, `function_signature_item`, `impl_item`, `struct_item`, `trait_item`, `type_item`, `union_item`
|
|
693
|
+
- **TypeScript (TSX)**: `abstract_class_declaration`, `arrow_function`, `class`, `class_declaration`, `enum_declaration`, `function_declaration`, `function_expression`, `function_signature`, `generator_function_declaration`, `interface_declaration`, `internal_module`, `method_definition`, `type_alias_declaration`
|
|
692
694
|
- **TypeScript**: `abstract_class_declaration`, `arrow_function`, `class`, `class_declaration`, `enum_declaration`, `function_declaration`, `function_expression`, `function_signature`, `generator_function_declaration`, `interface_declaration`, `internal_module`, `method_definition`, `type_alias_declaration`
|
|
693
695
|
- **Go**: `function_declaration`, `method_declaration`, `type_alias`, `type_spec`
|
|
694
696
|
- **Scala**: `class_definition`, `function_declaration`, `function_definition`, `object_definition`, `trait_definition`
|
|
@@ -715,7 +717,7 @@ The knowledge graph uses the following node types and relationships:
|
|
|
715
717
|
| ModuleImplementation | IMPLEMENTS | ModuleInterface |
|
|
716
718
|
| Project | DEPENDS_ON_EXTERNAL | ExternalPackage |
|
|
717
719
|
| Function, Method | CALLS | Function, Method |
|
|
718
|
-
| Module, Function, Method | REFERENCES | Function, Method |
|
|
720
|
+
| Module, Function, Method | REFERENCES | Function, Method, Class |
|
|
719
721
|
| Module, Function, Method | INSTANTIATES | Class |
|
|
720
722
|
<!-- /SECTION:relationship_schemas -->
|
|
721
723
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-graph-rag
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.246
|
|
4
4
|
Summary: The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
Keywords: rag,retrieval-augmented-generation,knowledge-graph,code-analysis,tree-sitter,mcp,mcp-server,llm,graph-database,semantic-search,codebase,memgraph,developer-tools,monorepo
|
|
@@ -70,6 +70,7 @@ codebase_rag/parsers/cpp_frontend/constants.py
|
|
|
70
70
|
codebase_rag/parsers/cpp_frontend/frontend.py
|
|
71
71
|
codebase_rag/parsers/cpp_frontend/qn.py
|
|
72
72
|
codebase_rag/parsers/go/__init__.py
|
|
73
|
+
codebase_rag/parsers/go/module_paths.py
|
|
73
74
|
codebase_rag/parsers/go/type_inference.py
|
|
74
75
|
codebase_rag/parsers/go/utils.py
|
|
75
76
|
codebase_rag/parsers/handlers/__init__.py
|
|
@@ -104,6 +105,7 @@ codebase_rag/parsers/py/type_inference.py
|
|
|
104
105
|
codebase_rag/parsers/py/utils.py
|
|
105
106
|
codebase_rag/parsers/py/variable_analyzer.py
|
|
106
107
|
codebase_rag/parsers/rs/__init__.py
|
|
108
|
+
codebase_rag/parsers/rs/type_inference.py
|
|
107
109
|
codebase_rag/parsers/rs/utils.py
|
|
108
110
|
codebase_rag/providers/__init__.py
|
|
109
111
|
codebase_rag/providers/base.py
|
|
@@ -2,6 +2,7 @@ import asyncio
|
|
|
2
2
|
import json
|
|
3
3
|
import time
|
|
4
4
|
from collections.abc import Callable
|
|
5
|
+
from fnmatch import fnmatch
|
|
5
6
|
from functools import partial
|
|
6
7
|
from importlib.metadata import version as get_version
|
|
7
8
|
from pathlib import Path
|
|
@@ -16,7 +17,7 @@ from . import cgr_state
|
|
|
16
17
|
from . import cli_help as ch
|
|
17
18
|
from . import constants as cs
|
|
18
19
|
from . import logs as ls
|
|
19
|
-
from .config import
|
|
20
|
+
from .config import load_ignore_patterns, settings
|
|
20
21
|
from .graph_updater import GraphUpdater
|
|
21
22
|
from .main import (
|
|
22
23
|
_create_configuration_table,
|
|
@@ -192,7 +193,7 @@ def _run_graph_sync(
|
|
|
192
193
|
clean: bool = False,
|
|
193
194
|
output: str | None = None,
|
|
194
195
|
) -> None:
|
|
195
|
-
cgrignore =
|
|
196
|
+
cgrignore = load_ignore_patterns(repo)
|
|
196
197
|
cli_excludes = frozenset(exclude) if exclude else frozenset()
|
|
197
198
|
exclude_paths = cli_excludes | cgrignore.exclude or None
|
|
198
199
|
unignore_paths: frozenset[str] | None
|
|
@@ -535,7 +536,7 @@ def index(
|
|
|
535
536
|
|
|
536
537
|
_info(style(cs.CLI_MSG_OUTPUT_TO.format(path=output_proto_dir), cs.Color.CYAN))
|
|
537
538
|
|
|
538
|
-
cgrignore =
|
|
539
|
+
cgrignore = load_ignore_patterns(repo_to_index)
|
|
539
540
|
cli_excludes = frozenset(exclude) if exclude else frozenset()
|
|
540
541
|
exclude_paths = cli_excludes | cgrignore.exclude or None
|
|
541
542
|
unignore_paths: frozenset[str] | None = None
|
|
@@ -941,6 +942,22 @@ def _dead_code_params(
|
|
|
941
942
|
}
|
|
942
943
|
|
|
943
944
|
|
|
945
|
+
def _filter_excluded_rows(rows: list[ResultRow], exclude: list[str]) -> list[ResultRow]:
|
|
946
|
+
# (H) Drop candidates whose file path matches an exclude glob (generated dirs
|
|
947
|
+
# (H) like client/core or *.gen.* have no in-repo caller, so every symbol
|
|
948
|
+
# (H) reports as dead). fnmatch treats '*' as spanning '/', so '*client/core*'
|
|
949
|
+
# (H) matches at any depth.
|
|
950
|
+
if not exclude:
|
|
951
|
+
return rows
|
|
952
|
+
return [
|
|
953
|
+
row
|
|
954
|
+
for row in rows
|
|
955
|
+
if not any(
|
|
956
|
+
fnmatch(str(row.get(cs.KEY_PATH) or ""), pattern) for pattern in exclude
|
|
957
|
+
)
|
|
958
|
+
]
|
|
959
|
+
|
|
960
|
+
|
|
944
961
|
def _to_dead_code_row(row: ResultRow) -> DeadCodeRow:
|
|
945
962
|
start = row.get(cs.KEY_START_LINE, 0)
|
|
946
963
|
end = row.get(cs.KEY_END_LINE, 0)
|
|
@@ -1028,6 +1045,7 @@ def dead_code(
|
|
|
1028
1045
|
decorator_root: list[str] = typer.Option(
|
|
1029
1046
|
[], "--decorator-root", help=ch.HELP_DEADCODE_DECORATOR_ROOT
|
|
1030
1047
|
),
|
|
1048
|
+
exclude: list[str] = typer.Option([], "--exclude", help=ch.HELP_DEADCODE_EXCLUDE),
|
|
1031
1049
|
include_tests: bool = typer.Option(
|
|
1032
1050
|
True,
|
|
1033
1051
|
"--include-tests/--no-include-tests",
|
|
@@ -1083,7 +1101,9 @@ def dead_code(
|
|
|
1083
1101
|
app_context.console.print(style(message, cs.Color.RED))
|
|
1084
1102
|
raise typer.Exit(1)
|
|
1085
1103
|
|
|
1086
|
-
candidates = [
|
|
1104
|
+
candidates = [
|
|
1105
|
+
_to_dead_code_row(row) for row in _filter_excluded_rows(rows, exclude)
|
|
1106
|
+
]
|
|
1087
1107
|
_emit_dead_code(candidates, output_format, output, resolved)
|
|
1088
1108
|
|
|
1089
1109
|
if fail_on_found and candidates:
|
|
@@ -191,6 +191,11 @@ HELP_DEADCODE_DECORATOR_ROOT = (
|
|
|
191
191
|
"Treat functions/methods carrying this decorator as reachable roots. "
|
|
192
192
|
"Extends the built-in set (route, task, fixture, command, ...). Repeatable."
|
|
193
193
|
)
|
|
194
|
+
HELP_DEADCODE_EXCLUDE = (
|
|
195
|
+
"Glob matched against a symbol's file path to exclude from the report "
|
|
196
|
+
"(e.g. '*client/core*', '*.gen.*' for generated code). '*' spans '/'. "
|
|
197
|
+
"Repeatable."
|
|
198
|
+
)
|
|
194
199
|
HELP_DEADCODE_INCLUDE_TESTS = (
|
|
195
200
|
"Treat test code as reachable roots so production code it exercises is "
|
|
196
201
|
"not reported. On by default."
|
|
@@ -360,13 +360,13 @@ class AppConfig(BaseSettings):
|
|
|
360
360
|
settings = AppConfig()
|
|
361
361
|
|
|
362
362
|
CGRIGNORE_FILENAME = ".cgrignore"
|
|
363
|
+
GITIGNORE_FILENAME = ".gitignore"
|
|
363
364
|
|
|
364
365
|
|
|
365
366
|
EMPTY_CGRIGNORE = CgrignorePatterns(exclude=frozenset(), unignore=frozenset())
|
|
366
367
|
|
|
367
368
|
|
|
368
|
-
def
|
|
369
|
-
ignore_file = repo_path / CGRIGNORE_FILENAME
|
|
369
|
+
def _load_ignore_file(ignore_file: Path) -> CgrignorePatterns:
|
|
370
370
|
if not ignore_file.is_file():
|
|
371
371
|
return EMPTY_CGRIGNORE
|
|
372
372
|
|
|
@@ -394,11 +394,37 @@ def load_cgrignore_patterns(repo_path: Path) -> CgrignorePatterns:
|
|
|
394
394
|
exclude=frozenset(exclude),
|
|
395
395
|
unignore=frozenset(unignore),
|
|
396
396
|
)
|
|
397
|
-
except OSError as e:
|
|
397
|
+
except (OSError, ValueError) as e:
|
|
398
398
|
logger.warning(logs.CGRIGNORE_READ_FAILED.format(path=ignore_file, error=e))
|
|
399
399
|
return EMPTY_CGRIGNORE
|
|
400
400
|
|
|
401
401
|
|
|
402
|
+
def load_cgrignore_patterns(repo_path: Path) -> CgrignorePatterns:
|
|
403
|
+
return _load_ignore_file(repo_path / CGRIGNORE_FILENAME)
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
def load_ignore_patterns(repo_path: Path) -> CgrignorePatterns:
|
|
407
|
+
# (H) Merged exclude/unignore set for indexing: root .gitignore (gitignored
|
|
408
|
+
# (H) paths are build artifacts / generated output whose symbols pollute the
|
|
409
|
+
# (H) graph and the dead-code report) plus .cgrignore, which stays the
|
|
410
|
+
# (H) authoritative cgr-specific channel. The runtime skip check gives
|
|
411
|
+
# (H) excludes precedence over unignores, so a negation can only override a
|
|
412
|
+
# (H) .gitignore exclude by CANCELLING the exact same pattern string here at
|
|
413
|
+
# (H) load time (`!generated/` drops `generated/`). .cgrignore excludes are
|
|
414
|
+
# (H) never cancelled by .gitignore negations.
|
|
415
|
+
# (H) ponytail: root .gitignore only, exact-string cancellation only; a
|
|
416
|
+
# (H) finer-grained negation (`!dist/keep.py` under excluded `dist/`) still
|
|
417
|
+
# (H) cannot rescue -- an ordered PathSpec soft layer in should_skip_path is
|
|
418
|
+
# (H) the upgrade path if real repos need it.
|
|
419
|
+
cgr = _load_ignore_file(repo_path / CGRIGNORE_FILENAME)
|
|
420
|
+
git = _load_ignore_file(repo_path / GITIGNORE_FILENAME)
|
|
421
|
+
negations = cgr.unignore | git.unignore
|
|
422
|
+
return CgrignorePatterns(
|
|
423
|
+
exclude=cgr.exclude | (git.exclude - negations),
|
|
424
|
+
unignore=negations,
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
|
|
402
428
|
CGR_INSTRUCTIONS_FILENAME = ".cgr.md"
|
|
403
429
|
GLOBAL_CGR_INSTRUCTIONS_PATH = Path.home() / CGR_INSTRUCTIONS_FILENAME
|
|
404
430
|
|
|
@@ -101,7 +101,8 @@ EXT_LUA = ".lua"
|
|
|
101
101
|
# (H) File extension tuples by language
|
|
102
102
|
PY_EXTENSIONS = (EXT_PY,)
|
|
103
103
|
JS_EXTENSIONS = (EXT_JS, EXT_JSX)
|
|
104
|
-
TS_EXTENSIONS = (EXT_TS,
|
|
104
|
+
TS_EXTENSIONS = (EXT_TS,)
|
|
105
|
+
TSX_EXTENSIONS = (EXT_TSX,)
|
|
105
106
|
RS_EXTENSIONS = (EXT_RS,)
|
|
106
107
|
GO_EXTENSIONS = (EXT_GO,)
|
|
107
108
|
SCALA_EXTENSIONS = (EXT_SCALA, EXT_SC)
|
|
@@ -122,6 +123,13 @@ CPP_EXTENSIONS = (
|
|
|
122
123
|
PHP_EXTENSIONS = (EXT_PHP,)
|
|
123
124
|
LUA_EXTENSIONS = (EXT_LUA,)
|
|
124
125
|
|
|
126
|
+
# (H) A C++ operator overload / user-defined literal is defined with the reserved
|
|
127
|
+
# (H) `operator` keyword heading the name (`operator==`, `operator[]`, `operator""_json`).
|
|
128
|
+
# (H) It is invoked by operator/literal syntax, not a named call, so it is a dead-code
|
|
129
|
+
# (H) reachability root; the keyword can only head such definitions, so this prefix on a
|
|
130
|
+
# (H) C++ file uniquely identifies them (member or free function).
|
|
131
|
+
CPP_OPERATOR_PREFIX = "operator"
|
|
132
|
+
|
|
125
133
|
# (H) Package indicator files
|
|
126
134
|
PKG_INIT_PY = "__init__.py"
|
|
127
135
|
PKG_CARGO_TOML = "Cargo.toml"
|
|
@@ -414,6 +422,12 @@ TSCONFIG_FILENAMES: tuple[str, ...] = (
|
|
|
414
422
|
"tsconfig.base.json",
|
|
415
423
|
"jsconfig.json",
|
|
416
424
|
)
|
|
425
|
+
# (H) When searching subdirectories for tsconfig files (monorepo `frontend/`,
|
|
426
|
+
# (H) `packages/*`), skip dependency/build/VCS trees: their tsconfigs carry
|
|
427
|
+
# (H) unrelated aliases and there can be thousands of them under node_modules.
|
|
428
|
+
TS_ALIAS_SKIP_DIRS: frozenset[str] = frozenset(
|
|
429
|
+
{"node_modules", "dist", "build", "out", ".git"}
|
|
430
|
+
)
|
|
417
431
|
JS_INDEX_STEM = "index"
|
|
418
432
|
TS_COMPILER_OPTIONS_KEY = "compilerOptions"
|
|
419
433
|
TS_PATHS_KEY = "paths"
|
|
@@ -472,10 +486,85 @@ DEFAULT_ROOT_DECORATORS: frozenset[str] = frozenset(
|
|
|
472
486
|
"root_validator",
|
|
473
487
|
"field_serializer",
|
|
474
488
|
"model_serializer",
|
|
489
|
+
"computed_field",
|
|
475
490
|
"abstractmethod",
|
|
476
491
|
}
|
|
477
492
|
)
|
|
478
493
|
|
|
494
|
+
# (H) Go functions the runtime invokes with no explicit call site: `func init()`
|
|
495
|
+
# (H) runs at package load (any number per package), `func main()` is the program
|
|
496
|
+
# (H) entry. Both are reachability roots (like Python dunders), gated by the .go
|
|
497
|
+
# (H) extension so same-named symbols in other languages are unaffected.
|
|
498
|
+
GO_ROOT_FUNCTION_NAMES: frozenset[str] = frozenset({"init", "main"})
|
|
499
|
+
|
|
500
|
+
# (H) Rust `fn main()` is the binary entry point, invoked by the runtime with no
|
|
501
|
+
# (H) call site -- a reachability root (gated by .rs).
|
|
502
|
+
RUST_ROOT_FUNCTION_NAMES: frozenset[str] = frozenset({"main"})
|
|
503
|
+
|
|
504
|
+
# (H) Rust trait-impl methods the language/std dispatches implicitly (Display::fmt
|
|
505
|
+
# (H) via format!, PartialEq::eq via ==, Iterator::next via for, operator traits,
|
|
506
|
+
# (H) Drop::drop, serde, ...), never through an explicit call the graph can see.
|
|
507
|
+
# (H) Rooting them by name (gated by .rs) mirrors the Python-dunder exemption: these
|
|
508
|
+
# (H) names are conventionally reserved for trait impls, so a same-named user method
|
|
509
|
+
# (H) that is genuinely dead is under-reported rather than mis-reported.
|
|
510
|
+
RUST_TRAIT_METHOD_NAMES: frozenset[str] = frozenset(
|
|
511
|
+
{
|
|
512
|
+
"fmt",
|
|
513
|
+
"eq",
|
|
514
|
+
"ne",
|
|
515
|
+
"cmp",
|
|
516
|
+
"partial_cmp",
|
|
517
|
+
"hash",
|
|
518
|
+
"next",
|
|
519
|
+
"next_back",
|
|
520
|
+
"into_iter",
|
|
521
|
+
"size_hint",
|
|
522
|
+
"drop",
|
|
523
|
+
"clone",
|
|
524
|
+
"clone_from",
|
|
525
|
+
"default",
|
|
526
|
+
"from",
|
|
527
|
+
"from_str",
|
|
528
|
+
"try_from",
|
|
529
|
+
"into",
|
|
530
|
+
"try_into",
|
|
531
|
+
"deref",
|
|
532
|
+
"deref_mut",
|
|
533
|
+
"as_ref",
|
|
534
|
+
"as_mut",
|
|
535
|
+
"borrow",
|
|
536
|
+
"borrow_mut",
|
|
537
|
+
"poll",
|
|
538
|
+
"serialize",
|
|
539
|
+
"deserialize",
|
|
540
|
+
"source",
|
|
541
|
+
"add",
|
|
542
|
+
"add_assign",
|
|
543
|
+
"sub",
|
|
544
|
+
"sub_assign",
|
|
545
|
+
"mul",
|
|
546
|
+
"mul_assign",
|
|
547
|
+
"div",
|
|
548
|
+
"div_assign",
|
|
549
|
+
"rem",
|
|
550
|
+
"rem_assign",
|
|
551
|
+
"neg",
|
|
552
|
+
"not",
|
|
553
|
+
"bitand",
|
|
554
|
+
"bitand_assign",
|
|
555
|
+
"bitor",
|
|
556
|
+
"bitor_assign",
|
|
557
|
+
"bitxor",
|
|
558
|
+
"bitxor_assign",
|
|
559
|
+
"shl",
|
|
560
|
+
"shl_assign",
|
|
561
|
+
"shr",
|
|
562
|
+
"shr_assign",
|
|
563
|
+
"index",
|
|
564
|
+
"index_mut",
|
|
565
|
+
}
|
|
566
|
+
)
|
|
567
|
+
|
|
479
568
|
# (H) Base classes that mark a class as a structural interface: its method stubs
|
|
480
569
|
# (H) are never call targets themselves (callers resolve to the implementations),
|
|
481
570
|
# (H) so dead-code analysis roots every method the class defines.
|
|
@@ -623,6 +712,7 @@ class SupportedLanguage(StrEnum):
|
|
|
623
712
|
PYTHON = "python"
|
|
624
713
|
JS = "javascript"
|
|
625
714
|
TS = "typescript"
|
|
715
|
+
TSX = "tsx"
|
|
626
716
|
RUST = "rust"
|
|
627
717
|
GO = "go"
|
|
628
718
|
SCALA = "scala"
|
|
@@ -660,6 +750,11 @@ LANGUAGE_METADATA: dict[SupportedLanguage, LanguageMetadata] = {
|
|
|
660
750
|
"Interfaces, type aliases, enums, namespaces, ES6/CommonJS modules",
|
|
661
751
|
"TypeScript",
|
|
662
752
|
),
|
|
753
|
+
SupportedLanguage.TSX: LanguageMetadata(
|
|
754
|
+
LanguageStatus.FULL,
|
|
755
|
+
"All TypeScript features plus JSX elements and components",
|
|
756
|
+
"TypeScript (TSX)",
|
|
757
|
+
),
|
|
663
758
|
SupportedLanguage.C: LanguageMetadata(
|
|
664
759
|
LanguageStatus.FULL,
|
|
665
760
|
"Functions, structs, unions, enums, preprocessor includes",
|
|
@@ -754,7 +849,9 @@ JS_TS_FUNCTION_NODES = (
|
|
|
754
849
|
)
|
|
755
850
|
JS_TS_CLASS_NODES = ("class_declaration", "class")
|
|
756
851
|
JS_TS_IMPORT_NODES = ("import_statement", "lexical_declaration", "export_statement")
|
|
757
|
-
JS_TS_LANGUAGES = frozenset(
|
|
852
|
+
JS_TS_LANGUAGES = frozenset(
|
|
853
|
+
{SupportedLanguage.JS, SupportedLanguage.TS, SupportedLanguage.TSX}
|
|
854
|
+
)
|
|
758
855
|
|
|
759
856
|
# (H) C++ import node types
|
|
760
857
|
CPP_IMPORT_NODES = ("preproc_include", "template_function", "declaration")
|
|
@@ -781,6 +878,8 @@ FIELD_DECLARATOR = "declarator"
|
|
|
781
878
|
FIELD_PARAMETERS = "parameters"
|
|
782
879
|
FIELD_RECEIVER = "receiver"
|
|
783
880
|
FIELD_TYPE = "type"
|
|
881
|
+
# (H) The wrapped function/class inside a Python decorated_definition node.
|
|
882
|
+
FIELD_DEFINITION = "definition"
|
|
784
883
|
FIELD_RESULT = "result"
|
|
785
884
|
# (H) Rust impl `trait`/`type` fields and a trait's supertrait `bounds`.
|
|
786
885
|
FIELD_TRAIT = "trait"
|
|
@@ -790,6 +889,7 @@ FIELD_VALUE = "value"
|
|
|
790
889
|
FIELD_LEFT = "left"
|
|
791
890
|
FIELD_RIGHT = "right"
|
|
792
891
|
FIELD_FIELD = "field"
|
|
892
|
+
FIELD_SCOPE = "scope"
|
|
793
893
|
FIELD_SUPERCLASS = "superclass"
|
|
794
894
|
FIELD_SUPERCLASSES = "superclasses"
|
|
795
895
|
FIELD_INTERFACES = "interfaces"
|
|
@@ -1008,6 +1108,7 @@ BUILD_EXT_CMD = "build_ext"
|
|
|
1008
1108
|
INPLACE_FLAG = "--inplace"
|
|
1009
1109
|
LANG_ATTR_PREFIX = "language_"
|
|
1010
1110
|
LANG_ATTR_TYPESCRIPT = "language_typescript"
|
|
1111
|
+
LANG_ATTR_TSX = "language_tsx"
|
|
1011
1112
|
LANG_ATTR_PHP = "language_php"
|
|
1012
1113
|
|
|
1013
1114
|
|
|
@@ -1253,6 +1354,7 @@ PYINSTALLER_ARG_COLLECT_ALL = "--collect-all"
|
|
|
1253
1354
|
PYINSTALLER_ARG_COLLECT_DATA = "--collect-data"
|
|
1254
1355
|
PYINSTALLER_ARG_HIDDEN_IMPORT = "--hidden-import"
|
|
1255
1356
|
PYINSTALLER_ARG_EXCLUDE_MODULE = "--exclude-module"
|
|
1357
|
+
PYINSTALLER_ARG_COPY_METADATA = "--copy-metadata"
|
|
1256
1358
|
PYINSTALLER_ENTRY_POINT = "main.py"
|
|
1257
1359
|
|
|
1258
1360
|
PYINSTALLER_EXCLUDED_MODULES = ["logfire"]
|
|
@@ -1655,6 +1757,13 @@ JS_FUNCTION_PROTOTYPE_SUFFIXES: dict[str, str] = {
|
|
|
1655
1757
|
JS_SUFFIX_CALL: JS_METHOD_CALL,
|
|
1656
1758
|
JS_SUFFIX_APPLY: JS_METHOD_APPLY,
|
|
1657
1759
|
}
|
|
1760
|
+
# (H) `fn.bind(ctx)` / `fn.call(...)` / `fn.apply(...)` all use `fn`; when such a
|
|
1761
|
+
# (H) call sits in a value position (`onError: handleError.bind(toast)`) the `.bind`
|
|
1762
|
+
# (H) resolves to the Function.prototype builtin, so `fn` itself must be referenced
|
|
1763
|
+
# (H) separately or it reports as dead.
|
|
1764
|
+
JS_FUNCTION_PROTOTYPE_METHODS = frozenset(
|
|
1765
|
+
{JS_METHOD_BIND, JS_METHOD_CALL, JS_METHOD_APPLY}
|
|
1766
|
+
)
|
|
1658
1767
|
|
|
1659
1768
|
# (H) C++ operator mappings
|
|
1660
1769
|
CPP_OPERATORS: dict[str, str] = {
|
|
@@ -2003,6 +2112,11 @@ DEP_FILE_REQUIREMENTS = "requirements.txt"
|
|
|
2003
2112
|
DEP_FILE_PACKAGE_JSON = "package.json"
|
|
2004
2113
|
DEP_FILE_CARGO = "cargo.toml"
|
|
2005
2114
|
DEP_FILE_GOMOD = "go.mod"
|
|
2115
|
+
# (H) The go.mod directive naming the module path that prefixes every import of
|
|
2116
|
+
# (H) the module's packages; a same-line comment (incl. the official
|
|
2117
|
+
# (H) `// Deprecated:` form) may trail it.
|
|
2118
|
+
GO_KEYWORD_MODULE = "module"
|
|
2119
|
+
GO_MOD_COMMENT_PREFIX = "//"
|
|
2006
2120
|
DEP_FILE_GEMFILE = "gemfile"
|
|
2007
2121
|
DEP_FILE_COMPOSER = "composer.json"
|
|
2008
2122
|
|
|
@@ -2126,6 +2240,10 @@ TS_GO_TYPE_DECLARATION = "type_declaration"
|
|
|
2126
2240
|
TS_GO_TYPE_SPEC = "type_spec"
|
|
2127
2241
|
TS_GO_TYPE_ALIAS = "type_alias"
|
|
2128
2242
|
TS_GO_STRUCT_TYPE = "struct_type"
|
|
2243
|
+
TS_GO_SELECTOR_EXPRESSION = "selector_expression"
|
|
2244
|
+
TS_GO_FIELD_DECLARATION_LIST = "field_declaration_list"
|
|
2245
|
+
TS_GO_FIELD_DECLARATION = "field_declaration"
|
|
2246
|
+
TS_GO_FIELD_IDENTIFIER = "field_identifier"
|
|
2129
2247
|
TS_GO_INTERFACE_TYPE = "interface_type"
|
|
2130
2248
|
TS_GO_PARAMETER_DECLARATION = "parameter_declaration"
|
|
2131
2249
|
TS_GO_FUNC_LITERAL = "func_literal"
|
|
@@ -2138,8 +2256,12 @@ TS_GO_PARAMETER_LIST = "parameter_list"
|
|
|
2138
2256
|
TS_GO_VAR_DECLARATION = "var_declaration"
|
|
2139
2257
|
TS_GO_VAR_SPEC = "var_spec"
|
|
2140
2258
|
TS_GO_SHORT_VAR_DECLARATION = "short_var_declaration"
|
|
2259
|
+
TS_GO_ASSIGNMENT_STATEMENT = "assignment_statement"
|
|
2141
2260
|
TS_GO_EXPRESSION_LIST = "expression_list"
|
|
2142
2261
|
TS_GO_COMPOSITE_LITERAL = "composite_literal"
|
|
2262
|
+
TS_GO_LITERAL_VALUE = "literal_value"
|
|
2263
|
+
TS_GO_KEYED_ELEMENT = "keyed_element"
|
|
2264
|
+
TS_GO_LITERAL_ELEMENT = "literal_element"
|
|
2143
2265
|
TS_GO_UNARY_EXPRESSION = "unary_expression"
|
|
2144
2266
|
TS_GO_POINTER_TYPE = "pointer_type"
|
|
2145
2267
|
# (H) Go composite types a method may return; a chained call lands on the CONTAINER,
|
|
@@ -2214,6 +2336,18 @@ TS_CPP_FUNCTION_DEFINITION = "function_definition"
|
|
|
2214
2336
|
TS_CPP_DECLARATION = "declaration"
|
|
2215
2337
|
TS_CPP_FIELD_DECLARATION = "field_declaration"
|
|
2216
2338
|
TS_CPP_TEMPLATE_DECLARATION = "template_declaration"
|
|
2339
|
+
TS_CPP_TEMPLATE_PARAMETER_LIST = "template_parameter_list"
|
|
2340
|
+
# (H) The template TYPE-parameter declaration node types. A value/non-type param
|
|
2341
|
+
# (H) (`parameter_declaration`, e.g. `int N` / `MyEnum E`) and a template-template param
|
|
2342
|
+
# (H) are deliberately excluded: their type name is a concrete type, not a stand-in that
|
|
2343
|
+
# (H) a call receiver could be instantiated as, so it must not enter the template-param set.
|
|
2344
|
+
CPP_TYPE_PARAMETER_DECL_TYPES = frozenset(
|
|
2345
|
+
{
|
|
2346
|
+
"type_parameter_declaration",
|
|
2347
|
+
"optional_type_parameter_declaration",
|
|
2348
|
+
"variadic_type_parameter_declaration",
|
|
2349
|
+
}
|
|
2350
|
+
)
|
|
2217
2351
|
TS_CPP_LAMBDA_EXPRESSION = "lambda_expression"
|
|
2218
2352
|
TS_CPP_TRANSLATION_UNIT = "translation_unit"
|
|
2219
2353
|
TS_CPP_LINKAGE_SPECIFICATION = "linkage_specification"
|
|
@@ -2275,6 +2409,15 @@ CPP_NESTED_SCOPE_NODE_TYPES = frozenset(
|
|
|
2275
2409
|
)
|
|
2276
2410
|
)
|
|
2277
2411
|
JS_TS_PARENT_REF_TYPES = (TS_IDENTIFIER, TS_MEMBER_EXPRESSION)
|
|
2412
|
+
# (H) JSX element nodes that carry a component name (javascript and tsx
|
|
2413
|
+
# (H) grammars share these); the closing element repeats the name and must not
|
|
2414
|
+
# (H) double-emit.
|
|
2415
|
+
TS_JSX_SELF_CLOSING_ELEMENT = "jsx_self_closing_element"
|
|
2416
|
+
TS_JSX_OPENING_ELEMENT = "jsx_opening_element"
|
|
2417
|
+
# (H) The `{...}` wrapper around an expression in a JSX attribute value or child
|
|
2418
|
+
# (H) (`onClick={handleLogout}`, `onClick={() => x()}`); its inner expression can
|
|
2419
|
+
# (H) hand a function to the element as a prop.
|
|
2420
|
+
TS_JSX_EXPRESSION = "jsx_expression"
|
|
2278
2421
|
|
|
2279
2422
|
# (H) Import processor function names
|
|
2280
2423
|
IMPORT_REQUIRE = "require"
|
|
@@ -2422,6 +2565,16 @@ TS_SPREAD_PARAMETER = "spread_parameter"
|
|
|
2422
2565
|
TS_LOCAL_VARIABLE_DECLARATION = "local_variable_declaration"
|
|
2423
2566
|
TS_FIELD_DECLARATION = "field_declaration"
|
|
2424
2567
|
TS_ASSIGNMENT_EXPRESSION = "assignment_expression"
|
|
2568
|
+
# (H) TS "cast" wrappers that are transparent for reference resolution: `x as T`,
|
|
2569
|
+
# (H) `x satisfies T`, and the non-null assertion `x!`. Their first named child is
|
|
2570
|
+
# (H) the wrapped value, so unwrapping reaches the real referenced expression
|
|
2571
|
+
# (H) (`export const persist = persistImpl as unknown as Persist`).
|
|
2572
|
+
TS_AS_EXPRESSION = "as_expression"
|
|
2573
|
+
TS_SATISFIES_EXPRESSION = "satisfies_expression"
|
|
2574
|
+
TS_NON_NULL_EXPRESSION = "non_null_expression"
|
|
2575
|
+
TS_CAST_WRAPPER_TYPES = frozenset(
|
|
2576
|
+
{TS_AS_EXPRESSION, TS_SATISFIES_EXPRESSION, TS_NON_NULL_EXPRESSION}
|
|
2577
|
+
)
|
|
2425
2578
|
TS_OBJECT_CREATION_EXPRESSION = "object_creation_expression"
|
|
2426
2579
|
TS_METHOD_INVOCATION = "method_invocation"
|
|
2427
2580
|
TS_FIELD_ACCESS = "field_access"
|
|
@@ -2732,6 +2885,13 @@ GUARD_INHERITED_METHOD = "_inherited_method_guard"
|
|
|
2732
2885
|
TS_PAIR = "pair"
|
|
2733
2886
|
TS_OBJECT = "object"
|
|
2734
2887
|
TS_ARRAY = "array"
|
|
2888
|
+
|
|
2889
|
+
# (H) When a variable_declarator's value is one of these, the variable binds the
|
|
2890
|
+
# (H) call/construction RESULT, not a function -- so an arrow found inside its
|
|
2891
|
+
# (H) arguments (`const m = useMutation({fn: () => {}})`) must not inherit the
|
|
2892
|
+
# (H) variable's name. Object-literal / arrow values are not here, so arrows nested
|
|
2893
|
+
# (H) directly under an object bound to a const still take the object's name.
|
|
2894
|
+
JS_CALL_RESULT_VALUE_TYPES = frozenset({TS_CALL_EXPRESSION, TS_NEW_EXPRESSION})
|
|
2735
2895
|
TS_FUNCTION_EXPRESSION = "function_expression"
|
|
2736
2896
|
TS_ARROW_FUNCTION = "arrow_function"
|
|
2737
2897
|
TS_REQUIRED_PARAMETER = "required_parameter"
|
|
@@ -2928,6 +3088,89 @@ TS_RS_MACRO_INVOCATION = "macro_invocation"
|
|
|
2928
3088
|
TS_RS_ATTRIBUTE_ITEM = "attribute_item"
|
|
2929
3089
|
TS_RS_INNER_ATTRIBUTE_ITEM = "inner_attribute_item"
|
|
2930
3090
|
|
|
3091
|
+
# (H) Rust node types for local-variable type inference (receiver-dispatch)
|
|
3092
|
+
TS_RS_LET_DECLARATION = "let_declaration"
|
|
3093
|
+
TS_RS_PARAMETER = "parameter"
|
|
3094
|
+
TS_RS_SELF_PARAMETER = "self_parameter"
|
|
3095
|
+
TS_RS_STRUCT_EXPRESSION = "struct_expression"
|
|
3096
|
+
TS_RS_FIELD_DECLARATION_LIST = "field_declaration_list"
|
|
3097
|
+
TS_RS_FIELD_DECLARATION = "field_declaration"
|
|
3098
|
+
TS_RS_FIELD_IDENTIFIER = "field_identifier"
|
|
3099
|
+
TS_RS_MATCH_EXPRESSION = "match_expression"
|
|
3100
|
+
TS_RS_MATCH_ARM = "match_arm"
|
|
3101
|
+
# (H) A Rust call node whose callee is descended for chain flattening: a plain call
|
|
3102
|
+
# (H) or a turbofish generic_function (`f::<T>()`).
|
|
3103
|
+
RS_CALL_OR_GENERIC_FN = (TS_RS_CALL_EXPRESSION, TS_GENERIC_FUNCTION)
|
|
3104
|
+
TS_RS_TUPLE_STRUCT_PATTERN = "tuple_struct_pattern"
|
|
3105
|
+
TS_RS_TYPE_ARGUMENTS = "type_arguments"
|
|
3106
|
+
TS_RS_TRY_EXPRESSION = "try_expression"
|
|
3107
|
+
TS_RS_FIELD_EXPRESSION = "field_expression"
|
|
3108
|
+
TS_RS_FIELD_PATH = "path"
|
|
3109
|
+
TS_RS_TOKEN_DOT = "."
|
|
3110
|
+
# (H) Nodes that can be a receiver token preceding `.method` in a macro token
|
|
3111
|
+
# (H) stream: a plain identifier or the `self` keyword.
|
|
3112
|
+
# (H) A receiver/chain base that is a plain identifier or the `self` keyword (used
|
|
3113
|
+
# (H) both for macro-token receiver reconstruction and value-chain base flattening).
|
|
3114
|
+
RS_IDENT_OR_SELF = (TS_IDENTIFIER, KEYWORD_SELF)
|
|
3115
|
+
RS_MACRO_RECEIVER_TYPES = RS_IDENT_OR_SELF
|
|
3116
|
+
# (H) Rust `Self` return type resolves to the enclosing impl target.
|
|
3117
|
+
RS_SELF_TYPE = "Self"
|
|
3118
|
+
# (H) Transparent smart pointers that auto-deref (Rust deref coercion) to their
|
|
3119
|
+
# (H) inner type: a method call on the pointer dispatches to the inner type's method,
|
|
3120
|
+
# (H) so strip them from any type name (receiver OR return) to reach the real type.
|
|
3121
|
+
RS_DEREF_WRAPPERS = frozenset({"Arc", "Rc", "Box", "Pin"})
|
|
3122
|
+
# (H) Guard containers that do NOT deref-coerce: the inner value is only reachable
|
|
3123
|
+
# (H) through a lock/borrow guard accessor. Stripped to the inner type ONLY in field
|
|
3124
|
+
# (H) extraction (where the field is virtually always accessed via a lock chain, e.g.
|
|
3125
|
+
# (H) `self.shared.state.lock().unwrap()`); a bare local/param/return of a guard type
|
|
3126
|
+
# (H) is preserved so a direct wrapper-method call (`m.is_poisoned()`) is not
|
|
3127
|
+
# (H) mis-resolved to an inner-type method.
|
|
3128
|
+
RS_GUARD_WRAPPERS = frozenset({"Mutex", "RwLock", "RefCell", "Cell"})
|
|
3129
|
+
# (H) Result<T>/Option<T>: stripped to their inner T only for a RETURN type (the
|
|
3130
|
+
# (H) value a `?`/`.unwrap()` yields). NOT stripped for a receiver type, where a
|
|
3131
|
+
# (H) method call `opt.map(..)` dispatches to Option itself.
|
|
3132
|
+
RS_RESULT_WRAPPERS = frozenset({"Result", "Option"})
|
|
3133
|
+
# (H) Full strip set for return types (deref pointers + Result/Option unwrap).
|
|
3134
|
+
RS_RETURN_STRIP_WRAPPERS = RS_DEREF_WRAPPERS | RS_RESULT_WRAPPERS
|
|
3135
|
+
TS_RS_REFERENCE_TYPE = "reference_type"
|
|
3136
|
+
TS_RS_POINTER_TYPE = "pointer_type"
|
|
3137
|
+
# (H) Node types that can stand for a Rust return/field type. Reference/pointer
|
|
3138
|
+
# (H) wrappers (`&Frame`, `*const T`) are included so a generic inner argument
|
|
3139
|
+
# (H) (`Result<&Frame>`) and a bare `-> &Frame` return descend to the referent.
|
|
3140
|
+
RS_RETURN_TYPE_NODE_TYPES = (
|
|
3141
|
+
TS_TYPE_IDENTIFIER,
|
|
3142
|
+
TS_RS_PRIMITIVE_TYPE,
|
|
3143
|
+
TS_GENERIC_TYPE,
|
|
3144
|
+
TS_RS_SCOPED_TYPE_IDENTIFIER,
|
|
3145
|
+
TS_RS_REFERENCE_TYPE,
|
|
3146
|
+
TS_RS_POINTER_TYPE,
|
|
3147
|
+
)
|
|
3148
|
+
# (H) Wrapper-passthrough methods: they return the receiver's own (inner) type, so
|
|
3149
|
+
# (H) a call-bound local keeps its type across them (`Type::mk().unwrap().m()`).
|
|
3150
|
+
RS_IDENTITY_METHODS = frozenset(
|
|
3151
|
+
{
|
|
3152
|
+
"unwrap",
|
|
3153
|
+
"expect",
|
|
3154
|
+
"clone",
|
|
3155
|
+
"unwrap_or_default",
|
|
3156
|
+
"to_owned",
|
|
3157
|
+
"borrow",
|
|
3158
|
+
"borrow_mut",
|
|
3159
|
+
"as_ref",
|
|
3160
|
+
"as_mut",
|
|
3161
|
+
"as_deref",
|
|
3162
|
+
"as_deref_mut",
|
|
3163
|
+
}
|
|
3164
|
+
)
|
|
3165
|
+
# (H) Guard accessors: called on a guard container (Mutex/RwLock/RefCell) to obtain a
|
|
3166
|
+
# (H) guard that derefs to the inner type. In a receiver chain, one of these
|
|
3167
|
+
# (H) immediately after a guard-wrapped field unwraps the wrapper to its inner type
|
|
3168
|
+
# (H) (recorded in class_field_guard_inner) -- the only sound unwrap point, since
|
|
3169
|
+
# (H) guard containers do not deref-coerce.
|
|
3170
|
+
RS_GUARD_ACCESSORS = frozenset(
|
|
3171
|
+
{"lock", "read", "write", "try_lock", "borrow", "borrow_mut"}
|
|
3172
|
+
)
|
|
3173
|
+
|
|
2931
3174
|
# (H) Rust identifier tuples
|
|
2932
3175
|
RS_IDENTIFIER_TYPES = (TS_IDENTIFIER, TS_TYPE_IDENTIFIER)
|
|
2933
3176
|
RS_SCOPED_TYPES = (TS_SCOPED_IDENTIFIER, TS_RS_SCOPED_TYPE_IDENTIFIER)
|
|
@@ -3096,6 +3339,25 @@ FQN_TS_FUNCTION_TYPES = (
|
|
|
3096
3339
|
TS_FUNCTION_SIGNATURE,
|
|
3097
3340
|
)
|
|
3098
3341
|
|
|
3342
|
+
# (H) When climbing a nameless arrow's ancestors to find its binding declarator,
|
|
3343
|
+
# (H) crossing one of these means the arrow lives INSIDE another function's body
|
|
3344
|
+
# (H) (a JSX event handler, a `.map()` callback), not directly bound to the outer
|
|
3345
|
+
# (H) const -- so it must not inherit that const's name. Without this stop the inner
|
|
3346
|
+
# (H) arrow becomes `Component.Component`/`utils.getInitials.getInitials`, a
|
|
3347
|
+
# (H) double-segment phantom with no incoming edge (dead-code false positive) that
|
|
3348
|
+
# (H) also steals the enclosing scope from the real inline handler nodes.
|
|
3349
|
+
JS_ARROW_NAME_CLIMB_BOUNDARY = frozenset(
|
|
3350
|
+
{
|
|
3351
|
+
TS_STATEMENT_BLOCK,
|
|
3352
|
+
TS_ARROW_FUNCTION,
|
|
3353
|
+
TS_FUNCTION_DECLARATION,
|
|
3354
|
+
TS_FUNCTION_EXPRESSION,
|
|
3355
|
+
TS_METHOD_DEFINITION,
|
|
3356
|
+
TS_GENERATOR_FUNCTION_DECLARATION,
|
|
3357
|
+
TS_CLASS_BODY,
|
|
3358
|
+
}
|
|
3359
|
+
)
|
|
3360
|
+
|
|
3099
3361
|
# (H) FQN node type tuples for Rust
|
|
3100
3362
|
FQN_RS_SCOPE_TYPES = (
|
|
3101
3363
|
TS_RS_STRUCT_ITEM,
|