codegraphcontext-rust 0.9.15__tar.gz → 0.9.17__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.15 → codegraphcontext_rust-0.9.17}/PKG-INFO +1 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/pyproject.toml +1 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/c_lang.rs +7 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/cpp.rs +8 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/csharp.rs +7 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/dart.rs +4 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/elixir.rs +5 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/go.rs +159 -5
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/haskell.rs +5 -1
- codegraphcontext_rust-0.9.17/rust/cgc-core/src/lang/java.rs +1630 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/javascript.rs +256 -91
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/kotlin.rs +168 -33
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/mod.rs +114 -17
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/perl.rs +4 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/php.rs +6 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/python.rs +86 -24
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/ruby.rs +5 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/rust_lang.rs +7 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/scala.rs +5 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/swift.rs +5 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/tsx.rs +110 -3
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/typescript.rs +37 -7
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/parser.rs +53 -9
- codegraphcontext_rust-0.9.17/rust/cgc-core/src/resolution/calls.rs +1282 -0
- codegraphcontext_rust-0.9.17/rust/cgc-core/src/types.rs +152 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-python/src/conversions.rs +45 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-python/src/lib.rs +57 -2
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/cgc_wiki_cli.py +1 -1
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/context_generator.py +6 -6
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/persistence/duckdb_writer.py +231 -14
- codegraphcontext_rust-0.9.15/rust/cgc-core/src/lang/java.rs +0 -841
- codegraphcontext_rust-0.9.15/rust/cgc-core/src/resolution/calls.rs +0 -588
- codegraphcontext_rust-0.9.15/rust/cgc-core/src/types.rs +0 -92
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/LICENSE +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/README.md +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/Cargo.lock +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/Cargo.toml +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/Cargo.toml +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lib.rs +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/resolution/inheritance.rs +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/resolution/mod.rs +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/sanitize.rs +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-python/Cargo.toml +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/tree-sitter-perl-vendor/Cargo.toml +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/tree-sitter-perl-vendor/build.rs +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/tree-sitter-perl-vendor/src/grammar/alloc.h +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/tree-sitter-perl-vendor/src/grammar/array.h +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/tree-sitter-perl-vendor/src/grammar/parser.c +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/tree-sitter-perl-vendor/src/grammar/parser.h +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/tree-sitter-perl-vendor/src/grammar/scanner.c +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/tree-sitter-perl-vendor/src/grammar/tree_sitter/parser.h +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/tree-sitter-perl-vendor/src/lib.rs +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/cli/cli_helpers.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/cli/config_manager.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/cli/main.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/cli/registry_commands.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/cli/setup_macos.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/cli/setup_wizard.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/cli/visualizer.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/core/__init__.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/core/bundle_registry.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/core/cgc_bundle.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/core/cgcignore.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/core/database.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/core/database_falkordb.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/core/database_falkordb_remote.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/core/database_kuzu.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/core/falkor_worker.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/core/jobs.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/core/watcher.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/prompts.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/server.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tool_definitions.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/advanced_language_query_tool.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/code_finder.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/graph_builder.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/handlers/analysis_handlers.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/handlers/indexing_handlers.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/handlers/management_handlers.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/handlers/query_handlers.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/__init__.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/constants.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/discovery.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/engine.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/execution_flows.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/module_grouping.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/noise_filter.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/op_param_extraction.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/persistence/__init__.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/persistence/parquet_loader.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/persistence/writer.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/pipeline.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/pre_scan.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/rationale_extraction.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/resolution/__init__.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/resolution/calls.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/resolution/inheritance.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/route_extraction.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/sanitize.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/schema.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/schema_contract.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/indexing/scip_pipeline.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/c.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/cpp.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/csharp.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/dart.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/elixir.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/go.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/haskell.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/java.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/javascript.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/kotlin.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/perl.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/php.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/python.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/ruby.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/rust.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/scala.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/swift.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/typescript.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/package_resolver.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/dart_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/perl_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/scip_indexer.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/scip_pb2.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/system.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/tools/tree_sitter_parser.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/utils/debug_log.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/utils/path_ignore.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/utils/repo_path.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/src/codegraphcontext/utils/visualize_graph.py +0 -0
- {codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/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.17"
|
|
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" },
|
{codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/c_lang.rs
RENAMED
|
@@ -3,7 +3,7 @@ use std::collections::HashSet;
|
|
|
3
3
|
use streaming_iterator::StreamingIterator;
|
|
4
4
|
use tree_sitter::{Language, Node, Query, QueryCursor};
|
|
5
5
|
|
|
6
|
-
use super::{get_node_text, get_parent_context, LanguageExtractor};
|
|
6
|
+
use super::{class_kind, get_node_text, get_parent_context, LanguageExtractor};
|
|
7
7
|
use crate::types::*;
|
|
8
8
|
|
|
9
9
|
const COMPLEXITY_TYPES: &[&str] = &[
|
|
@@ -271,6 +271,7 @@ impl LanguageExtractor for CExtractor {
|
|
|
271
271
|
let (context, context_type, _) = self.get_parent_context_c(&func_node, source);
|
|
272
272
|
|
|
273
273
|
let mut func = FunctionData {
|
|
274
|
+
return_type: None,
|
|
274
275
|
name,
|
|
275
276
|
line_number: node.start_position().row + 1,
|
|
276
277
|
end_line: func_node.end_position().row + 1,
|
|
@@ -317,6 +318,7 @@ impl LanguageExtractor for CExtractor {
|
|
|
317
318
|
let (context, _, _) = self.get_parent_context_c(&struct_node, source);
|
|
318
319
|
|
|
319
320
|
let mut class = ClassData {
|
|
321
|
+
kind: class_kind(&struct_node),
|
|
320
322
|
name,
|
|
321
323
|
line_number: struct_node.start_position().row + 1,
|
|
322
324
|
end_line: struct_node.end_position().row + 1,
|
|
@@ -348,6 +350,7 @@ impl LanguageExtractor for CExtractor {
|
|
|
348
350
|
let name = get_node_text(&node, source).to_string();
|
|
349
351
|
|
|
350
352
|
let mut class = ClassData {
|
|
353
|
+
kind: class_kind(&union_node),
|
|
351
354
|
name,
|
|
352
355
|
line_number: union_node.start_position().row + 1,
|
|
353
356
|
end_line: union_node.end_position().row + 1,
|
|
@@ -379,6 +382,7 @@ impl LanguageExtractor for CExtractor {
|
|
|
379
382
|
let name = get_node_text(&node, source).to_string();
|
|
380
383
|
|
|
381
384
|
let mut class = ClassData {
|
|
385
|
+
kind: class_kind(&enum_node),
|
|
382
386
|
name,
|
|
383
387
|
line_number: enum_node.start_position().row + 1,
|
|
384
388
|
end_line: enum_node.end_position().row + 1,
|
|
@@ -410,6 +414,7 @@ impl LanguageExtractor for CExtractor {
|
|
|
410
414
|
let name = get_node_text(&node, source).to_string();
|
|
411
415
|
|
|
412
416
|
let mut class = ClassData {
|
|
417
|
+
kind: class_kind(¯o_node),
|
|
413
418
|
name,
|
|
414
419
|
line_number: macro_node.start_position().row + 1,
|
|
415
420
|
end_line: macro_node.end_position().row + 1,
|
|
@@ -493,6 +498,7 @@ impl LanguageExtractor for CExtractor {
|
|
|
493
498
|
self.get_parent_context_c(&node, source);
|
|
494
499
|
|
|
495
500
|
calls.push(CallData {
|
|
501
|
+
receiver_chain: Vec::new(),
|
|
496
502
|
name: call_name.clone(),
|
|
497
503
|
full_name: call_name,
|
|
498
504
|
line_number: node.start_position().row + 1,
|
|
@@ -3,7 +3,7 @@ use std::collections::HashSet;
|
|
|
3
3
|
use streaming_iterator::StreamingIterator;
|
|
4
4
|
use tree_sitter::{Language, Node, Query, QueryCursor};
|
|
5
5
|
|
|
6
|
-
use super::{get_node_text, LanguageExtractor};
|
|
6
|
+
use super::{class_kind, get_node_text, LanguageExtractor};
|
|
7
7
|
use crate::types::*;
|
|
8
8
|
|
|
9
9
|
const COMPLEXITY_TYPES: &[&str] = &[
|
|
@@ -346,6 +346,7 @@ impl CppExtractor {
|
|
|
346
346
|
let name = get_node_text(&node, source).to_string();
|
|
347
347
|
|
|
348
348
|
let mut class = ClassData {
|
|
349
|
+
kind: class_kind(&struct_node),
|
|
349
350
|
name,
|
|
350
351
|
line_number: struct_node.start_position().row + 1,
|
|
351
352
|
end_line: struct_node.end_position().row + 1,
|
|
@@ -385,6 +386,7 @@ impl CppExtractor {
|
|
|
385
386
|
let name = get_node_text(&node, source).to_string();
|
|
386
387
|
|
|
387
388
|
let mut class = ClassData {
|
|
389
|
+
kind: class_kind(&enum_node),
|
|
388
390
|
name,
|
|
389
391
|
line_number: enum_node.start_position().row + 1,
|
|
390
392
|
end_line: enum_node.end_position().row + 1,
|
|
@@ -424,6 +426,7 @@ impl CppExtractor {
|
|
|
424
426
|
let name = get_node_text(&node, source).to_string();
|
|
425
427
|
|
|
426
428
|
let mut class = ClassData {
|
|
429
|
+
kind: class_kind(&union_node),
|
|
427
430
|
name,
|
|
428
431
|
line_number: union_node.start_position().row + 1,
|
|
429
432
|
end_line: union_node.end_position().row + 1,
|
|
@@ -463,6 +466,7 @@ impl CppExtractor {
|
|
|
463
466
|
let name = get_node_text(&node, source).to_string();
|
|
464
467
|
|
|
465
468
|
let mut class = ClassData {
|
|
469
|
+
kind: class_kind(¯o_node),
|
|
466
470
|
name,
|
|
467
471
|
line_number: macro_node.start_position().row + 1,
|
|
468
472
|
end_line: macro_node.end_position().row + 1,
|
|
@@ -549,6 +553,7 @@ impl LanguageExtractor for CppExtractor {
|
|
|
549
553
|
let class_ctx = class_context.or_else(|| self.get_class_context_cpp(&func_node, source));
|
|
550
554
|
|
|
551
555
|
let mut func = FunctionData {
|
|
556
|
+
return_type: None,
|
|
552
557
|
name,
|
|
553
558
|
line_number: node.start_position().row + 1,
|
|
554
559
|
end_line: func_node.end_position().row + 1,
|
|
@@ -602,6 +607,7 @@ impl LanguageExtractor for CppExtractor {
|
|
|
602
607
|
let bases = self.extract_base_classes(&node, source);
|
|
603
608
|
|
|
604
609
|
let mut class = ClassData {
|
|
610
|
+
kind: class_kind(&node),
|
|
605
611
|
name,
|
|
606
612
|
line_number: node.start_position().row + 1,
|
|
607
613
|
end_line: node.end_position().row + 1,
|
|
@@ -707,6 +713,7 @@ impl LanguageExtractor for CppExtractor {
|
|
|
707
713
|
let class_context = self.get_class_context_cpp(&node, source);
|
|
708
714
|
|
|
709
715
|
calls.push(CallData {
|
|
716
|
+
receiver_chain: Vec::new(),
|
|
710
717
|
name: func_name,
|
|
711
718
|
full_name: raw_text.to_string(),
|
|
712
719
|
line_number: node.start_position().row + 1,
|
{codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/csharp.rs
RENAMED
|
@@ -3,7 +3,7 @@ use std::collections::HashSet;
|
|
|
3
3
|
use streaming_iterator::StreamingIterator;
|
|
4
4
|
use tree_sitter::{Language, Node, Query, QueryCursor};
|
|
5
5
|
|
|
6
|
-
use super::{get_node_text, get_parent_context, LanguageExtractor};
|
|
6
|
+
use super::{class_kind, get_node_text, get_parent_context, LanguageExtractor};
|
|
7
7
|
use crate::types::*;
|
|
8
8
|
|
|
9
9
|
const COMPLEXITY_TYPES: &[&str] = &[
|
|
@@ -256,6 +256,7 @@ impl LanguageExtractor for CSharpExtractor {
|
|
|
256
256
|
let class_context = self.get_class_context_csharp(&func_node, source);
|
|
257
257
|
|
|
258
258
|
let mut func = FunctionData {
|
|
259
|
+
return_type: None,
|
|
259
260
|
name,
|
|
260
261
|
line_number: node.start_position().row + 1,
|
|
261
262
|
end_line: func_node.end_position().row + 1,
|
|
@@ -303,6 +304,7 @@ impl LanguageExtractor for CSharpExtractor {
|
|
|
303
304
|
let (context, _, _) = self.get_parent_context_csharp(&class_node, source);
|
|
304
305
|
|
|
305
306
|
let mut class = ClassData {
|
|
307
|
+
kind: class_kind(&class_node),
|
|
306
308
|
name,
|
|
307
309
|
line_number: class_node.start_position().row + 1,
|
|
308
310
|
end_line: class_node.end_position().row + 1,
|
|
@@ -335,6 +337,7 @@ impl LanguageExtractor for CSharpExtractor {
|
|
|
335
337
|
let bases = self.extract_base_list(&iface_node, source);
|
|
336
338
|
|
|
337
339
|
let mut class = ClassData {
|
|
340
|
+
kind: class_kind(&iface_node),
|
|
338
341
|
name,
|
|
339
342
|
line_number: iface_node.start_position().row + 1,
|
|
340
343
|
end_line: iface_node.end_position().row + 1,
|
|
@@ -367,6 +370,7 @@ impl LanguageExtractor for CSharpExtractor {
|
|
|
367
370
|
let bases = self.extract_base_list(&struct_node, source);
|
|
368
371
|
|
|
369
372
|
let mut class = ClassData {
|
|
373
|
+
kind: class_kind(&struct_node),
|
|
370
374
|
name,
|
|
371
375
|
line_number: struct_node.start_position().row + 1,
|
|
372
376
|
end_line: struct_node.end_position().row + 1,
|
|
@@ -398,6 +402,7 @@ impl LanguageExtractor for CSharpExtractor {
|
|
|
398
402
|
let name = get_node_text(&node, source).to_string();
|
|
399
403
|
|
|
400
404
|
let mut class = ClassData {
|
|
405
|
+
kind: class_kind(&enum_node),
|
|
401
406
|
name,
|
|
402
407
|
line_number: enum_node.start_position().row + 1,
|
|
403
408
|
end_line: enum_node.end_position().row + 1,
|
|
@@ -489,6 +494,7 @@ impl LanguageExtractor for CSharpExtractor {
|
|
|
489
494
|
let class_context = self.get_class_context_csharp(&node, source);
|
|
490
495
|
|
|
491
496
|
calls.push(CallData {
|
|
497
|
+
receiver_chain: Vec::new(),
|
|
492
498
|
name: call_name.clone(),
|
|
493
499
|
full_name: call_name,
|
|
494
500
|
line_number,
|
{codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/dart.rs
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
use streaming_iterator::StreamingIterator;
|
|
2
2
|
use tree_sitter::{Language, Node, Query, QueryCursor};
|
|
3
3
|
|
|
4
|
-
use super::{get_node_text, get_parent_context, LanguageExtractor};
|
|
4
|
+
use super::{class_kind, get_node_text, get_parent_context, LanguageExtractor};
|
|
5
5
|
use crate::types::*;
|
|
6
6
|
|
|
7
7
|
const COMPLEXITY_TYPES: &[&str] = &[
|
|
@@ -224,6 +224,7 @@ impl LanguageExtractor for DartExtractor {
|
|
|
224
224
|
);
|
|
225
225
|
|
|
226
226
|
let mut func = FunctionData {
|
|
227
|
+
return_type: None,
|
|
227
228
|
name,
|
|
228
229
|
line_number: node.start_position().row + 1,
|
|
229
230
|
end_line,
|
|
@@ -303,6 +304,7 @@ impl LanguageExtractor for DartExtractor {
|
|
|
303
304
|
let (context, _, _) = get_parent_context(&node, source, FC_TYPES);
|
|
304
305
|
|
|
305
306
|
let mut class = ClassData {
|
|
307
|
+
kind: class_kind(&node),
|
|
306
308
|
name,
|
|
307
309
|
line_number: node.start_position().row + 1,
|
|
308
310
|
end_line: node.end_position().row + 1,
|
|
@@ -381,6 +383,7 @@ impl LanguageExtractor for DartExtractor {
|
|
|
381
383
|
);
|
|
382
384
|
|
|
383
385
|
calls.push(CallData {
|
|
386
|
+
receiver_chain: Vec::new(),
|
|
384
387
|
name: call_name.clone(),
|
|
385
388
|
full_name: call_name,
|
|
386
389
|
line_number: node.start_position().row + 1,
|
{codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/elixir.rs
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
use streaming_iterator::StreamingIterator;
|
|
2
2
|
use tree_sitter::{Language, Node, Query, QueryCursor};
|
|
3
3
|
|
|
4
|
-
use super::{get_node_text, LanguageExtractor};
|
|
4
|
+
use super::{class_kind, get_node_text, LanguageExtractor};
|
|
5
5
|
use crate::types::*;
|
|
6
6
|
|
|
7
7
|
const COMPLEXITY_TYPES: &[&str] = &[
|
|
@@ -246,6 +246,7 @@ impl ElixirExtractor {
|
|
|
246
246
|
let module_name = self.enclosing_module_name(node, source);
|
|
247
247
|
|
|
248
248
|
let mut func = FunctionData {
|
|
249
|
+
return_type: None,
|
|
249
250
|
name,
|
|
250
251
|
line_number: node.start_position().row + 1,
|
|
251
252
|
end_line: node.end_position().row + 1,
|
|
@@ -318,6 +319,7 @@ impl ElixirExtractor {
|
|
|
318
319
|
if let Some(name) = module_name {
|
|
319
320
|
if has_do_block {
|
|
320
321
|
let mut class = ClassData {
|
|
322
|
+
kind: class_kind(&node),
|
|
321
323
|
name,
|
|
322
324
|
line_number: node.start_position().row + 1,
|
|
323
325
|
end_line: node.end_position().row + 1,
|
|
@@ -452,6 +454,7 @@ impl ElixirExtractor {
|
|
|
452
454
|
self.get_elixir_parent_context(node, source);
|
|
453
455
|
|
|
454
456
|
calls.push(CallData {
|
|
457
|
+
receiver_chain: Vec::new(),
|
|
455
458
|
name: name.clone(),
|
|
456
459
|
full_name,
|
|
457
460
|
line_number: node.start_position().row + 1,
|
|
@@ -472,6 +475,7 @@ impl ElixirExtractor {
|
|
|
472
475
|
self.get_elixir_parent_context(node, source);
|
|
473
476
|
|
|
474
477
|
calls.push(CallData {
|
|
478
|
+
receiver_chain: Vec::new(),
|
|
475
479
|
name: name.clone(),
|
|
476
480
|
full_name: name,
|
|
477
481
|
line_number: node.start_position().row + 1,
|
|
@@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet};
|
|
|
3
3
|
use streaming_iterator::StreamingIterator;
|
|
4
4
|
use tree_sitter::{Language, Node, Query, QueryCursor};
|
|
5
5
|
|
|
6
|
-
use super::{get_node_text, get_parent_context, LanguageExtractor};
|
|
6
|
+
use super::{class_kind, get_node_text, get_parent_context, LanguageExtractor};
|
|
7
7
|
use crate::types::*;
|
|
8
8
|
|
|
9
9
|
const COMPLEXITY_TYPES: &[&str] = &[
|
|
@@ -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 {
|
|
@@ -338,6 +404,7 @@ impl LanguageExtractor for GoExtractor {
|
|
|
338
404
|
let complexity = self.calculate_go_complexity(func_node, source);
|
|
339
405
|
|
|
340
406
|
let mut func = FunctionData {
|
|
407
|
+
return_type: None,
|
|
341
408
|
name,
|
|
342
409
|
line_number: func_node.start_position().row + 1,
|
|
343
410
|
end_line: func_node.end_position().row + 1,
|
|
@@ -382,12 +449,19 @@ impl LanguageExtractor for GoExtractor {
|
|
|
382
449
|
None => continue,
|
|
383
450
|
};
|
|
384
451
|
let name = get_node_text(&node, source).to_string();
|
|
452
|
+
let bases = node
|
|
453
|
+
.parent()
|
|
454
|
+
.and_then(|spec| spec.child_by_field_name("type"))
|
|
455
|
+
.filter(|t| t.kind() == "struct_type")
|
|
456
|
+
.map(|t| self.struct_embedded_bases(&t, source))
|
|
457
|
+
.unwrap_or_default();
|
|
385
458
|
|
|
386
459
|
let mut class = ClassData {
|
|
460
|
+
kind: class_kind(&type_decl),
|
|
387
461
|
name,
|
|
388
462
|
line_number: type_decl.start_position().row + 1,
|
|
389
463
|
end_line: type_decl.end_position().row + 1,
|
|
390
|
-
bases
|
|
464
|
+
bases,
|
|
391
465
|
context: None,
|
|
392
466
|
decorators: Vec::new(),
|
|
393
467
|
lang: self.lang_name().to_string(),
|
|
@@ -414,12 +488,19 @@ impl LanguageExtractor for GoExtractor {
|
|
|
414
488
|
None => continue,
|
|
415
489
|
};
|
|
416
490
|
let name = get_node_text(&node, source).to_string();
|
|
491
|
+
let bases = node
|
|
492
|
+
.parent()
|
|
493
|
+
.and_then(|spec| spec.child_by_field_name("type"))
|
|
494
|
+
.filter(|t| t.kind() == "interface_type")
|
|
495
|
+
.map(|t| self.interface_embedded_bases(&t, source))
|
|
496
|
+
.unwrap_or_default();
|
|
417
497
|
|
|
418
498
|
let mut class = ClassData {
|
|
499
|
+
kind: class_kind(&type_decl),
|
|
419
500
|
name,
|
|
420
501
|
line_number: type_decl.start_position().row + 1,
|
|
421
502
|
end_line: type_decl.end_position().row + 1,
|
|
422
|
-
bases
|
|
503
|
+
bases,
|
|
423
504
|
context: None,
|
|
424
505
|
decorators: Vec::new(),
|
|
425
506
|
lang: self.lang_name().to_string(),
|
|
@@ -532,6 +613,7 @@ impl LanguageExtractor for GoExtractor {
|
|
|
532
613
|
let context = get_parent_context(&node, source, fc_types);
|
|
533
614
|
|
|
534
615
|
calls.push(CallData {
|
|
616
|
+
receiver_chain: Vec::new(),
|
|
535
617
|
name,
|
|
536
618
|
full_name,
|
|
537
619
|
line_number,
|
|
@@ -668,6 +750,78 @@ type Speaker interface {
|
|
|
668
750
|
assert!(classes.iter().any(|c| c.name == "Speaker"));
|
|
669
751
|
}
|
|
670
752
|
|
|
753
|
+
#[test]
|
|
754
|
+
fn test_struct_embedded_fields_as_bases() {
|
|
755
|
+
let code = r#"
|
|
756
|
+
package main
|
|
757
|
+
|
|
758
|
+
type Server struct {
|
|
759
|
+
Base
|
|
760
|
+
*Logger
|
|
761
|
+
http.Handler
|
|
762
|
+
name string
|
|
763
|
+
a, b int
|
|
764
|
+
}
|
|
765
|
+
"#;
|
|
766
|
+
let (tree, source) = parse_source(code);
|
|
767
|
+
let ext = GoExtractor;
|
|
768
|
+
let classes = ext.find_classes(&tree.root_node(), &source, false);
|
|
769
|
+
let server = classes.iter().find(|c| c.name == "Server").unwrap();
|
|
770
|
+
assert_eq!(server.bases, vec!["Base", "Logger", "Handler"]);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
#[test]
|
|
774
|
+
fn test_interface_embedding_as_bases() {
|
|
775
|
+
let code = r#"
|
|
776
|
+
package main
|
|
777
|
+
|
|
778
|
+
type ReadCloser interface {
|
|
779
|
+
io.Reader
|
|
780
|
+
Closer
|
|
781
|
+
Extra() int
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
type Number interface {
|
|
785
|
+
~int | ~float64
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
type Key interface {
|
|
789
|
+
comparable
|
|
790
|
+
}
|
|
791
|
+
"#;
|
|
792
|
+
let (tree, source) = parse_source(code);
|
|
793
|
+
let ext = GoExtractor;
|
|
794
|
+
let classes = ext.find_classes(&tree.root_node(), &source, false);
|
|
795
|
+
let rc = classes.iter().find(|c| c.name == "ReadCloser").unwrap();
|
|
796
|
+
assert_eq!(rc.bases, vec!["Reader", "Closer"]);
|
|
797
|
+
let num = classes.iter().find(|c| c.name == "Number").unwrap();
|
|
798
|
+
assert!(num.bases.is_empty());
|
|
799
|
+
let key = classes.iter().find(|c| c.name == "Key").unwrap();
|
|
800
|
+
assert!(key.bases.is_empty());
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
#[test]
|
|
804
|
+
fn test_generic_receiver_strips_type_params() {
|
|
805
|
+
let code = r#"
|
|
806
|
+
package main
|
|
807
|
+
|
|
808
|
+
type List[T any] struct {
|
|
809
|
+
items []T
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
func (l *List[T]) Push(v T) {}
|
|
813
|
+
|
|
814
|
+
func (p Pair[K, V]) Key() K { return p.k }
|
|
815
|
+
"#;
|
|
816
|
+
let (tree, source) = parse_source(code);
|
|
817
|
+
let ext = GoExtractor;
|
|
818
|
+
let funcs = ext.find_functions(&tree.root_node(), &source, false);
|
|
819
|
+
let push = funcs.iter().find(|f| f.name == "Push").unwrap();
|
|
820
|
+
assert_eq!(push.class_context.as_deref(), Some("List"));
|
|
821
|
+
let key = funcs.iter().find(|f| f.name == "Key").unwrap();
|
|
822
|
+
assert_eq!(key.class_context.as_deref(), Some("Pair"));
|
|
823
|
+
}
|
|
824
|
+
|
|
671
825
|
#[test]
|
|
672
826
|
fn test_find_imports() {
|
|
673
827
|
let code = r#"
|
{codegraphcontext_rust-0.9.15 → codegraphcontext_rust-0.9.17}/rust/cgc-core/src/lang/haskell.rs
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
use streaming_iterator::StreamingIterator;
|
|
2
2
|
use tree_sitter::{Language, Node, Query, QueryCursor};
|
|
3
3
|
|
|
4
|
-
use super::{get_node_text, get_parent_context, LanguageExtractor};
|
|
4
|
+
use super::{class_kind, get_node_text, get_parent_context, LanguageExtractor};
|
|
5
5
|
use crate::types::*;
|
|
6
6
|
|
|
7
7
|
const COMPLEXITY_TYPES: &[&str] = &[
|
|
@@ -158,6 +158,7 @@ impl LanguageExtractor for HaskellExtractor {
|
|
|
158
158
|
let complexity = self.calculate_complexity(&node);
|
|
159
159
|
|
|
160
160
|
let mut func = FunctionData {
|
|
161
|
+
return_type: None,
|
|
161
162
|
name: func_name,
|
|
162
163
|
line_number: node.start_position().row + 1,
|
|
163
164
|
end_line: node.end_position().row + 1,
|
|
@@ -204,6 +205,7 @@ impl LanguageExtractor for HaskellExtractor {
|
|
|
204
205
|
);
|
|
205
206
|
|
|
206
207
|
let mut func = FunctionData {
|
|
208
|
+
return_type: None,
|
|
207
209
|
name: func_name,
|
|
208
210
|
line_number: node.start_position().row + 1,
|
|
209
211
|
end_line: node.end_position().row + 1,
|
|
@@ -255,6 +257,7 @@ impl LanguageExtractor for HaskellExtractor {
|
|
|
255
257
|
let class_name = get_node_text(&name_node, source).to_string();
|
|
256
258
|
|
|
257
259
|
let mut class = ClassData {
|
|
260
|
+
kind: class_kind(&node),
|
|
258
261
|
name: class_name,
|
|
259
262
|
line_number: node.start_position().row + 1,
|
|
260
263
|
end_line: node.end_position().row + 1,
|
|
@@ -341,6 +344,7 @@ impl LanguageExtractor for HaskellExtractor {
|
|
|
341
344
|
);
|
|
342
345
|
|
|
343
346
|
calls.push(CallData {
|
|
347
|
+
receiver_chain: Vec::new(),
|
|
344
348
|
name: call_name.clone(),
|
|
345
349
|
full_name: call_name,
|
|
346
350
|
line_number: node.start_position().row + 1,
|