codegraphcontext 0.5.5__tar.gz → 0.5.7__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.
- {codegraphcontext-0.5.5/src/codegraphcontext.egg-info → codegraphcontext-0.5.7}/PKG-INFO +3 -3
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/README.md +2 -2
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/pyproject.toml +1 -1
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/cli/main.py +12 -6
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/advanced_language_query_tool.py +6 -4
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/code_finder.py +46 -15
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/handlers/analysis_handlers.py +4 -3
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/handlers/indexing_handlers.py +19 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/handlers/management_handlers.py +3 -3
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/scip_pipeline.py +8 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/c.py +34 -7
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/cpp.py +62 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/csharp.py +83 -1
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/javascript.py +68 -4
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/ruby.py +56 -20
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/package_resolver.py +9 -1
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +17 -8
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/report_generator.py +14 -1
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/utils/visualize_graph.py +23 -3
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/server.py +51 -19
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7/src/codegraphcontext.egg-info}/PKG-INFO +3 -3
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/LICENSE +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/MANIFEST.in +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/setup.cfg +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/api/__init__.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/api/app.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/api/auth.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/api/mcp_sse.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/api/router.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/api/schemas.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/cli/cli_helpers.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/cli/config_manager.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/cli/hook_manager.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/cli/project_config.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/cli/registry_commands.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/cli/setup_macos.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/cli/setup_wizard.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/cli/simulator.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/cli/visualizer.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/__init__.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/bundle_registry.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/cgc_bundle.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/cgcignore.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/database.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/database_embedded_kuzu.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/database_falkordb.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/database_falkordb_remote.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/database_kuzu.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/database_ladybug.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/database_nornic.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/falkor_worker.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/graph_query.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/jobs.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/simulator.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/core/watcher.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/prompts.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/server.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/stdlibs.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tool_definitions.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/datasources/__init__.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/datasources/cassandra_ingester.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/datasources/mysql_ingester.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/datasources/redis_ingester.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/graph_builder.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/handlers/query_handlers.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/__init__.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/constants.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/discovery.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/embeddings.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/persistence/__init__.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/persistence/utils.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/persistence/writer.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/pipeline.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/pre_scan.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/resolution/__init__.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/resolution/calls.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/resolution/inheritance.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/resolution/post_resolution.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/sanitize.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/schema.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/schema_contract.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/indexing/vector_resolver.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/css.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/dart.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/elisp.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/elixir.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/go.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/gradle.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/haskell.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/html.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/java.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/kotlin.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/lua.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/maven.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/mybatis.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/perl.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/php.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/python.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/rust.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/scala.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/sfc_common.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/solidity.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/solidity_remappings.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/svelte.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/swift.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/typescript.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/vue.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/dart_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/elisp_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/perl_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/solidity_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/scip_indexer.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/scip_pb2.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/system.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/tree_sitter_parser.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/type_utils.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/utils/cypher_ddl.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/utils/cypher_readonly.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/utils/debug_log.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/utils/gcf_encoder.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/utils/git_utils.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/utils/path_ignore.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/utils/path_sandbox.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/utils/repo_path.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/utils/tool_limits.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/assets/__vite-browser-external-9wXp6ZBx.js +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/assets/function-calls-BtRHrqa2.png +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/assets/graph-total-D1fBAugo.png +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/assets/hero-graph-2voMJp2a.jpg +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/assets/hierarchy-DGADo0YT.png +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/assets/index-C-187lf0.js +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/assets/index-fNAa6jgv.css +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/assets/parser-pyodide.worker-BgsDfaad.js +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/assets/parser.worker-_nvrecvj.js +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/assets/tree-sitter-qKYAACSa.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/cgcIcon.png +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/favicon.ico +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/index.html +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/logo-icon.svg +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/logo.svg +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/placeholder.svg +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/preview-image.png +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/robots.txt +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c_sharp.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-core.js +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-cpp.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-dart.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-go.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-java.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-javascript.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-kotlin.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-perl.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-php.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-python.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-ruby.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-rust.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-swift.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-tsx.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter-typescript.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/tree-sitter.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.js +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.wasm +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext.egg-info/SOURCES.txt +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext.egg-info/dependency_links.txt +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext.egg-info/entry_points.txt +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext.egg-info/requires.txt +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext.egg-info/top_level.txt +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/tests/test_issue_806_fix.py +0 -0
- {codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/tests/test_mcp_sse.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraphcontext
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.7
|
|
4
4
|
Summary: An MCP server that indexes local code into a graph database to provide context to AI assistants.
|
|
5
5
|
Author-email: Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -372,8 +372,8 @@ CodeGraphContext supports multiple graph database backends to suit your environm
|
|
|
372
372
|
| **Platform** | **All (Windows Native, macOS, Linux)** | **All (Windows Native, macOS, Linux)** | Unix-only (Linux/macOS/WSL) | All Platforms |
|
|
373
373
|
| **Use Case** | Desktop, IDE, Local development | Custom research projects | Specialized Unix development | Enterprise, Massive graphs |
|
|
374
374
|
| **Requirement**| `pip install kuzu` | `pip install ladybug` | `pip install falkordblite` | Neo4j Server / Docker / Nornic Cloud |
|
|
375
|
-
| **Speed** | ⚡ Extremely Fast | ⚡ Fast | 🚀 Scalable |
|
|
376
|
-
| **Persistence**| Yes (to disk) | Yes (to disk) | Yes (to disk) |
|
|
375
|
+
| **Speed** | ⚡ Extremely Fast | ⚡ Fast | 🚀 Scalable | 🌐 Network-dependent |
|
|
376
|
+
| **Persistence**| Yes (to disk) | Yes (to disk) | Yes (to disk) | Yes (server-side) |
|
|
377
377
|
|
|
378
378
|
---
|
|
379
379
|
|
|
@@ -274,8 +274,8 @@ CodeGraphContext supports multiple graph database backends to suit your environm
|
|
|
274
274
|
| **Platform** | **All (Windows Native, macOS, Linux)** | **All (Windows Native, macOS, Linux)** | Unix-only (Linux/macOS/WSL) | All Platforms |
|
|
275
275
|
| **Use Case** | Desktop, IDE, Local development | Custom research projects | Specialized Unix development | Enterprise, Massive graphs |
|
|
276
276
|
| **Requirement**| `pip install kuzu` | `pip install ladybug` | `pip install falkordblite` | Neo4j Server / Docker / Nornic Cloud |
|
|
277
|
-
| **Speed** | ⚡ Extremely Fast | ⚡ Fast | 🚀 Scalable |
|
|
278
|
-
| **Persistence**| Yes (to disk) | Yes (to disk) | Yes (to disk) |
|
|
277
|
+
| **Speed** | ⚡ Extremely Fast | ⚡ Fast | 🚀 Scalable | 🌐 Network-dependent |
|
|
278
|
+
| **Persistence**| Yes (to disk) | Yes (to disk) | Yes (to disk) | Yes (server-side) |
|
|
279
279
|
|
|
280
280
|
---
|
|
281
281
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "codegraphcontext"
|
|
3
|
-
version = "0.5.
|
|
3
|
+
version = "0.5.7"
|
|
4
4
|
description = "An MCP server that indexes local code into a graph database to provide context to AI assistants."
|
|
5
5
|
authors = [{ name = "Shashank Shekhar Singh", email = "shashankshekharsingh1205@gmail.com" }]
|
|
6
6
|
readme = "README.md"
|
|
@@ -2830,15 +2830,18 @@ def analyze_complexity(
|
|
|
2830
2830
|
|
|
2831
2831
|
@analyze_app.command("dead-code")
|
|
2832
2832
|
def analyze_dead_code(
|
|
2833
|
-
path: Optional[str] = typer.Argument(None, help="
|
|
2833
|
+
path: Optional[str] = typer.Argument(None, help="Repository path to scope the analysis to"),
|
|
2834
2834
|
exclude_decorators: Optional[str] = typer.Option(None, "--exclude", "-e", help="Comma-separated decorators to exclude"),
|
|
2835
2835
|
context: Optional[str] = typer.Option(None, "--context", "-c", help="Specific context to use"),
|
|
2836
2836
|
):
|
|
2837
2837
|
"""
|
|
2838
|
-
Find potentially unused functions
|
|
2839
|
-
|
|
2838
|
+
Find potentially unused functions.
|
|
2839
|
+
|
|
2840
|
+
Without a path the whole database is scanned, which on a shared graph
|
|
2841
|
+
reports dead code from every indexed repository. Pass a path to scope it.
|
|
2842
|
+
|
|
2840
2843
|
Example:
|
|
2841
|
-
cgc analyze dead-code
|
|
2844
|
+
cgc analyze dead-code .
|
|
2842
2845
|
cgc analyze dead-code --exclude route,task,api
|
|
2843
2846
|
"""
|
|
2844
2847
|
_load_credentials()
|
|
@@ -2849,8 +2852,11 @@ def analyze_dead_code(
|
|
|
2849
2852
|
|
|
2850
2853
|
try:
|
|
2851
2854
|
exclude_list = exclude_decorators.split(',') if exclude_decorators else []
|
|
2852
|
-
|
|
2853
|
-
|
|
2855
|
+
# `path` was accepted and then dropped, so running inside one repository
|
|
2856
|
+
# still reported dead code from every repository in the database.
|
|
2857
|
+
repo_path = Path(path).resolve().as_posix() if path else None
|
|
2858
|
+
results = code_finder.find_dead_code(exclude_list, repo_path=repo_path)
|
|
2859
|
+
|
|
2854
2860
|
unused_funcs = results.get('potentially_unused_functions', [])
|
|
2855
2861
|
|
|
2856
2862
|
if not unused_funcs:
|
|
@@ -82,10 +82,12 @@ class Advanced_language_query:
|
|
|
82
82
|
|
|
83
83
|
if language not in self.TOOLKITS:
|
|
84
84
|
raise ValueError(f"Unsupported language: {language}")
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
try:
|
|
86
|
+
self.toolkit = self.TOOLKITS[language]()
|
|
87
|
+
# Getting the language query
|
|
88
|
+
cypher_query = self.toolkit.get_cypher_query(label)
|
|
89
|
+
except NotImplementedError as exc:
|
|
90
|
+
return {"error": str(exc), "language": language, "query": query}
|
|
89
91
|
try:
|
|
90
92
|
debug_log(f"Executing Cypher query: {cypher_query}")
|
|
91
93
|
with self.db_manager.get_driver().session() as session:
|
|
@@ -14,6 +14,22 @@ logger = logging.getLogger(__name__)
|
|
|
14
14
|
|
|
15
15
|
_MAX_TRAVERSAL_DEPTH = 20
|
|
16
16
|
|
|
17
|
+
# Names that are entry points rather than dead code. Matched on the *whole*
|
|
18
|
+
# name, lowercased. This used to be a substring test (`name CONTAINS 'main'`,
|
|
19
|
+
# `toLower(name) CONTAINS 'entry'`), which silently excluded any function whose
|
|
20
|
+
# name merely contained one of them — `domain_check`, `remainder`,
|
|
21
|
+
# `maintain_index`, `entry_count` — so genuinely unused code was never
|
|
22
|
+
# reported and there was no way to tell.
|
|
23
|
+
_ENTRY_POINT_NAMES = (
|
|
24
|
+
"main",
|
|
25
|
+
"setup",
|
|
26
|
+
"run",
|
|
27
|
+
"application",
|
|
28
|
+
"entry",
|
|
29
|
+
"entrypoint",
|
|
30
|
+
)
|
|
31
|
+
_ENTRY_POINT_NAMES_CYPHER = "[" + ", ".join(f"'{n}'" for n in _ENTRY_POINT_NAMES) + "]"
|
|
32
|
+
|
|
17
33
|
|
|
18
34
|
def _sanitize_depth(depth, default: int = 3) -> int:
|
|
19
35
|
"""Coerce and clamp a traversal depth before interpolating it into Cypher.
|
|
@@ -809,19 +825,16 @@ class CodeFinder:
|
|
|
809
825
|
query = f"""
|
|
810
826
|
MATCH (func:Function)
|
|
811
827
|
WHERE func.is_dependency = false {repo_filter} {func_ignore}
|
|
812
|
-
AND NOT func.name IN
|
|
828
|
+
AND NOT toLower(func.name) IN {_ENTRY_POINT_NAMES_CYPHER}
|
|
813
829
|
AND func.name <> '<module>'
|
|
814
830
|
AND NOT (func.name STARTS WITH '__' AND func.name ENDS WITH '__')
|
|
815
831
|
AND NOT func.name STARTS WITH '_test'
|
|
816
832
|
AND NOT func.name STARTS WITH 'test_'
|
|
817
|
-
AND NOT func.name CONTAINS 'main'
|
|
818
|
-
AND NOT toLower(func.name) CONTAINS 'application'
|
|
819
|
-
AND NOT toLower(func.name) CONTAINS 'entry'
|
|
820
|
-
AND NOT toLower(func.name) CONTAINS 'entrypoint'
|
|
821
833
|
{decorator_filter}
|
|
822
834
|
WITH func
|
|
823
|
-
OPTIONAL MATCH (caller
|
|
824
|
-
WHERE caller.is_dependency = false
|
|
835
|
+
OPTIONAL MATCH (caller)-[:CALLS|HEURISTIC_CALLS]->(func)
|
|
836
|
+
WHERE (caller.is_dependency IS NULL OR caller.is_dependency = false)
|
|
837
|
+
{caller_ignore}
|
|
825
838
|
WITH func, count(caller) as caller_count
|
|
826
839
|
WHERE caller_count = 0
|
|
827
840
|
OPTIONAL MATCH (file:File)-[:CONTAINS]->(func)
|
|
@@ -1211,16 +1224,31 @@ class CodeFinder:
|
|
|
1211
1224
|
try:
|
|
1212
1225
|
if query_type == "find_callers":
|
|
1213
1226
|
results = self.who_calls_function(target, context, repo_path=repo_path)
|
|
1214
|
-
#
|
|
1215
|
-
#
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1227
|
+
# target_file_path is only constant when `context` pinned a single
|
|
1228
|
+
# definition. Without it, who_calls_function matches
|
|
1229
|
+
# Function {name: $function_name} across every file, so rows
|
|
1230
|
+
# legitimately carry different targets — hoisting the first row's
|
|
1231
|
+
# value and stripping the rest reported every caller as calling
|
|
1232
|
+
# whichever definition happened to sort first.
|
|
1233
|
+
#
|
|
1234
|
+
# Hoist only when the rows agree; otherwise leave the field on each
|
|
1235
|
+
# row so the ambiguity is visible to the caller.
|
|
1236
|
+
target_paths = {r.get("target_file_path") for r in results}
|
|
1237
|
+
target_file_path = target_paths.pop() if len(target_paths) == 1 else None
|
|
1238
|
+
if target_file_path is not None:
|
|
1239
|
+
for r in results:
|
|
1240
|
+
r.pop("target_file_path", None)
|
|
1241
|
+
envelope = {
|
|
1220
1242
|
"query_type": "find_callers", "target": target, "context": context,
|
|
1221
1243
|
"target_file_path": target_file_path, "results": results,
|
|
1222
1244
|
"summary": f"Found {len(results)} functions that call '{target}'"
|
|
1223
1245
|
}
|
|
1246
|
+
if target_file_path is None and len(target_paths) > 1:
|
|
1247
|
+
envelope["note"] = (
|
|
1248
|
+
f"'{target}' is defined in {len(target_paths)} files; each result "
|
|
1249
|
+
"carries its own target_file_path. Pass `context` to disambiguate."
|
|
1250
|
+
)
|
|
1251
|
+
return envelope
|
|
1224
1252
|
|
|
1225
1253
|
elif query_type == "find_callees":
|
|
1226
1254
|
results = self.what_does_function_call(target, context, repo_path=repo_path)
|
|
@@ -1272,7 +1300,10 @@ class CodeFinder:
|
|
|
1272
1300
|
}
|
|
1273
1301
|
|
|
1274
1302
|
elif query_type in ["dead_code", "unused", "unreachable"]:
|
|
1275
|
-
|
|
1303
|
+
# graph_name must be forwarded: find_dead_code defaults it to None and
|
|
1304
|
+
# re-assigns the shared self._active_graph, so omitting it here
|
|
1305
|
+
# silently redirected the query to the default graph.
|
|
1306
|
+
results = self.find_dead_code(repo_path=repo_path, graph_name=graph_name)
|
|
1276
1307
|
return {
|
|
1277
1308
|
"query_type": "dead_code", "results": results,
|
|
1278
1309
|
"summary": f"Found {len(results['potentially_unused_functions'])} potentially unused functions"
|
|
@@ -1281,7 +1312,7 @@ class CodeFinder:
|
|
|
1281
1312
|
elif query_type == "find_complexity":
|
|
1282
1313
|
limit_val = context if context else target
|
|
1283
1314
|
limit = int(limit_val) if limit_val and str(limit_val).isdigit() else 10
|
|
1284
|
-
results = self.find_most_complex_functions(limit, repo_path=repo_path)
|
|
1315
|
+
results = self.find_most_complex_functions(limit, repo_path=repo_path, graph_name=graph_name)
|
|
1285
1316
|
return {
|
|
1286
1317
|
"query_type": "find_complexity", "limit": limit, "results": results,
|
|
1287
1318
|
"summary": f"Found the top {len(results)} most complex functions"
|
|
@@ -236,8 +236,8 @@ def find_java_spring_beans(code_finder: CodeFinder, **args) -> Dict[str, Any]:
|
|
|
236
236
|
query = f"""
|
|
237
237
|
MATCH (c:Class)
|
|
238
238
|
WHERE {where_clause}
|
|
239
|
-
OPTIONAL MATCH ()-[:INJECTS]->(c)
|
|
240
|
-
WITH c, count(
|
|
239
|
+
OPTIONAL MATCH ()-[inj:INJECTS]->(c)
|
|
240
|
+
WITH c, count(inj) AS injection_count
|
|
241
241
|
RETURN c.name AS name, c.spring_stereotype AS stereotype,
|
|
242
242
|
c.path AS file, c.line_number AS line_number, injection_count
|
|
243
243
|
ORDER BY stereotype, name
|
|
@@ -296,7 +296,8 @@ def find_datasource_nodes(code_finder: CodeFinder, **args) -> Dict[str, Any]:
|
|
|
296
296
|
{kp_where}
|
|
297
297
|
OPTIONAL MATCH (kp:RedisKeyPattern)-[:STORED_IN]->(d)
|
|
298
298
|
RETURN d.name AS datasource,
|
|
299
|
-
collect({{pattern:
|
|
299
|
+
[x IN collect(kp) | {{pattern: x.pattern, key_type: x.key_type,
|
|
300
|
+
count: x.count}}] AS key_patterns
|
|
300
301
|
"""
|
|
301
302
|
|
|
302
303
|
try:
|
|
@@ -19,6 +19,25 @@ def add_code_to_graph(graph_builder, job_manager, loop, list_repos_func, **args)
|
|
|
19
19
|
|
|
20
20
|
if not path:
|
|
21
21
|
return {"error": "Path is a required argument (repo_path)."}
|
|
22
|
+
|
|
23
|
+
# `graph_name` is advertised in this tool's schema but indexing cannot yet
|
|
24
|
+
# honour it: GraphBuilder binds its GraphWriter to the default driver at
|
|
25
|
+
# construction, so a named graph would need a per-job writer threaded
|
|
26
|
+
# through the whole pipeline. Refuse explicitly rather than write to the
|
|
27
|
+
# default graph and report success — an agent that believed the repository
|
|
28
|
+
# landed in a named graph would find nothing there later, with no error to
|
|
29
|
+
# explain it.
|
|
30
|
+
graph_name = args.get("graph_name")
|
|
31
|
+
if graph_name:
|
|
32
|
+
return {
|
|
33
|
+
"error": (
|
|
34
|
+
f"Indexing into a named graph is not supported yet, so "
|
|
35
|
+
f"graph_name={graph_name!r} cannot be honoured. Omit it to index "
|
|
36
|
+
"into the default graph, or select the graph via the CLI context "
|
|
37
|
+
"(`cgc context create` / `cgc index --context`)."
|
|
38
|
+
),
|
|
39
|
+
"unsupported_argument": "graph_name",
|
|
40
|
+
}
|
|
22
41
|
|
|
23
42
|
try:
|
|
24
43
|
path_obj = Path(path).resolve()
|
|
@@ -354,15 +354,15 @@ def get_repository_stats(code_finder: CodeFinder, **args) -> Dict[str, Any]:
|
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
# 1. Files
|
|
357
|
-
file_query = "MATCH (r:Repository {path: $path})-[:CONTAINS*]->(f:File) RETURN count(f) as c"
|
|
357
|
+
file_query = "MATCH (r:Repository {path: $path})-[:CONTAINS*]->(f:File) RETURN count(DISTINCT f) as c"
|
|
358
358
|
file_count = session.run(file_query, path=repo_path_obj).single()["c"]
|
|
359
359
|
|
|
360
360
|
# 2. Functions
|
|
361
|
-
func_query = "MATCH (r:Repository {path: $path})-[:CONTAINS*]->(func:Function) RETURN count(func) as c"
|
|
361
|
+
func_query = "MATCH (r:Repository {path: $path})-[:CONTAINS*]->(func:Function) RETURN count(DISTINCT func) as c"
|
|
362
362
|
func_count = session.run(func_query, path=repo_path_obj).single()["c"]
|
|
363
363
|
|
|
364
364
|
# 3. Classes
|
|
365
|
-
class_query = "MATCH (r:Repository {path: $path})-[:CONTAINS*]->(cls:Class) RETURN count(cls) as c"
|
|
365
|
+
class_query = "MATCH (r:Repository {path: $path})-[:CONTAINS*]->(cls:Class) RETURN count(DISTINCT cls) as c"
|
|
366
366
|
class_count = session.run(class_query, path=repo_path_obj).single()["c"]
|
|
367
367
|
|
|
368
368
|
# 4. Modules (imported)
|
|
@@ -191,6 +191,14 @@ async def run_scip_index_async(
|
|
|
191
191
|
cgcignore_path=cgcignore_path,
|
|
192
192
|
supported_extensions=set(parsers_keys),
|
|
193
193
|
)
|
|
194
|
+
# Recompute total_files now that we know the full set (SCIP-covered +
|
|
195
|
+
# supplementary), so progress_percentage stays <= 100% throughout.
|
|
196
|
+
if job_id:
|
|
197
|
+
new_total = len(files_data) + sum(
|
|
198
|
+
1 for f in supplementary_files
|
|
199
|
+
if str(f.resolve()) not in scip_abs_paths
|
|
200
|
+
)
|
|
201
|
+
job_manager.update_job(job_id, total_files=new_total)
|
|
194
202
|
minimal_nodes = 0
|
|
195
203
|
for repo_file in supplementary_files:
|
|
196
204
|
abs_str = str(repo_file.resolve())
|
|
@@ -6,20 +6,37 @@ from codegraphcontext.utils.debug_log import debug_log, info_logger, error_logge
|
|
|
6
6
|
from codegraphcontext.utils.tree_sitter_manager import execute_query
|
|
7
7
|
|
|
8
8
|
C_QUERIES = {
|
|
9
|
+
# A pointer return type wraps the function declarator from the OUTSIDE:
|
|
10
|
+
# `char* f()` is
|
|
11
|
+
# function_definition > pointer_declarator > function_declarator > identifier
|
|
12
|
+
# The second alternative below used to nest these the other way round, which
|
|
13
|
+
# matches nothing, so no function returning `T*` or `T**` was extracted —
|
|
14
|
+
# and because pre_scan_c shares this query they were invisible as call
|
|
15
|
+
# targets too.
|
|
9
16
|
"functions": """
|
|
10
17
|
(function_definition
|
|
11
18
|
declarator: (function_declarator
|
|
12
19
|
declarator: (identifier) @name
|
|
13
20
|
)
|
|
14
21
|
) @function_node
|
|
15
|
-
|
|
22
|
+
|
|
16
23
|
(function_definition
|
|
17
|
-
declarator: (
|
|
18
|
-
declarator: (
|
|
24
|
+
declarator: (pointer_declarator
|
|
25
|
+
declarator: (function_declarator
|
|
19
26
|
declarator: (identifier) @name
|
|
20
27
|
)
|
|
21
28
|
)
|
|
22
29
|
) @function_node
|
|
30
|
+
|
|
31
|
+
(function_definition
|
|
32
|
+
declarator: (pointer_declarator
|
|
33
|
+
declarator: (pointer_declarator
|
|
34
|
+
declarator: (function_declarator
|
|
35
|
+
declarator: (identifier) @name
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
)
|
|
39
|
+
) @function_node
|
|
23
40
|
""",
|
|
24
41
|
"structs": """
|
|
25
42
|
(struct_specifier
|
|
@@ -762,15 +779,25 @@ def pre_scan_c(files: list[Path], parser_wrapper) -> dict:
|
|
|
762
779
|
declarator: (identifier) @name
|
|
763
780
|
)
|
|
764
781
|
)
|
|
765
|
-
|
|
782
|
+
|
|
766
783
|
(function_definition
|
|
767
|
-
declarator: (
|
|
768
|
-
declarator: (
|
|
784
|
+
declarator: (pointer_declarator
|
|
785
|
+
declarator: (function_declarator
|
|
769
786
|
declarator: (identifier) @name
|
|
770
787
|
)
|
|
771
788
|
)
|
|
772
789
|
)
|
|
773
|
-
|
|
790
|
+
|
|
791
|
+
(function_definition
|
|
792
|
+
declarator: (pointer_declarator
|
|
793
|
+
declarator: (pointer_declarator
|
|
794
|
+
declarator: (function_declarator
|
|
795
|
+
declarator: (identifier) @name
|
|
796
|
+
)
|
|
797
|
+
)
|
|
798
|
+
)
|
|
799
|
+
)
|
|
800
|
+
|
|
774
801
|
(struct_specifier
|
|
775
802
|
name: (type_identifier) @name
|
|
776
803
|
)
|
{codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/cpp.py
RENAMED
|
@@ -6,6 +6,13 @@ from codegraphcontext.utils.debug_log import debug_log, info_logger, error_logge
|
|
|
6
6
|
from codegraphcontext.utils.tree_sitter_manager import execute_query
|
|
7
7
|
|
|
8
8
|
CPP_QUERIES = {
|
|
9
|
+
# A pointer or reference return type wraps the function declarator from the
|
|
10
|
+
# OUTSIDE: `char* f()` is
|
|
11
|
+
# function_definition > pointer_declarator > function_declarator > identifier
|
|
12
|
+
# not function_declarator > pointer_declarator. Matching only the unwrapped
|
|
13
|
+
# shape meant no function returning `T*`, `T&` or `T**` was ever extracted —
|
|
14
|
+
# accessors, factories and `operator[]` are pervasive in C++, and because
|
|
15
|
+
# pre_scan_cpp shares this query they were invisible as call targets too.
|
|
9
16
|
"functions": """
|
|
10
17
|
(function_definition
|
|
11
18
|
declarator: (function_declarator
|
|
@@ -16,6 +23,44 @@ CPP_QUERIES = {
|
|
|
16
23
|
]
|
|
17
24
|
)
|
|
18
25
|
) @function_node
|
|
26
|
+
|
|
27
|
+
(function_definition
|
|
28
|
+
declarator: (pointer_declarator
|
|
29
|
+
declarator: (function_declarator
|
|
30
|
+
declarator: [
|
|
31
|
+
(identifier) @name
|
|
32
|
+
(field_identifier) @name
|
|
33
|
+
(qualified_identifier) @qualified_name
|
|
34
|
+
]
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
) @function_node
|
|
38
|
+
|
|
39
|
+
(function_definition
|
|
40
|
+
declarator: (pointer_declarator
|
|
41
|
+
declarator: (pointer_declarator
|
|
42
|
+
declarator: (function_declarator
|
|
43
|
+
declarator: [
|
|
44
|
+
(identifier) @name
|
|
45
|
+
(field_identifier) @name
|
|
46
|
+
(qualified_identifier) @qualified_name
|
|
47
|
+
]
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
) @function_node
|
|
52
|
+
|
|
53
|
+
(function_definition
|
|
54
|
+
declarator: (reference_declarator
|
|
55
|
+
(function_declarator
|
|
56
|
+
declarator: [
|
|
57
|
+
(identifier) @name
|
|
58
|
+
(field_identifier) @name
|
|
59
|
+
(qualified_identifier) @qualified_name
|
|
60
|
+
]
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
) @function_node
|
|
19
64
|
""",
|
|
20
65
|
"classes": """
|
|
21
66
|
(class_specifier
|
|
@@ -651,6 +696,23 @@ def pre_scan_cpp(files: list[Path], parser_wrapper) -> dict:
|
|
|
651
696
|
(type_definition declarator: (type_identifier) @name)
|
|
652
697
|
(function_definition declarator: (function_declarator declarator: (identifier) @name))
|
|
653
698
|
(function_definition declarator: (function_declarator declarator: (qualified_identifier) @qualified_name))
|
|
699
|
+
|
|
700
|
+
; A pointer/reference return type wraps the function declarator from the
|
|
701
|
+
; outside, so these forms need their own alternatives — without them a
|
|
702
|
+
; `T* f()` was not registered here either, and so was unresolvable as a
|
|
703
|
+
; call target even once it became a node.
|
|
704
|
+
(function_definition declarator: (pointer_declarator
|
|
705
|
+
declarator: (function_declarator declarator: (identifier) @name)))
|
|
706
|
+
(function_definition declarator: (pointer_declarator
|
|
707
|
+
declarator: (function_declarator declarator: (qualified_identifier) @qualified_name)))
|
|
708
|
+
(function_definition declarator: (pointer_declarator declarator: (pointer_declarator
|
|
709
|
+
declarator: (function_declarator declarator: (identifier) @name))))
|
|
710
|
+
(function_definition declarator: (pointer_declarator declarator: (pointer_declarator
|
|
711
|
+
declarator: (function_declarator declarator: (qualified_identifier) @qualified_name))))
|
|
712
|
+
(function_definition declarator: (reference_declarator
|
|
713
|
+
(function_declarator declarator: (identifier) @name)))
|
|
714
|
+
(function_definition declarator: (reference_declarator
|
|
715
|
+
(function_declarator declarator: (qualified_identifier) @qualified_name)))
|
|
654
716
|
"""
|
|
655
717
|
|
|
656
718
|
|
{codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/csharp.py
RENAMED
|
@@ -6,6 +6,21 @@ from codegraphcontext.utils.debug_log import debug_log, info_logger, error_logge
|
|
|
6
6
|
from codegraphcontext.utils.tree_sitter_manager import execute_query
|
|
7
7
|
|
|
8
8
|
CSHARP_QUERIES = {
|
|
9
|
+
# Fields and locals share a shape: `variable_declaration` carries the type
|
|
10
|
+
# and holds one `variable_declarator` per name. There was no `variables`
|
|
11
|
+
# query at all and the key was hardcoded to [], so C# produced no Variable
|
|
12
|
+
# nodes — and `resolution/calls.py` lost the local-variable declarations it
|
|
13
|
+
# uses to infer a receiver's type, so `var s = new UserService(); s.Save();`
|
|
14
|
+
# could not resolve Save to UserService.Save.
|
|
15
|
+
"variables": """
|
|
16
|
+
(field_declaration
|
|
17
|
+
(variable_declaration) @decl
|
|
18
|
+
) @field_node
|
|
19
|
+
|
|
20
|
+
(local_declaration_statement
|
|
21
|
+
(variable_declaration) @decl
|
|
22
|
+
) @local_node
|
|
23
|
+
""",
|
|
9
24
|
"functions": """
|
|
10
25
|
(method_declaration
|
|
11
26
|
name: (identifier) @name
|
|
@@ -123,6 +138,7 @@ class CSharpTreeSitterParser:
|
|
|
123
138
|
parsed_enums = []
|
|
124
139
|
parsed_records = []
|
|
125
140
|
parsed_properties = []
|
|
141
|
+
parsed_variables = []
|
|
126
142
|
parsed_imports = []
|
|
127
143
|
parsed_calls = []
|
|
128
144
|
|
|
@@ -143,6 +159,8 @@ class CSharpTreeSitterParser:
|
|
|
143
159
|
parsed_records = self._parse_type_declarations(captures, source_code, path, "Record")
|
|
144
160
|
elif capture_name == "properties":
|
|
145
161
|
parsed_properties = self._parse_properties(captures, source_code, path, tree.root_node)
|
|
162
|
+
elif capture_name == "variables":
|
|
163
|
+
parsed_variables = self._parse_variables(captures)
|
|
146
164
|
elif capture_name == "imports":
|
|
147
165
|
parsed_imports = self._parse_imports(captures, source_code)
|
|
148
166
|
elif capture_name == "calls":
|
|
@@ -157,7 +175,7 @@ class CSharpTreeSitterParser:
|
|
|
157
175
|
"enums": parsed_enums,
|
|
158
176
|
"records": parsed_records,
|
|
159
177
|
"properties": parsed_properties,
|
|
160
|
-
"variables":
|
|
178
|
+
"variables": parsed_variables,
|
|
161
179
|
"imports": parsed_imports,
|
|
162
180
|
"function_calls": parsed_calls,
|
|
163
181
|
"is_dependency": is_dependency,
|
|
@@ -359,6 +377,70 @@ class CSharpTreeSitterParser:
|
|
|
359
377
|
|
|
360
378
|
return imports
|
|
361
379
|
|
|
380
|
+
def _parse_variables(self, captures: list) -> list:
|
|
381
|
+
"""Fields and locals, from `variable_declaration` nodes.
|
|
382
|
+
|
|
383
|
+
Both shapes nest identically — `variable_declaration` carries the type
|
|
384
|
+
and holds one `variable_declarator` per declared name, so
|
|
385
|
+
`int a = 1, b = 2;` yields two rows sharing a type.
|
|
386
|
+
"""
|
|
387
|
+
variables = []
|
|
388
|
+
seen = set()
|
|
389
|
+
for node, capture_name in captures:
|
|
390
|
+
if capture_name != "decl":
|
|
391
|
+
continue
|
|
392
|
+
type_node = node.child_by_field_name("type")
|
|
393
|
+
var_type = self._get_node_text(type_node) if type_node is not None else None
|
|
394
|
+
|
|
395
|
+
for declarator in node.children:
|
|
396
|
+
if declarator.type != "variable_declarator":
|
|
397
|
+
continue
|
|
398
|
+
name_node = declarator.child_by_field_name("name")
|
|
399
|
+
if name_node is None:
|
|
400
|
+
name_node = next(
|
|
401
|
+
(c for c in declarator.children if c.type == "identifier"), None
|
|
402
|
+
)
|
|
403
|
+
if name_node is None:
|
|
404
|
+
continue
|
|
405
|
+
|
|
406
|
+
line_number = name_node.start_point[0] + 1
|
|
407
|
+
name = self._get_node_text(name_node)
|
|
408
|
+
if (name, line_number) in seen:
|
|
409
|
+
continue
|
|
410
|
+
seen.add((name, line_number))
|
|
411
|
+
|
|
412
|
+
# tree-sitter-c-sharp has no `equals_value_clause`: the
|
|
413
|
+
# initialiser is a direct sibling following the `=` token.
|
|
414
|
+
value = None
|
|
415
|
+
seen_equals = False
|
|
416
|
+
for child in declarator.children:
|
|
417
|
+
if child.type == "=":
|
|
418
|
+
seen_equals = True
|
|
419
|
+
continue
|
|
420
|
+
if seen_equals and child.is_named:
|
|
421
|
+
value = self._get_node_text(child)
|
|
422
|
+
break
|
|
423
|
+
|
|
424
|
+
context, _ctx_type, _ctx_line = self._get_parent_context(
|
|
425
|
+
declarator, types=("method_declaration", "function_declaration")
|
|
426
|
+
)
|
|
427
|
+
class_context, _c_type, _c_line = self._get_parent_context(
|
|
428
|
+
declarator,
|
|
429
|
+
types=("class_declaration", "struct_declaration", "record_declaration"),
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
variables.append({
|
|
433
|
+
"name": name,
|
|
434
|
+
"line_number": line_number,
|
|
435
|
+
"value": value,
|
|
436
|
+
"type": var_type,
|
|
437
|
+
"context": context,
|
|
438
|
+
"class_context": class_context,
|
|
439
|
+
"lang": self.language_name,
|
|
440
|
+
"is_dependency": False,
|
|
441
|
+
})
|
|
442
|
+
return variables
|
|
443
|
+
|
|
362
444
|
def _get_parent_context(self, node: Any, types: Tuple[str, ...] = ('class_declaration', 'struct_declaration', 'function_declaration', 'method_declaration')):
|
|
363
445
|
"""Find parent context for C# constructs."""
|
|
364
446
|
curr = node.parent
|
{codegraphcontext-0.5.5 → codegraphcontext-0.5.7}/src/codegraphcontext/tools/languages/javascript.py
RENAMED
|
@@ -360,13 +360,77 @@ class JavascriptTreeSitterParser:
|
|
|
360
360
|
left_child = child.child_by_field_name('left')
|
|
361
361
|
if left_child and left_child.type == 'identifier':
|
|
362
362
|
params.append(self._get_node_text(left_child))
|
|
363
|
-
elif child.type
|
|
363
|
+
elif child.type in ('rest_element', 'rest_pattern'):
|
|
364
364
|
# Rest parameter: ...args
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
# Try named field first, then direct identifier child
|
|
366
|
+
name_node = (child.child_by_field_name('name') or
|
|
367
|
+
child.child_by_field_name('argument'))
|
|
368
|
+
if name_node is None:
|
|
369
|
+
name_node = next(
|
|
370
|
+
(c for c in child.children if c.type == 'identifier'), None
|
|
371
|
+
)
|
|
372
|
+
if name_node:
|
|
373
|
+
params.append(f"...{self._get_node_text(name_node)}")
|
|
374
|
+
elif child.type == 'object_pattern':
|
|
375
|
+
# Destructured object: {a}, {a: renamed}, {a = 1}
|
|
376
|
+
names = self._pattern_binding_names(child)
|
|
377
|
+
params.append("{" + ", ".join(names) + "}" if names else "{...}")
|
|
378
|
+
elif child.type == 'array_pattern':
|
|
379
|
+
# Destructured array: [a, b]
|
|
380
|
+
names = self._pattern_binding_names(child)
|
|
381
|
+
params.append("[" + ", ".join(names) + "]" if names else "[...]")
|
|
368
382
|
return params
|
|
369
383
|
|
|
384
|
+
def _pattern_binding_names(self, pattern_node):
|
|
385
|
+
"""Local names a destructuring pattern binds, in source order.
|
|
386
|
+
|
|
387
|
+
Recorded rather than collapsed to a placeholder because the binding is
|
|
388
|
+
what later code refers to — `function Button({label})` is the dominant
|
|
389
|
+
React idiom, and `label` is the name that appears in the body. One
|
|
390
|
+
entry is still emitted per *parameter position* so arity, which call
|
|
391
|
+
resolution matches on, is unchanged.
|
|
392
|
+
"""
|
|
393
|
+
names = []
|
|
394
|
+
|
|
395
|
+
def walk(node):
|
|
396
|
+
for child in node.named_children:
|
|
397
|
+
if child.type == 'shorthand_property_identifier_pattern':
|
|
398
|
+
# { a }
|
|
399
|
+
names.append(self._get_node_text(child))
|
|
400
|
+
elif child.type == 'pair_pattern':
|
|
401
|
+
# { a: local } — the binding is the value, not the key
|
|
402
|
+
value = child.child_by_field_name('value')
|
|
403
|
+
if value is not None and value.type == 'identifier':
|
|
404
|
+
names.append(self._get_node_text(value))
|
|
405
|
+
elif value is not None:
|
|
406
|
+
walk(value) # nested destructuring
|
|
407
|
+
elif child.type == 'object_assignment_pattern':
|
|
408
|
+
# { a = 1 }
|
|
409
|
+
target = child.child_by_field_name('left') or (
|
|
410
|
+
child.named_children[0] if child.named_children else None
|
|
411
|
+
)
|
|
412
|
+
if target is not None:
|
|
413
|
+
if target.type in (
|
|
414
|
+
'identifier', 'shorthand_property_identifier_pattern'
|
|
415
|
+
):
|
|
416
|
+
names.append(self._get_node_text(target))
|
|
417
|
+
else:
|
|
418
|
+
walk(target)
|
|
419
|
+
elif child.type == 'identifier':
|
|
420
|
+
# [ a, b ]
|
|
421
|
+
names.append(self._get_node_text(child))
|
|
422
|
+
elif child.type in ('object_pattern', 'array_pattern'):
|
|
423
|
+
walk(child)
|
|
424
|
+
elif child.type in ('rest_element', 'rest_pattern'):
|
|
425
|
+
inner = next(
|
|
426
|
+
(c for c in child.children if c.type == 'identifier'), None
|
|
427
|
+
)
|
|
428
|
+
if inner is not None:
|
|
429
|
+
names.append(f"...{self._get_node_text(inner)}")
|
|
430
|
+
|
|
431
|
+
walk(pattern_node)
|
|
432
|
+
return names
|
|
433
|
+
|
|
370
434
|
|
|
371
435
|
def _get_jsdoc_comment(self, func_node):
|
|
372
436
|
"""Extract JSDoc comment preceding the function."""
|