codegraphcontext-rust 0.5.5__tar.gz → 0.9.10__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_rust-0.5.5 → codegraphcontext_rust-0.9.10}/PKG-INFO +1 -1
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/pyproject.toml +2 -1
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/mod.rs +26 -1
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/typescript.rs +105 -0
- codegraphcontext_rust-0.9.10/src/codegraphcontext/tools/indexing/cgc_wiki_cli.py +566 -0
- codegraphcontext_rust-0.9.10/src/codegraphcontext/tools/indexing/constants.py +70 -0
- codegraphcontext_rust-0.9.10/src/codegraphcontext/tools/indexing/context_generator.py +461 -0
- codegraphcontext_rust-0.9.10/src/codegraphcontext/tools/indexing/execution_flows.py +355 -0
- codegraphcontext_rust-0.9.10/src/codegraphcontext/tools/indexing/module_grouping.py +551 -0
- codegraphcontext_rust-0.9.10/src/codegraphcontext/tools/indexing/noise_filter.py +131 -0
- codegraphcontext_rust-0.9.10/src/codegraphcontext/tools/indexing/op_param_extraction.py +267 -0
- codegraphcontext_rust-0.9.10/src/codegraphcontext/tools/indexing/persistence/duckdb_writer.py +758 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/persistence/writer.py +448 -0
- codegraphcontext_rust-0.9.10/src/codegraphcontext/tools/indexing/rationale_extraction.py +146 -0
- codegraphcontext_rust-0.9.10/src/codegraphcontext/tools/indexing/route_extraction.py +551 -0
- codegraphcontext_rust-0.5.5/src/codegraphcontext/tools/indexing/constants.py +0 -25
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/LICENSE +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/README.md +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/Cargo.lock +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/Cargo.toml +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/Cargo.toml +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/c_lang.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/cpp.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/csharp.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/dart.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/elixir.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/go.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/haskell.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/java.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/javascript.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/kotlin.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/perl.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/php.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/python.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/ruby.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/rust_lang.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/scala.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/swift.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/tsx.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lib.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/parser.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/resolution/calls.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/resolution/inheritance.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/resolution/mod.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/sanitize.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/types.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-python/Cargo.toml +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-python/src/conversions.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-python/src/lib.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/tree-sitter-perl-vendor/Cargo.toml +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/tree-sitter-perl-vendor/build.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/tree-sitter-perl-vendor/src/grammar/alloc.h +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/tree-sitter-perl-vendor/src/grammar/array.h +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/tree-sitter-perl-vendor/src/grammar/parser.c +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/tree-sitter-perl-vendor/src/grammar/parser.h +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/tree-sitter-perl-vendor/src/grammar/scanner.c +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/tree-sitter-perl-vendor/src/grammar/tree_sitter/parser.h +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/tree-sitter-perl-vendor/src/lib.rs +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/cli/cli_helpers.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/cli/config_manager.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/cli/main.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/cli/registry_commands.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/cli/setup_macos.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/cli/setup_wizard.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/cli/visualizer.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/core/__init__.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/core/bundle_registry.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/core/cgc_bundle.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/core/cgcignore.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/core/database.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/core/database_falkordb.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/core/database_falkordb_remote.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/core/database_kuzu.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/core/falkor_worker.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/core/jobs.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/core/watcher.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/prompts.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/server.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tool_definitions.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/advanced_language_query_tool.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/code_finder.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/graph_builder.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/handlers/analysis_handlers.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/handlers/indexing_handlers.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/handlers/management_handlers.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/handlers/query_handlers.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/__init__.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/discovery.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/engine.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/persistence/__init__.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/persistence/parquet_loader.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/pipeline.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/pre_scan.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/resolution/__init__.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/resolution/calls.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/resolution/inheritance.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/sanitize.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/schema.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/schema_contract.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/indexing/scip_pipeline.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/c.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/cpp.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/csharp.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/dart.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/elixir.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/go.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/haskell.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/java.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/javascript.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/kotlin.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/perl.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/php.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/python.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/ruby.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/rust.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/scala.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/swift.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/typescript.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/package_resolver.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/dart_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/perl_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/scip_indexer.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/scip_pb2.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/system.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/tools/tree_sitter_parser.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/utils/debug_log.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/utils/path_ignore.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/utils/repo_path.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/utils/visualize_graph.py +0 -0
- {codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/src/codegraphcontext/viz/server.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "codegraphcontext-rust"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.9.10"
|
|
8
8
|
description = "Rust-accelerated code indexing engine for CodeGraphContext. 19 languages, 5-18x faster parsing via tree-sitter + rayon."
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Shashank Shekhar Singh", email = "shashankshekharsingh1205@gmail.com" },
|
|
@@ -70,6 +70,7 @@ dev = [
|
|
|
70
70
|
[project.scripts]
|
|
71
71
|
cgc = "codegraphcontext.cli.main:app"
|
|
72
72
|
codegraphcontext = "codegraphcontext.cli.main:app"
|
|
73
|
+
cgc-wiki = "codegraphcontext.tools.indexing.cgc_wiki_cli:main"
|
|
73
74
|
|
|
74
75
|
[tool.maturin]
|
|
75
76
|
manifest-path = "rust/cgc-python/Cargo.toml"
|
|
@@ -115,9 +115,34 @@ pub fn get_parent_context(
|
|
|
115
115
|
let mut curr = node.parent();
|
|
116
116
|
while let Some(parent) = curr {
|
|
117
117
|
if types.contains(&parent.kind()) {
|
|
118
|
-
let name = parent
|
|
118
|
+
let mut name = parent
|
|
119
119
|
.child_by_field_name("name")
|
|
120
120
|
.map(|n| get_node_text(&n, source).to_string());
|
|
121
|
+
|
|
122
|
+
// For arrow_function / function_expression without a name field,
|
|
123
|
+
// look up to the parent variable_declarator or assignment for the name.
|
|
124
|
+
// e.g., `const loadCvs = async () => { get() }` → name = "loadCvs"
|
|
125
|
+
if name.is_none()
|
|
126
|
+
&& (parent.kind() == "arrow_function"
|
|
127
|
+
|| parent.kind() == "function_expression")
|
|
128
|
+
{
|
|
129
|
+
if let Some(grandparent) = parent.parent() {
|
|
130
|
+
if grandparent.kind() == "variable_declarator" {
|
|
131
|
+
name = grandparent
|
|
132
|
+
.child_by_field_name("name")
|
|
133
|
+
.map(|n| get_node_text(&n, source).to_string());
|
|
134
|
+
} else if grandparent.kind() == "assignment_expression" {
|
|
135
|
+
name = grandparent
|
|
136
|
+
.child_by_field_name("left")
|
|
137
|
+
.map(|n| get_node_text(&n, source).to_string());
|
|
138
|
+
} else if grandparent.kind() == "pair" {
|
|
139
|
+
name = grandparent
|
|
140
|
+
.child_by_field_name("key")
|
|
141
|
+
.map(|n| get_node_text(&n, source).to_string());
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
121
146
|
let kind = Some(parent.kind().to_string());
|
|
122
147
|
let line = Some(parent.start_position().row + 1);
|
|
123
148
|
return (name, kind, line);
|
{codegraphcontext_rust-0.5.5 → codegraphcontext_rust-0.9.10}/rust/cgc-core/src/lang/typescript.rs
RENAMED
|
@@ -1089,4 +1089,109 @@ function complex(x: number): void {
|
|
|
1089
1089
|
assert_eq!(funcs.len(), 1);
|
|
1090
1090
|
assert!(funcs[0].cyclomatic_complexity >= 4);
|
|
1091
1091
|
}
|
|
1092
|
+
|
|
1093
|
+
#[test]
|
|
1094
|
+
fn test_nested_function_calls_context() {
|
|
1095
|
+
// Simulates a Next.js page component with nested arrow functions
|
|
1096
|
+
// like EmployeesPage → loadCvs → get()
|
|
1097
|
+
let code = r#"
|
|
1098
|
+
export default function EmployeesPage() {
|
|
1099
|
+
const router = useRouter();
|
|
1100
|
+
const { user } = useAuth();
|
|
1101
|
+
|
|
1102
|
+
const handleSearchChange = (e: any) => {
|
|
1103
|
+
const results = get("/api/search");
|
|
1104
|
+
setResults(results);
|
|
1105
|
+
};
|
|
1106
|
+
|
|
1107
|
+
const loadCvs = async () => {
|
|
1108
|
+
const res = await get("/api/cvs");
|
|
1109
|
+
setCvs(res.data);
|
|
1110
|
+
};
|
|
1111
|
+
|
|
1112
|
+
const handleSubmit = function() {
|
|
1113
|
+
post("/api/submit", data);
|
|
1114
|
+
};
|
|
1115
|
+
|
|
1116
|
+
fetchData("/api/init");
|
|
1117
|
+
}
|
|
1118
|
+
"#;
|
|
1119
|
+
let (tree, source) = parse_source(code);
|
|
1120
|
+
let ext = TypeScriptExtractor;
|
|
1121
|
+
let calls = ext.find_calls(&tree.root_node(), &source);
|
|
1122
|
+
|
|
1123
|
+
// Calls inside handleSearchChange should have context = "handleSearchChange"
|
|
1124
|
+
let search_get = calls.iter().find(|c| c.name == "get" && c.line_number == 7).unwrap();
|
|
1125
|
+
assert_eq!(
|
|
1126
|
+
search_get.context.0,
|
|
1127
|
+
Some("handleSearchChange".to_string()),
|
|
1128
|
+
"get() inside handleSearchChange should have context = handleSearchChange, got {:?}",
|
|
1129
|
+
search_get.context.0
|
|
1130
|
+
);
|
|
1131
|
+
|
|
1132
|
+
// Calls inside loadCvs should have context = "loadCvs"
|
|
1133
|
+
let cvs_get = calls.iter().find(|c| c.name == "get" && c.line_number == 12).unwrap();
|
|
1134
|
+
assert_eq!(
|
|
1135
|
+
cvs_get.context.0,
|
|
1136
|
+
Some("loadCvs".to_string()),
|
|
1137
|
+
"get() inside loadCvs should have context = loadCvs, got {:?}",
|
|
1138
|
+
cvs_get.context.0
|
|
1139
|
+
);
|
|
1140
|
+
|
|
1141
|
+
// Calls inside handleSubmit (function_expression) should have context = "handleSubmit"
|
|
1142
|
+
let submit_post = calls.iter().find(|c| c.name == "post").unwrap();
|
|
1143
|
+
assert_eq!(
|
|
1144
|
+
submit_post.context.0,
|
|
1145
|
+
Some("handleSubmit".to_string()),
|
|
1146
|
+
"post() inside handleSubmit should have context = handleSubmit, got {:?}",
|
|
1147
|
+
submit_post.context.0
|
|
1148
|
+
);
|
|
1149
|
+
|
|
1150
|
+
// Calls directly inside EmployeesPage should have context = "EmployeesPage"
|
|
1151
|
+
let init_fetch = calls.iter().find(|c| c.name == "fetchData").unwrap();
|
|
1152
|
+
assert_eq!(
|
|
1153
|
+
init_fetch.context.0,
|
|
1154
|
+
Some("EmployeesPage".to_string()),
|
|
1155
|
+
"fetchData() inside EmployeesPage should have context = EmployeesPage, got {:?}",
|
|
1156
|
+
init_fetch.context.0
|
|
1157
|
+
);
|
|
1158
|
+
|
|
1159
|
+
// useAuth/useRouter should have context = "EmployeesPage" (direct children)
|
|
1160
|
+
let auth = calls.iter().find(|c| c.name == "useAuth").unwrap();
|
|
1161
|
+
assert_eq!(auth.context.0, Some("EmployeesPage".to_string()));
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
#[test]
|
|
1165
|
+
fn test_nested_arrow_in_object() {
|
|
1166
|
+
// Arrow function as object property value
|
|
1167
|
+
let code = r#"
|
|
1168
|
+
const handlers = {
|
|
1169
|
+
onClick: () => {
|
|
1170
|
+
doSomething();
|
|
1171
|
+
},
|
|
1172
|
+
onSubmit: function() {
|
|
1173
|
+
submitForm();
|
|
1174
|
+
}
|
|
1175
|
+
};
|
|
1176
|
+
"#;
|
|
1177
|
+
let (tree, source) = parse_source(code);
|
|
1178
|
+
let ext = TypeScriptExtractor;
|
|
1179
|
+
let calls = ext.find_calls(&tree.root_node(), &source);
|
|
1180
|
+
|
|
1181
|
+
let do_call = calls.iter().find(|c| c.name == "doSomething").unwrap();
|
|
1182
|
+
assert_eq!(
|
|
1183
|
+
do_call.context.0,
|
|
1184
|
+
Some("onClick".to_string()),
|
|
1185
|
+
"doSomething() inside onClick should have context = onClick, got {:?}",
|
|
1186
|
+
do_call.context.0
|
|
1187
|
+
);
|
|
1188
|
+
|
|
1189
|
+
let submit_call = calls.iter().find(|c| c.name == "submitForm").unwrap();
|
|
1190
|
+
assert_eq!(
|
|
1191
|
+
submit_call.context.0,
|
|
1192
|
+
Some("onSubmit".to_string()),
|
|
1193
|
+
"submitForm() inside onSubmit should have context = onSubmit, got {:?}",
|
|
1194
|
+
submit_call.context.0
|
|
1195
|
+
);
|
|
1196
|
+
}
|
|
1092
1197
|
}
|