codegraphcontext-rust 0.9.14__tar.gz → 0.9.16__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.9.14 → codegraphcontext_rust-0.9.16}/PKG-INFO +1 -1
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/pyproject.toml +1 -1
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/go.rs +154 -4
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/java.rs +351 -68
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/javascript.rs +252 -90
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/kotlin.rs +163 -32
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/mod.rs +34 -17
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/python.rs +80 -23
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/tsx.rs +104 -2
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/typescript.rs +24 -0
- codegraphcontext_rust-0.9.16/rust/cgc-core/src/resolution/calls.rs +896 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-python/src/lib.rs +21 -2
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/cgc_wiki_cli.py +1 -1
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/context_generator.py +6 -6
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/persistence/duckdb_writer.py +19 -9
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/route_extraction.py +170 -73
- codegraphcontext_rust-0.9.14/rust/cgc-core/src/resolution/calls.rs +0 -488
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/LICENSE +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/README.md +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/Cargo.lock +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/Cargo.toml +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/Cargo.toml +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/c_lang.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/cpp.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/csharp.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/dart.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/elixir.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/haskell.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/perl.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/php.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/ruby.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/rust_lang.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/scala.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lang/swift.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/lib.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/parser.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/resolution/inheritance.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/resolution/mod.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/sanitize.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-core/src/types.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-python/Cargo.toml +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/cgc-python/src/conversions.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/tree-sitter-perl-vendor/Cargo.toml +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/tree-sitter-perl-vendor/build.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/tree-sitter-perl-vendor/src/grammar/alloc.h +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/tree-sitter-perl-vendor/src/grammar/array.h +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/tree-sitter-perl-vendor/src/grammar/parser.c +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/tree-sitter-perl-vendor/src/grammar/parser.h +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/tree-sitter-perl-vendor/src/grammar/scanner.c +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/tree-sitter-perl-vendor/src/grammar/tree_sitter/parser.h +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/rust/tree-sitter-perl-vendor/src/lib.rs +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/cli/cli_helpers.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/cli/config_manager.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/cli/main.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/cli/registry_commands.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/cli/setup_macos.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/cli/setup_wizard.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/cli/visualizer.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/core/__init__.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/core/bundle_registry.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/core/cgc_bundle.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/core/cgcignore.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/core/database.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/core/database_falkordb.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/core/database_falkordb_remote.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/core/database_kuzu.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/core/falkor_worker.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/core/jobs.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/core/watcher.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/prompts.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/server.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tool_definitions.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/advanced_language_query_tool.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/code_finder.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/graph_builder.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/handlers/analysis_handlers.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/handlers/indexing_handlers.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/handlers/management_handlers.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/handlers/query_handlers.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/__init__.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/constants.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/discovery.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/engine.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/execution_flows.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/module_grouping.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/noise_filter.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/op_param_extraction.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/persistence/__init__.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/persistence/parquet_loader.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/persistence/writer.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/pipeline.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/pre_scan.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/rationale_extraction.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/resolution/__init__.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/resolution/calls.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/resolution/inheritance.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/sanitize.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/schema.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/schema_contract.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/indexing/scip_pipeline.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/c.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/cpp.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/csharp.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/dart.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/elixir.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/go.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/haskell.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/java.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/javascript.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/kotlin.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/perl.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/php.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/python.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/ruby.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/rust.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/scala.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/swift.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/typescript.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/package_resolver.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/dart_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/perl_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/scip_indexer.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/scip_pb2.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/system.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/tools/tree_sitter_parser.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/utils/debug_log.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/utils/path_ignore.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/utils/repo_path.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/src/codegraphcontext/utils/visualize_graph.py +0 -0
- {codegraphcontext_rust-0.9.14 → codegraphcontext_rust-0.9.16}/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.9.
|
|
7
|
+
version = "0.9.16"
|
|
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" },
|
|
@@ -176,8 +176,11 @@ impl GoExtractor {
|
|
|
176
176
|
if child.kind() == "parameter_declaration" {
|
|
177
177
|
let type_node = child.child_by_field_name("type");
|
|
178
178
|
if let Some(tn) = type_node {
|
|
179
|
-
|
|
180
|
-
return
|
|
179
|
+
// Strip pointer and type parameters: `*List[T]` -> `List`.
|
|
180
|
+
return self.base_type_name(&tn, source).or_else(|| {
|
|
181
|
+
let type_text = get_node_text(&tn, source);
|
|
182
|
+
Some(type_text.trim_start_matches('*').to_string())
|
|
183
|
+
});
|
|
181
184
|
}
|
|
182
185
|
}
|
|
183
186
|
}
|
|
@@ -185,6 +188,69 @@ impl GoExtractor {
|
|
|
185
188
|
None
|
|
186
189
|
}
|
|
187
190
|
|
|
191
|
+
/// Bare type name of a type node: `T`, `*T`, `pkg.T`, `T[U]` all yield `T`.
|
|
192
|
+
fn base_type_name(&self, type_node: &Node, source: &[u8]) -> Option<String> {
|
|
193
|
+
match type_node.kind() {
|
|
194
|
+
"type_identifier" => Some(get_node_text(type_node, source).to_string()),
|
|
195
|
+
"pointer_type" => type_node
|
|
196
|
+
.named_child(0)
|
|
197
|
+
.and_then(|inner| self.base_type_name(&inner, source)),
|
|
198
|
+
"qualified_type" => type_node
|
|
199
|
+
.child_by_field_name("name")
|
|
200
|
+
.map(|n| get_node_text(&n, source).to_string()),
|
|
201
|
+
"generic_type" => type_node
|
|
202
|
+
.child_by_field_name("type")
|
|
203
|
+
.and_then(|inner| self.base_type_name(&inner, source)),
|
|
204
|
+
_ => None,
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/// Embedded (anonymous) fields of a struct_type, e.g. `Base`, `*Base`, `pkg.Base`.
|
|
209
|
+
fn struct_embedded_bases(&self, struct_type: &Node, source: &[u8]) -> Vec<String> {
|
|
210
|
+
let mut bases = Vec::new();
|
|
211
|
+
for i in 0..struct_type.named_child_count() {
|
|
212
|
+
let Some(field_list) = struct_type.named_child(i) else { continue };
|
|
213
|
+
if field_list.kind() != "field_declaration_list" {
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
for j in 0..field_list.named_child_count() {
|
|
217
|
+
let Some(field) = field_list.named_child(j) else { continue };
|
|
218
|
+
if field.kind() != "field_declaration" || field.child_by_field_name("name").is_some() {
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
if let Some(base) = field
|
|
222
|
+
.child_by_field_name("type")
|
|
223
|
+
.and_then(|t| self.base_type_name(&t, source))
|
|
224
|
+
{
|
|
225
|
+
bases.push(base);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
bases
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/// Embedded interfaces of an interface_type, e.g. `io.Reader`, `Closer`.
|
|
233
|
+
/// Type-set constraints (`~int | string`) and the builtins `any`/`comparable`
|
|
234
|
+
/// are not inheritance and are skipped.
|
|
235
|
+
fn interface_embedded_bases(&self, interface_type: &Node, source: &[u8]) -> Vec<String> {
|
|
236
|
+
let mut bases = Vec::new();
|
|
237
|
+
for i in 0..interface_type.named_child_count() {
|
|
238
|
+
let Some(elem) = interface_type.named_child(i) else { continue };
|
|
239
|
+
if elem.kind() != "type_elem" || elem.named_child_count() != 1 {
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
if let Some(base) = elem
|
|
243
|
+
.named_child(0)
|
|
244
|
+
.and_then(|t| self.base_type_name(&t, source))
|
|
245
|
+
{
|
|
246
|
+
if base != "any" && base != "comparable" {
|
|
247
|
+
bases.push(base);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
bases
|
|
252
|
+
}
|
|
253
|
+
|
|
188
254
|
fn get_docstring(&self, func_node: &Node, source: &[u8]) -> Option<String> {
|
|
189
255
|
let mut prev = func_node.prev_sibling();
|
|
190
256
|
while let Some(sib) = prev {
|
|
@@ -382,12 +448,18 @@ impl LanguageExtractor for GoExtractor {
|
|
|
382
448
|
None => continue,
|
|
383
449
|
};
|
|
384
450
|
let name = get_node_text(&node, source).to_string();
|
|
451
|
+
let bases = node
|
|
452
|
+
.parent()
|
|
453
|
+
.and_then(|spec| spec.child_by_field_name("type"))
|
|
454
|
+
.filter(|t| t.kind() == "struct_type")
|
|
455
|
+
.map(|t| self.struct_embedded_bases(&t, source))
|
|
456
|
+
.unwrap_or_default();
|
|
385
457
|
|
|
386
458
|
let mut class = ClassData {
|
|
387
459
|
name,
|
|
388
460
|
line_number: type_decl.start_position().row + 1,
|
|
389
461
|
end_line: type_decl.end_position().row + 1,
|
|
390
|
-
bases
|
|
462
|
+
bases,
|
|
391
463
|
context: None,
|
|
392
464
|
decorators: Vec::new(),
|
|
393
465
|
lang: self.lang_name().to_string(),
|
|
@@ -414,12 +486,18 @@ impl LanguageExtractor for GoExtractor {
|
|
|
414
486
|
None => continue,
|
|
415
487
|
};
|
|
416
488
|
let name = get_node_text(&node, source).to_string();
|
|
489
|
+
let bases = node
|
|
490
|
+
.parent()
|
|
491
|
+
.and_then(|spec| spec.child_by_field_name("type"))
|
|
492
|
+
.filter(|t| t.kind() == "interface_type")
|
|
493
|
+
.map(|t| self.interface_embedded_bases(&t, source))
|
|
494
|
+
.unwrap_or_default();
|
|
417
495
|
|
|
418
496
|
let mut class = ClassData {
|
|
419
497
|
name,
|
|
420
498
|
line_number: type_decl.start_position().row + 1,
|
|
421
499
|
end_line: type_decl.end_position().row + 1,
|
|
422
|
-
bases
|
|
500
|
+
bases,
|
|
423
501
|
context: None,
|
|
424
502
|
decorators: Vec::new(),
|
|
425
503
|
lang: self.lang_name().to_string(),
|
|
@@ -668,6 +746,78 @@ type Speaker interface {
|
|
|
668
746
|
assert!(classes.iter().any(|c| c.name == "Speaker"));
|
|
669
747
|
}
|
|
670
748
|
|
|
749
|
+
#[test]
|
|
750
|
+
fn test_struct_embedded_fields_as_bases() {
|
|
751
|
+
let code = r#"
|
|
752
|
+
package main
|
|
753
|
+
|
|
754
|
+
type Server struct {
|
|
755
|
+
Base
|
|
756
|
+
*Logger
|
|
757
|
+
http.Handler
|
|
758
|
+
name string
|
|
759
|
+
a, b int
|
|
760
|
+
}
|
|
761
|
+
"#;
|
|
762
|
+
let (tree, source) = parse_source(code);
|
|
763
|
+
let ext = GoExtractor;
|
|
764
|
+
let classes = ext.find_classes(&tree.root_node(), &source, false);
|
|
765
|
+
let server = classes.iter().find(|c| c.name == "Server").unwrap();
|
|
766
|
+
assert_eq!(server.bases, vec!["Base", "Logger", "Handler"]);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
#[test]
|
|
770
|
+
fn test_interface_embedding_as_bases() {
|
|
771
|
+
let code = r#"
|
|
772
|
+
package main
|
|
773
|
+
|
|
774
|
+
type ReadCloser interface {
|
|
775
|
+
io.Reader
|
|
776
|
+
Closer
|
|
777
|
+
Extra() int
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
type Number interface {
|
|
781
|
+
~int | ~float64
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
type Key interface {
|
|
785
|
+
comparable
|
|
786
|
+
}
|
|
787
|
+
"#;
|
|
788
|
+
let (tree, source) = parse_source(code);
|
|
789
|
+
let ext = GoExtractor;
|
|
790
|
+
let classes = ext.find_classes(&tree.root_node(), &source, false);
|
|
791
|
+
let rc = classes.iter().find(|c| c.name == "ReadCloser").unwrap();
|
|
792
|
+
assert_eq!(rc.bases, vec!["Reader", "Closer"]);
|
|
793
|
+
let num = classes.iter().find(|c| c.name == "Number").unwrap();
|
|
794
|
+
assert!(num.bases.is_empty());
|
|
795
|
+
let key = classes.iter().find(|c| c.name == "Key").unwrap();
|
|
796
|
+
assert!(key.bases.is_empty());
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
#[test]
|
|
800
|
+
fn test_generic_receiver_strips_type_params() {
|
|
801
|
+
let code = r#"
|
|
802
|
+
package main
|
|
803
|
+
|
|
804
|
+
type List[T any] struct {
|
|
805
|
+
items []T
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
func (l *List[T]) Push(v T) {}
|
|
809
|
+
|
|
810
|
+
func (p Pair[K, V]) Key() K { return p.k }
|
|
811
|
+
"#;
|
|
812
|
+
let (tree, source) = parse_source(code);
|
|
813
|
+
let ext = GoExtractor;
|
|
814
|
+
let funcs = ext.find_functions(&tree.root_node(), &source, false);
|
|
815
|
+
let push = funcs.iter().find(|f| f.name == "Push").unwrap();
|
|
816
|
+
assert_eq!(push.class_context.as_deref(), Some("List"));
|
|
817
|
+
let key = funcs.iter().find(|f| f.name == "Key").unwrap();
|
|
818
|
+
assert_eq!(key.class_context.as_deref(), Some("Pair"));
|
|
819
|
+
}
|
|
820
|
+
|
|
671
821
|
#[test]
|
|
672
822
|
fn test_find_imports() {
|
|
673
823
|
let code = r#"
|