#
tokens: 49566/50000 19/367 files (page 4/18)
lines: on (toggle) GitHub
raw markdown copy reset
This is page 4 of 18. Use http://codebase.md/shashankss1205/codegraphcontext?lines=true&page={x} to view the full context.

# Directory Structure

```
├── .github
│   └── workflows
│       ├── e2e-tests.yml
│       ├── post_discord_invite.yml
│       ├── test.yml
│       └── update-contributors.yml
├── .gitignore
├── CONTRIBUTING.md
├── contributors.md
├── docs
│   ├── docs
│   │   ├── architecture.md
│   │   ├── cli.md
│   │   ├── contributing_languages.md
│   │   ├── contributing.md
│   │   ├── cookbook.md
│   │   ├── core.md
│   │   ├── future_work.md
│   │   ├── images
│   │   │   ├── 1.png
│   │   │   ├── 11.png
│   │   │   ├── 12.png
│   │   │   ├── 13.png
│   │   │   ├── 14.png
│   │   │   ├── 16.png
│   │   │   ├── 19.png
│   │   │   ├── 2.png
│   │   │   ├── 20.png
│   │   │   ├── 21.png
│   │   │   ├── 22.png
│   │   │   ├── 23.png
│   │   │   ├── 24.png
│   │   │   ├── 26.png
│   │   │   ├── 28.png
│   │   │   ├── 29.png
│   │   │   ├── 3.png
│   │   │   ├── 30.png
│   │   │   ├── 31.png
│   │   │   ├── 32.png
│   │   │   ├── 33.png
│   │   │   ├── 34.png
│   │   │   ├── 35.png
│   │   │   ├── 36.png
│   │   │   ├── 38.png
│   │   │   ├── 39.png
│   │   │   ├── 4.png
│   │   │   ├── 40.png
│   │   │   ├── 41.png
│   │   │   ├── 42.png
│   │   │   ├── 43.png
│   │   │   ├── 44.png
│   │   │   ├── 5.png
│   │   │   ├── 6.png
│   │   │   ├── 7.png
│   │   │   ├── 8.png
│   │   │   ├── 9.png
│   │   │   ├── Indexing.gif
│   │   │   ├── tool_images
│   │   │   │   ├── 1.png
│   │   │   │   ├── 2.png
│   │   │   │   └── 3.png
│   │   │   └── Usecase.gif
│   │   ├── index.md
│   │   ├── installation.md
│   │   ├── license.md
│   │   ├── server.md
│   │   ├── tools.md
│   │   ├── troubleshooting.md
│   │   └── use_cases.md
│   ├── mkdocs.yml
│   └── site
│       ├── 404.html
│       ├── architecture
│       │   └── index.html
│       ├── assets
│       │   ├── images
│       │   │   └── favicon.png
│       │   ├── javascripts
│       │   │   ├── bundle.f55a23d4.min.js
│       │   │   ├── bundle.f55a23d4.min.js.map
│       │   │   ├── lunr
│       │   │   │   ├── min
│       │   │   │   │   ├── lunr.ar.min.js
│       │   │   │   │   ├── lunr.da.min.js
│       │   │   │   │   ├── lunr.de.min.js
│       │   │   │   │   ├── lunr.du.min.js
│       │   │   │   │   ├── lunr.el.min.js
│       │   │   │   │   ├── lunr.es.min.js
│       │   │   │   │   ├── lunr.fi.min.js
│       │   │   │   │   ├── lunr.fr.min.js
│       │   │   │   │   ├── lunr.he.min.js
│       │   │   │   │   ├── lunr.hi.min.js
│       │   │   │   │   ├── lunr.hu.min.js
│       │   │   │   │   ├── lunr.hy.min.js
│       │   │   │   │   ├── lunr.it.min.js
│       │   │   │   │   ├── lunr.ja.min.js
│       │   │   │   │   ├── lunr.jp.min.js
│       │   │   │   │   ├── lunr.kn.min.js
│       │   │   │   │   ├── lunr.ko.min.js
│       │   │   │   │   ├── lunr.multi.min.js
│       │   │   │   │   ├── lunr.nl.min.js
│       │   │   │   │   ├── lunr.no.min.js
│       │   │   │   │   ├── lunr.pt.min.js
│       │   │   │   │   ├── lunr.ro.min.js
│       │   │   │   │   ├── lunr.ru.min.js
│       │   │   │   │   ├── lunr.sa.min.js
│       │   │   │   │   ├── lunr.stemmer.support.min.js
│       │   │   │   │   ├── lunr.sv.min.js
│       │   │   │   │   ├── lunr.ta.min.js
│       │   │   │   │   ├── lunr.te.min.js
│       │   │   │   │   ├── lunr.th.min.js
│       │   │   │   │   ├── lunr.tr.min.js
│       │   │   │   │   ├── lunr.vi.min.js
│       │   │   │   │   └── lunr.zh.min.js
│       │   │   │   ├── tinyseg.js
│       │   │   │   └── wordcut.js
│       │   │   └── workers
│       │   │       ├── search.973d3a69.min.js
│       │   │       └── search.973d3a69.min.js.map
│       │   └── stylesheets
│       │       ├── main.2a3383ac.min.css
│       │       ├── main.2a3383ac.min.css.map
│       │       ├── palette.06af60db.min.css
│       │       └── palette.06af60db.min.css.map
│       ├── cli
│       │   └── index.html
│       ├── contributing
│       │   └── index.html
│       ├── contributing_languages
│       │   └── index.html
│       ├── cookbook
│       │   └── index.html
│       ├── core
│       │   └── index.html
│       ├── future_work
│       │   └── index.html
│       ├── images
│       │   ├── 1.png
│       │   ├── 11.png
│       │   ├── 12.png
│       │   ├── 13.png
│       │   ├── 14.png
│       │   ├── 16.png
│       │   ├── 19.png
│       │   ├── 2.png
│       │   ├── 20.png
│       │   ├── 21.png
│       │   ├── 22.png
│       │   ├── 23.png
│       │   ├── 24.png
│       │   ├── 26.png
│       │   ├── 28.png
│       │   ├── 29.png
│       │   ├── 3.png
│       │   ├── 30.png
│       │   ├── 31.png
│       │   ├── 32.png
│       │   ├── 33.png
│       │   ├── 34.png
│       │   ├── 35.png
│       │   ├── 36.png
│       │   ├── 38.png
│       │   ├── 39.png
│       │   ├── 4.png
│       │   ├── 40.png
│       │   ├── 41.png
│       │   ├── 42.png
│       │   ├── 43.png
│       │   ├── 44.png
│       │   ├── 5.png
│       │   ├── 6.png
│       │   ├── 7.png
│       │   ├── 8.png
│       │   ├── 9.png
│       │   ├── Indexing.gif
│       │   ├── tool_images
│       │   │   ├── 1.png
│       │   │   ├── 2.png
│       │   │   └── 3.png
│       │   └── Usecase.gif
│       ├── index.html
│       ├── installation
│       │   └── index.html
│       ├── license
│       │   └── index.html
│       ├── search
│       │   └── search_index.json
│       ├── server
│       │   └── index.html
│       ├── sitemap.xml
│       ├── sitemap.xml.gz
│       ├── tools
│       │   └── index.html
│       ├── troubleshooting
│       │   └── index.html
│       └── use_cases
│           └── index.html
├── images
│   ├── 1.png
│   ├── 11.png
│   ├── 12.png
│   ├── 13.png
│   ├── 14.png
│   ├── 16.png
│   ├── 19.png
│   ├── 2.png
│   ├── 20.png
│   ├── 21.png
│   ├── 22.png
│   ├── 23.png
│   ├── 24.png
│   ├── 26.png
│   ├── 28.png
│   ├── 29.png
│   ├── 3.png
│   ├── 30.png
│   ├── 31.png
│   ├── 32.png
│   ├── 33.png
│   ├── 34.png
│   ├── 35.png
│   ├── 36.png
│   ├── 38.png
│   ├── 39.png
│   ├── 4.png
│   ├── 40.png
│   ├── 41.png
│   ├── 42.png
│   ├── 43.png
│   ├── 44.png
│   ├── 5.png
│   ├── 6.png
│   ├── 7.png
│   ├── 8.png
│   ├── 9.png
│   ├── Indexing.gif
│   ├── tool_images
│   │   ├── 1.png
│   │   ├── 2.png
│   │   └── 3.png
│   └── Usecase.gif
├── LICENSE
├── MANIFEST.in
├── organizer
│   ├── CONTRIBUTING_LANGUAGES.md
│   ├── cookbook.md
│   ├── docs.md
│   ├── language_specific_nodes.md
│   ├── Tools_Exploration.md
│   └── troubleshoot.md
├── package-lock.json
├── pyproject.toml
├── README.md
├── scripts
│   ├── generate_lang_contributors.py
│   └── post_install_fix.sh
├── SECURITY.md
├── src
│   └── codegraphcontext
│       ├── __init__.py
│       ├── __main__.py
│       ├── cli
│       │   ├── __init__.py
│       │   ├── cli_helpers.py
│       │   ├── main.py
│       │   ├── setup_macos.py
│       │   └── setup_wizard.py
│       ├── core
│       │   ├── __init__.py
│       │   ├── database.py
│       │   ├── jobs.py
│       │   └── watcher.py
│       ├── prompts.py
│       ├── server.py
│       ├── tools
│       │   ├── __init__.py
│       │   ├── advanced_language_query_tool.py
│       │   ├── code_finder.py
│       │   ├── graph_builder.py
│       │   ├── languages
│       │   │   ├── c.py
│       │   │   ├── cpp.py
│       │   │   ├── go.py
│       │   │   ├── java.py
│       │   │   ├── javascript.py
│       │   │   ├── python.py
│       │   │   ├── ruby.py
│       │   │   ├── rust.py
│       │   │   └── typescript.py
│       │   ├── package_resolver.py
│       │   ├── query_tool_languages
│       │   │   ├── c_toolkit.py
│       │   │   ├── cpp_toolkit.py
│       │   │   ├── go_toolkit.py
│       │   │   ├── java_toolkit.py
│       │   │   ├── javascript_toolkit.py
│       │   │   ├── python_toolkit.py
│       │   │   ├── ruby_toolkit.py
│       │   │   ├── rust_toolkit.py
│       │   │   └── typescript_toolkit.py
│       │   └── system.py
│       └── utils
│           └── debug_log.py
├── tests
│   ├── __init__.py
│   ├── conftest.py
│   ├── sample_project
│   │   ├── advanced_calls.py
│   │   ├── advanced_classes.py
│   │   ├── advanced_classes2.py
│   │   ├── advanced_functions.py
│   │   ├── advanced_imports.py
│   │   ├── async_features.py
│   │   ├── callbacks_decorators.py
│   │   ├── circular1.py
│   │   ├── circular2.py
│   │   ├── class_instantiation.py
│   │   ├── cli_and_dunder.py
│   │   ├── complex_classes.py
│   │   ├── comprehensions_generators.py
│   │   ├── context_managers.py
│   │   ├── control_flow.py
│   │   ├── datatypes.py
│   │   ├── dynamic_dispatch.py
│   │   ├── dynamic_imports.py
│   │   ├── edge_cases
│   │   │   ├── comments_only.py
│   │   │   ├── docstring_only.py
│   │   │   ├── empty.py
│   │   │   ├── hardcoded_secrets.py
│   │   │   ├── long_functions.py
│   │   │   └── syntax_error.py
│   │   ├── function_chains.py
│   │   ├── generators.py
│   │   ├── import_reexports.py
│   │   ├── mapping_calls.py
│   │   ├── module_a.py
│   │   ├── module_b.py
│   │   ├── module_c
│   │   │   ├── __init__.py
│   │   │   ├── submodule1.py
│   │   │   └── submodule2.py
│   │   ├── namespace_pkg
│   │   │   └── ns_module.py
│   │   ├── pattern_matching.py
│   │   └── typing_examples.py
│   ├── sample_project_c
│   │   ├── cgc_sample
│   │   ├── include
│   │   │   ├── config.h
│   │   │   ├── math
│   │   │   │   └── vec.h
│   │   │   ├── module.h
│   │   │   ├── platform.h
│   │   │   └── util.h
│   │   ├── Makefile
│   │   ├── README.md
│   │   └── src
│   │       ├── main.c
│   │       ├── math
│   │       │   └── vec.c
│   │       ├── module.c
│   │       └── util.c
│   ├── sample_project_cpp
│   │   ├── class_features.cpp
│   │   ├── classes.cpp
│   │   ├── control_flow.cpp
│   │   ├── edge_cases.cpp
│   │   ├── enum_struct_union.cpp
│   │   ├── exceptions.cpp
│   │   ├── file_io.cpp
│   │   ├── function_chain.cpp
│   │   ├── function_chain.h
│   │   ├── function_types.cpp
│   │   ├── main.cpp
│   │   ├── main.exe
│   │   ├── namespaces.cpp
│   │   ├── raii_example.cpp
│   │   ├── README.md
│   │   ├── sample_project.exe
│   │   ├── stl_usage.cpp
│   │   ├── templates.cpp
│   │   └── types_variable_assignments.cpp
│   ├── sample_project_go
│   │   ├── advanced_types.go
│   │   ├── basic_functions.go
│   │   ├── embedded_composition.go
│   │   ├── error_handling.go
│   │   ├── generics.go
│   │   ├── go.mod
│   │   ├── goroutines_channels.go
│   │   ├── interfaces.go
│   │   ├── packages_imports.go
│   │   ├── README.md
│   │   ├── structs_methods.go
│   │   └── util
│   │       └── helpers.go
│   ├── sample_project_java
│   │   ├── out
│   │   │   └── com
│   │   │       └── example
│   │   │           └── app
│   │   │               ├── annotations
│   │   │               │   └── Logged.class
│   │   │               ├── Main.class
│   │   │               ├── misc
│   │   │               │   ├── Outer.class
│   │   │               │   └── Outer$Inner.class
│   │   │               ├── model
│   │   │               │   ├── Role.class
│   │   │               │   └── User.class
│   │   │               ├── service
│   │   │               │   ├── AbstractGreeter.class
│   │   │               │   ├── GreetingService.class
│   │   │               │   └── impl
│   │   │               │       └── GreetingServiceImpl.class
│   │   │               └── util
│   │   │                   ├── CollectionUtils.class
│   │   │                   └── IOHelper.class
│   │   ├── README.md
│   │   ├── sources.txt
│   │   └── src
│   │       └── com
│   │           └── example
│   │               └── app
│   │                   ├── annotations
│   │                   │   └── Logged.java
│   │                   ├── Main.java
│   │                   ├── misc
│   │                   │   └── Outer.java
│   │                   ├── model
│   │                   │   ├── Role.java
│   │                   │   └── User.java
│   │                   ├── service
│   │                   │   ├── AbstractGreeter.java
│   │                   │   ├── GreetingService.java
│   │                   │   └── impl
│   │                   │       └── GreetingServiceImpl.java
│   │                   └── util
│   │                       ├── CollectionUtils.java
│   │                       └── IOHelper.java
│   ├── sample_project_javascript
│   │   ├── arrays.js
│   │   ├── asyncAwait.js
│   │   ├── classes.js
│   │   ├── dom.js
│   │   ├── errorHandling.js
│   │   ├── events.js
│   │   ├── exporter.js
│   │   ├── fetchAPI.js
│   │   ├── fixtures
│   │   │   └── js
│   │   │       └── accessors.js
│   │   ├── functions.js
│   │   ├── importer.js
│   │   ├── objects.js
│   │   ├── promises.js
│   │   ├── README.md
│   │   └── variables.js
│   ├── sample_project_misc
│   │   ├── index.html
│   │   ├── README.md
│   │   ├── styles.css
│   │   ├── tables.css
│   │   └── tables.html
│   ├── sample_project_php
│   │   ├── classes_objects.php
│   │   ├── database.php
│   │   ├── edgecases.php
│   │   ├── error_handling.php
│   │   ├── file_handling.php
│   │   ├── functions.php
│   │   ├── generators_iterators.php
│   │   ├── globals_superglobals.php
│   │   ├── Inheritance.php
│   │   ├── interface_traits.php
│   │   └── README.md
│   ├── sample_project_ruby
│   │   ├── class_example.rb
│   │   ├── enumerables.rb
│   │   ├── error_handling.rb
│   │   ├── file_io.rb
│   │   ├── inheritance_example.rb
│   │   ├── main.rb
│   │   ├── metaprogramming.rb
│   │   ├── mixins_example.rb
│   │   ├── module_example.rb
│   │   └── tests
│   │       ├── test_mixins.py
│   │       └── test_sample.rb
│   ├── sample_project_rust
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   └── src
│   │       ├── basic_functions.rs
│   │       ├── concurrency.rs
│   │       ├── error_handling.rs
│   │       ├── generics.rs
│   │       ├── iterators_closures.rs
│   │       ├── lib.rs
│   │       ├── lifetimes_references.rs
│   │       ├── modules.rs
│   │       ├── smart_pointers.rs
│   │       ├── structs_enums.rs
│   │       └── traits.rs
│   ├── sample_project_typescript
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── src
│   │   │   ├── advanced-types.ts
│   │   │   ├── async-promises.ts
│   │   │   ├── classes-inheritance.ts
│   │   │   ├── decorators-metadata.ts
│   │   │   ├── error-validation.ts
│   │   │   ├── functions-generics.ts
│   │   │   ├── index.ts
│   │   │   ├── modules-namespaces.ts
│   │   │   ├── types-interfaces.ts
│   │   │   └── utilities-helpers.ts
│   │   └── tsconfig.json
│   ├── test_cpp_parser.py
│   ├── test_database_validation.py
│   ├── test_end_to_end.py
│   ├── test_graph_indexing_js.py
│   ├── test_graph_indexing.py
│   ├── test_tree_sitter
│   │   ├── __init__.py
│   │   ├── class_instantiation.py
│   │   ├── complex_classes.py
│   │   └── test_file.py
│   └── test_typescript_parser.py
└── website
    ├── .example.env
    ├── .gitignore
    ├── api
    │   └── pypi.ts
    ├── bun.lockb
    ├── components.json
    ├── eslint.config.js
    ├── index.html
    ├── package-lock.json
    ├── package.json
    ├── postcss.config.js
    ├── public
    │   ├── favicon.ico
    │   ├── placeholder.svg
    │   └── robots.txt
    ├── README.md
    ├── src
    │   ├── App.css
    │   ├── App.tsx
    │   ├── assets
    │   │   ├── function-calls.png
    │   │   ├── graph-total.png
    │   │   ├── hero-graph.jpg
    │   │   └── hierarchy.png
    │   ├── components
    │   │   ├── ComparisonTable.tsx
    │   │   ├── CookbookSection.tsx
    │   │   ├── DemoSection.tsx
    │   │   ├── ExamplesSection.tsx
    │   │   ├── FeaturesSection.tsx
    │   │   ├── Footer.tsx
    │   │   ├── HeroSection.tsx
    │   │   ├── InstallationSection.tsx
    │   │   ├── MoveToTop.tsx
    │   │   ├── ShowDownloads.tsx
    │   │   ├── ShowStarGraph.tsx
    │   │   ├── TestimonialSection.tsx
    │   │   ├── ThemeProvider.tsx
    │   │   ├── ThemeToggle.tsx
    │   │   └── ui
    │   │       ├── accordion.tsx
    │   │       ├── alert-dialog.tsx
    │   │       ├── alert.tsx
    │   │       ├── aspect-ratio.tsx
    │   │       ├── avatar.tsx
    │   │       ├── badge.tsx
    │   │       ├── breadcrumb.tsx
    │   │       ├── button.tsx
    │   │       ├── calendar.tsx
    │   │       ├── card.tsx
    │   │       ├── carousel.tsx
    │   │       ├── chart.tsx
    │   │       ├── checkbox.tsx
    │   │       ├── collapsible.tsx
    │   │       ├── command.tsx
    │   │       ├── context-menu.tsx
    │   │       ├── dialog.tsx
    │   │       ├── drawer.tsx
    │   │       ├── dropdown-menu.tsx
    │   │       ├── form.tsx
    │   │       ├── hover-card.tsx
    │   │       ├── input-otp.tsx
    │   │       ├── input.tsx
    │   │       ├── label.tsx
    │   │       ├── menubar.tsx
    │   │       ├── navigation-menu.tsx
    │   │       ├── orbiting-circles.tsx
    │   │       ├── pagination.tsx
    │   │       ├── popover.tsx
    │   │       ├── progress.tsx
    │   │       ├── radio-group.tsx
    │   │       ├── resizable.tsx
    │   │       ├── scroll-area.tsx
    │   │       ├── select.tsx
    │   │       ├── separator.tsx
    │   │       ├── sheet.tsx
    │   │       ├── sidebar.tsx
    │   │       ├── skeleton.tsx
    │   │       ├── slider.tsx
    │   │       ├── sonner.tsx
    │   │       ├── switch.tsx
    │   │       ├── table.tsx
    │   │       ├── tabs.tsx
    │   │       ├── textarea.tsx
    │   │       ├── toast.tsx
    │   │       ├── toaster.tsx
    │   │       ├── toggle-group.tsx
    │   │       ├── toggle.tsx
    │   │       ├── tooltip.tsx
    │   │       └── use-toast.ts
    │   ├── hooks
    │   │   ├── use-mobile.tsx
    │   │   └── use-toast.ts
    │   ├── index.css
    │   ├── lib
    │   │   └── utils.ts
    │   ├── main.tsx
    │   ├── pages
    │   │   ├── Index.tsx
    │   │   └── NotFound.tsx
    │   └── vite-env.d.ts
    ├── tailwind.config.ts
    ├── tsconfig.app.json
    ├── tsconfig.json
    ├── tsconfig.node.json
    ├── vercel.json
    └── vite.config.ts
```

# Files

--------------------------------------------------------------------------------
/src/codegraphcontext/tools/system.py:
--------------------------------------------------------------------------------

```python
  1 | # src/codegraphcontext/tools/system.py
  2 | import logging
  3 | from dataclasses import asdict
  4 | from typing import Any, Dict
  5 | from datetime import datetime, timedelta
  6 | 
  7 | from neo4j.exceptions import CypherSyntaxError
  8 | 
  9 | from ..core.database import DatabaseManager
 10 | from ..core.jobs import JobManager, JobStatus
 11 | from ..utils.debug_log import debug_log
 12 | 
 13 | logger = logging.getLogger(__name__)
 14 | 
 15 | 
 16 | class SystemTools:
 17 |     """Handles system-level tools like job management and direct DB queries."""
 18 | 
 19 |     def __init__(self, db_manager: DatabaseManager, job_manager: JobManager):
 20 |         self.db_manager = db_manager
 21 |         self.job_manager = job_manager
 22 | 
 23 |     def check_job_status_tool(self, job_id: str) -> Dict[str, Any]:
 24 |         """Tool to check job status"""
 25 |         try:
 26 |             job = self.job_manager.get_job(job_id)
 27 |             if not job:
 28 |                 return {"error": f"Job {job_id} not found"}
 29 |             
 30 |             job_dict = asdict(job)
 31 |             
 32 |             if job.status == JobStatus.RUNNING:
 33 |                 if job.estimated_time_remaining:
 34 |                     remaining = job.estimated_time_remaining
 35 |                     job_dict["estimated_time_remaining_human"] = (
 36 |                         f"{int(remaining // 60)}m {int(remaining % 60)}s" 
 37 |                         if remaining >= 60 else f"{int(remaining)}s"
 38 |                     )
 39 |                 
 40 |                 if job.start_time:
 41 |                     elapsed = (datetime.now() - job.start_time).total_seconds()
 42 |                     job_dict["elapsed_time_human"] = (
 43 |                         f"{int(elapsed // 60)}m {int(elapsed % 60)}s" 
 44 |                         if elapsed >= 60 else f"{int(elapsed)}s"
 45 |                     )
 46 |             
 47 |             elif job.status == JobStatus.COMPLETED and job.start_time and job.end_time:
 48 |                 duration = (job.end_time - job.start_time).total_seconds()
 49 |                 job_dict["actual_duration_human"] = (
 50 |                     f"{int(duration // 60)}m {int(duration % 60)}s" 
 51 |                     if duration >= 60 else f"{int(duration)}s"
 52 |                 )
 53 |             
 54 |             job_dict["start_time"] = job.start_time.strftime("%Y-%m-%d %H:%M:%S")
 55 |             if job.end_time:
 56 |                 job_dict["end_time"] = job.end_time.strftime("%Y-%m-%d %H:%M:%S")
 57 |             
 58 |             job_dict["status"] = job.status.value
 59 |             return {"success": True, "job": job_dict}
 60 |         except Exception as e:
 61 |             return {"error": f"Failed to check job status: {str(e)}"}
 62 | 
 63 |     def list_jobs_tool(self) -> Dict[str, Any]:
 64 |         """Tool to list all jobs"""
 65 |         try:
 66 |             jobs = self.job_manager.list_jobs()
 67 |             jobs_data = []
 68 |             for job in sorted(jobs, key=lambda j: j.start_time, reverse=True):
 69 |                 job_dict = asdict(job)
 70 |                 job_dict["status"] = job.status.value
 71 |                 job_dict["start_time"] = job.start_time.isoformat()
 72 |                 if job.end_time:
 73 |                     job_dict["end_time"] = job.end_time.isoformat()
 74 |                 jobs_data.append(job_dict)
 75 |             return {"success": True, "jobs": jobs_data, "total_jobs": len(jobs_data)}
 76 |         except Exception as e:
 77 |             return {"error": f"Failed to list jobs: {str(e)}"}
 78 | 
 79 |     def execute_cypher_query_tool(self, cypher_query: str) -> Dict[str, Any]:
 80 |         """Tool to execute a read-only Cypher query."""
 81 |         if not cypher_query:
 82 |             return {"error": "Cypher query cannot be empty."}
 83 | 
 84 |         forbidden_keywords = ['CREATE', 'MERGE', 'DELETE', 'SET', 'REMOVE', 'DROP', 'CALL apoc']
 85 |         if any(keyword in cypher_query.upper() for keyword in forbidden_keywords):
 86 |             return {"error": "This tool only supports read-only queries."}
 87 | 
 88 |         try:
 89 |             with self.db_manager.get_driver().session() as session:
 90 |                 result = session.run(cypher_query)
 91 |                 records = [record.data() for record in result]
 92 |                 return {
 93 |                     "success": True,
 94 |                     "query": cypher_query,
 95 |                     "record_count": len(records),
 96 |                     "results": records
 97 |                 }
 98 |         except CypherSyntaxError as e:
 99 |             return {"error": "Cypher syntax error.", "details": str(e)}
100 |         except Exception as e:
101 |             return {"error": "An unexpected error occurred.", "details": str(e)}
102 | 
103 |     def find_dead_code_tool(self) -> Dict[str, Any]:
104 |         """Finds potentially unused functions (dead code)."""
105 |         # This logic was moved from CodeFinder to be a system diagnostic tool
106 |         try:
107 |             with self.db_manager.get_driver().session() as session:
108 |                 result = session.run("""
109 |                     MATCH (func:Function)
110 |                     WHERE func.is_dependency = false
111 |                       AND NOT func.name STARTS WITH '_'
112 |                       AND NOT func.name IN ['main', 'setup', 'run']
113 |                     OPTIONAL MATCH (caller:Function)-[:CALLS]->(func)
114 |                     WHERE caller.is_dependency = false
115 |                     WITH func, count(caller) as caller_count
116 |                     WHERE caller_count = 0
117 |                     RETURN func.name as function_name, func.file_path as file_path, func.line_number as line_number
118 |                     ORDER BY func.file_path, func.line_number
119 |                     LIMIT 50
120 |                 """)
121 |                 return {
122 |                     "success": True,
123 |                     "results": {
124 |                         "potentially_unused_functions": [dict(record) for record in result],
125 |                         "note": "These functions might be entry points or called dynamically."
126 |                     }
127 |                 }
128 |         except Exception as e:
129 |             return {"error": f"Failed to find dead code: {str(e)}"}
```

--------------------------------------------------------------------------------
/website/src/index.css:
--------------------------------------------------------------------------------

```css
  1 | @tailwind base;
  2 | @tailwind components;
  3 | @tailwind utilities;
  4 | 
  5 | /* CodeGraphContext Design System - Dark theme with graph-inspired colors */
  6 | 
  7 | @layer base {
  8 |   :root {
  9 |     /* Dark background with subtle warmth */
 10 |     --background: 222 47% 5%;
 11 |     --foreground: 210 40% 98%;
 12 | 
 13 |     /* Cards with subtle transparency */
 14 |     --card: 222 47% 8%;
 15 |     --card-foreground: 210 40% 98%;
 16 | 
 17 |     --popover: 222 47% 8%;
 18 |     --popover-foreground: 210 40% 98%;
 19 | 
 20 |     /* Graph-inspired primary colors - deep purple-blue */
 21 |     --primary: 263 70% 65%;
 22 |     --primary-foreground: 222 47% 5%;
 23 | 
 24 |     /* Secondary with graph node accent */
 25 |     --secondary: 222 47% 12%;
 26 |     --secondary-foreground: 210 40% 98%;
 27 | 
 28 |     /* Muted tones for subtlety */
 29 |     --muted: 222 47% 10%;
 30 |     --muted-foreground: 215 20% 65%;
 31 | 
 32 |     /* Bright cyan accent for highlights */
 33 |     --accent: 180 100% 70%;
 34 |     --accent-foreground: 222 47% 5%;
 35 | 
 36 |     --destructive: 0 84.2% 60.2%;
 37 |     --destructive-foreground: 210 40% 98%;
 38 | 
 39 |     --border: 222 47% 15%;
 40 |     --input: 222 47% 12%;
 41 |     --ring: 263 70% 65%;
 42 | 
 43 |     --radius: 0.75rem;
 44 | 
 45 |     /* Custom graph colors */
 46 |     --graph-node-1: 263 70% 65%;
 47 |     --graph-node-2: 180 100% 70%;
 48 |     --graph-node-3: 142 76% 65%;
 49 |     --graph-edge: 222 47% 25%;
 50 | 
 51 |     /* Gradients */
 52 |     --gradient-primary: linear-gradient(135deg, hsl(263 70% 65%), hsl(180 100% 70%));
 53 |     --gradient-hero: linear-gradient(135deg, hsl(222 47% 5%) 0%, hsl(222 47% 8%) 100%);
 54 |     --gradient-card: linear-gradient(135deg, hsl(222 47% 8%) 0%, hsl(222 47% 10%) 100%);
 55 | 
 56 |     /* Shadows with graph glow */
 57 |     --shadow-glow: 0 0 40px hsl(263 70% 65% / 0.15);
 58 |     --shadow-card: 0 10px 30px -10px hsl(222 47% 2% / 0.3);
 59 | 
 60 |     /* Animations */
 61 |     --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
 62 |     --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
 63 | 
 64 |     --sidebar-background: 0 0% 98%;
 65 | 
 66 |     --sidebar-foreground: 240 5.3% 26.1%;
 67 | 
 68 |     --sidebar-primary: 240 5.9% 10%;
 69 | 
 70 |     --sidebar-primary-foreground: 0 0% 98%;
 71 | 
 72 |     --sidebar-accent: 240 4.8% 95.9%;
 73 | 
 74 |     --sidebar-accent-foreground: 240 5.9% 10%;
 75 | 
 76 |     --sidebar-border: 220 13% 91%;
 77 | 
 78 |     --sidebar-ring: 217.2 91.2% 59.8%;
 79 |   }
 80 | 
 81 |   .light {
 82 |     /* Light mode fallback - CodeGraphContext works best in dark */
 83 |     --background: 0 0% 95%;
 84 |     --foreground: 222.2 84% 4.9%;
 85 |     --card: 0 0% 100%;
 86 |     --card-foreground: 222.2 84% 4.9%;
 87 |     --popover: 0 0% 100%;
 88 |     --popover-foreground: 222.2 84% 4.9%;
 89 |     --primary: 263 70% 55%;
 90 |     --primary-foreground: 210 40% 98%;
 91 |     --secondary: 210 40% 96.1%;
 92 |     --secondary-foreground: 222.2 47.4% 11.2%;
 93 |     --muted: 210 40% 96.1%;
 94 |     --muted-foreground: 215.4 16.3% 16.9%;
 95 |     --accent: 180 100% 40%;
 96 |     --accent-foreground: 210 40% 98%;
 97 |     --destructive: 0 84.2% 60.2%;
 98 |     --destructive-foreground: 210 40% 98%;
 99 |     --border: 214.3 31.8% 91.4%;
100 |     --input: 214.3 31.8% 91.4%;
101 |     --ring: 263 70% 55%;
102 |     --gradient-primary: linear-gradient(135deg, hsl(263, 49%, 40%), hsl(180, 45%, 47%));
103 | 
104 |   }
105 |   .theme {
106 |     --animate-orbit: orbit calc(var(--duration)*1s) linear infinite;
107 |   }
108 | }
109 | 
110 | @layer base {
111 |   * {
112 |     @apply border-border;
113 |   }
114 | 
115 |   body {
116 |     @apply bg-background text-foreground overflow-x-hidden;
117 |     background: hsl(var(--background));
118 |     background-image: 
119 |       radial-gradient(circle at 20% 20%, hsl(263 70% 65% / 0.05) 0%, transparent 50%),
120 |       radial-gradient(circle at 80% 80%, hsl(180 100% 70% / 0.05) 0%, transparent 50%);
121 |   }
122 | 
123 |   /* Smooth scrolling */
124 |   html {
125 |     scroll-behavior: smooth;
126 |   }
127 | 
128 |   /* Custom animations */
129 |   @keyframes graph-pulse {
130 |     0%, 100% { 
131 |       opacity: 1;
132 |       transform: scale(1);
133 |     }
134 |     50% { 
135 |       opacity: 0.7;
136 |       transform: scale(1.05);
137 |     }
138 |   }
139 | 
140 |   @keyframes float-up {
141 |     0% {
142 |       opacity: 0;
143 |       transform: translateY(30px);
144 |     }
145 |     100% {
146 |       opacity: 1;
147 |       transform: translateY(0);
148 |     }
149 |   }
150 | 
151 |   @keyframes code-highlight {
152 |     0% { background-color: transparent; }
153 |     50% { background-color: hsl(263 70% 65% / 0.1); }
154 |     100% { background-color: transparent; }
155 |   }
156 | 
157 |   .animate-graph-pulse {
158 |     animation: graph-pulse 2s ease-in-out infinite;
159 |   }
160 | 
161 |   .animate-float-up {
162 |     animation: float-up 0.6s ease-out forwards;
163 |   }
164 | 
165 |   .animate-code-highlight {
166 |     animation: code-highlight 2s ease-in-out infinite;
167 |   }
168 | 
169 |   /* Orbiting circles animation (Tailwind v3 friendly) */
170 |   .animate-orbit {
171 |     animation: orbit calc(var(--duration) * 1s) linear infinite;
172 |   }
173 | 
174 |   @keyframes orbit {
175 |     0% {
176 |       transform: rotate(calc(var(--angle) * 1deg))
177 |         translateY(calc(var(--radius) * 1px))
178 |         rotate(calc(var(--angle) * -1deg));
179 |     }
180 |     100% {
181 |       transform: rotate(calc(var(--angle) * 1deg + 360deg))
182 |         translateY(calc(var(--radius) * 1px))
183 |         rotate(calc((var(--angle) * -1deg) - 360deg));
184 |     }
185 |   }
186 | 
187 |   /* Graph visualization styles */
188 |   .graph-node {
189 |     @apply rounded-full border-2 border-primary/20 transition-all duration-300;
190 |     background: hsl(var(--gradient-primary));
191 |     box-shadow: var(--shadow-glow);
192 |   }
193 | 
194 |   
195 | 
196 |   .graph-edge {
197 |     @apply stroke-graph-edge transition-all duration-300;
198 |     stroke-width: 2;
199 |     stroke-dasharray: 5,5;
200 |     animation: dash 20s linear infinite;
201 |   }
202 | 
203 |   @keyframes dash {
204 |     to {
205 |       stroke-dashoffset: -100;
206 |     }
207 |   }
208 | 
209 |   /* Code block styling */
210 |   .code-block {
211 |     @apply bg-card border border-border rounded-lg p-4 font-mono text-sm;
212 |     background: var(--gradient-card);
213 |     box-shadow: var(--shadow-card);
214 |   }
215 | }
216 | 
217 | @layer base {
218 |   * {
219 |     @apply border-border;
220 |   }
221 |   body {
222 |     @apply bg-background text-foreground;
223 |   }
224 | }
225 | 
226 | @theme inline {
227 |   @keyframes orbit {
228 |   0% {
229 |     transform: rotate(calc(var(--angle) * 1deg)) translateY(calc(var(--radius) * 1px)) rotate(calc(var(--angle) * -1deg));
230 |     }
231 |   100% {
232 |     transform: rotate(calc(var(--angle) * 1deg + 360deg)) translateY(calc(var(--radius) * 1px)) rotate(calc((var(--angle) * -1deg) - 360deg));
233 |     }
234 |   }
235 | }
```

--------------------------------------------------------------------------------
/docs/site/assets/javascripts/lunr/min/lunr.nl.min.js:
--------------------------------------------------------------------------------

```javascript
 1 | /*!
 2 |  * Lunr languages, `Dutch` language
 3 |  * https://github.com/MihaiValentin/lunr-languages
 4 |  *
 5 |  * Copyright 2014, Mihai Valentin
 6 |  * http://www.mozilla.org/MPL/
 7 |  */
 8 | /*!
 9 |  * based on
10 |  * Snowball JavaScript Library v0.3
11 |  * http://code.google.com/p/urim/
12 |  * http://snowball.tartarus.org/
13 |  *
14 |  * Copyright 2010, Oleg Mazko
15 |  * http://www.mozilla.org/MPL/
16 |  */
17 | 
18 | !function(r,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():e()(r.lunr)}(this,function(){return function(r){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");r.nl=function(){this.pipeline.reset(),this.pipeline.add(r.nl.trimmer,r.nl.stopWordFilter,r.nl.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(r.nl.stemmer))},r.nl.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",r.nl.trimmer=r.trimmerSupport.generateTrimmer(r.nl.wordCharacters),r.Pipeline.registerFunction(r.nl.trimmer,"trimmer-nl"),r.nl.stemmer=function(){var e=r.stemmerSupport.Among,i=r.stemmerSupport.SnowballProgram,n=new function(){function r(){for(var r,e,i,o=C.cursor;;){if(C.bra=C.cursor,r=C.find_among(b,11))switch(C.ket=C.cursor,r){case 1:C.slice_from("a");continue;case 2:C.slice_from("e");continue;case 3:C.slice_from("i");continue;case 4:C.slice_from("o");continue;case 5:C.slice_from("u");continue;case 6:if(C.cursor>=C.limit)break;C.cursor++;continue}break}for(C.cursor=o,C.bra=o,C.eq_s(1,"y")?(C.ket=C.cursor,C.slice_from("Y")):C.cursor=o;;)if(e=C.cursor,C.in_grouping(q,97,232)){if(i=C.cursor,C.bra=i,C.eq_s(1,"i"))C.ket=C.cursor,C.in_grouping(q,97,232)&&(C.slice_from("I"),C.cursor=e);else if(C.cursor=i,C.eq_s(1,"y"))C.ket=C.cursor,C.slice_from("Y"),C.cursor=e;else if(n(e))break}else if(n(e))break}function n(r){return C.cursor=r,r>=C.limit||(C.cursor++,!1)}function o(){_=C.limit,d=_,t()||(_=C.cursor,_<3&&(_=3),t()||(d=C.cursor))}function t(){for(;!C.in_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}for(;!C.out_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}return!1}function s(){for(var r;;)if(C.bra=C.cursor,r=C.find_among(p,3))switch(C.ket=C.cursor,r){case 1:C.slice_from("y");break;case 2:C.slice_from("i");break;case 3:if(C.cursor>=C.limit)return;C.cursor++}}function u(){return _<=C.cursor}function c(){return d<=C.cursor}function a(){var r=C.limit-C.cursor;C.find_among_b(g,3)&&(C.cursor=C.limit-r,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del()))}function l(){var r;w=!1,C.ket=C.cursor,C.eq_s_b(1,"e")&&(C.bra=C.cursor,u()&&(r=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-r,C.slice_del(),w=!0,a())))}function m(){var r;u()&&(r=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-r,C.eq_s_b(3,"gem")||(C.cursor=C.limit-r,C.slice_del(),a())))}function f(){var r,e,i,n,o,t,s=C.limit-C.cursor;if(C.ket=C.cursor,r=C.find_among_b(h,5))switch(C.bra=C.cursor,r){case 1:u()&&C.slice_from("heid");break;case 2:m();break;case 3:u()&&C.out_grouping_b(j,97,232)&&C.slice_del()}if(C.cursor=C.limit-s,l(),C.cursor=C.limit-s,C.ket=C.cursor,C.eq_s_b(4,"heid")&&(C.bra=C.cursor,c()&&(e=C.limit-C.cursor,C.eq_s_b(1,"c")||(C.cursor=C.limit-e,C.slice_del(),C.ket=C.cursor,C.eq_s_b(2,"en")&&(C.bra=C.cursor,m())))),C.cursor=C.limit-s,C.ket=C.cursor,r=C.find_among_b(k,6))switch(C.bra=C.cursor,r){case 1:if(c()){if(C.slice_del(),i=C.limit-C.cursor,C.ket=C.cursor,C.eq_s_b(2,"ig")&&(C.bra=C.cursor,c()&&(n=C.limit-C.cursor,!C.eq_s_b(1,"e")))){C.cursor=C.limit-n,C.slice_del();break}C.cursor=C.limit-i,a()}break;case 2:c()&&(o=C.limit-C.cursor,C.eq_s_b(1,"e")||(C.cursor=C.limit-o,C.slice_del()));break;case 3:c()&&(C.slice_del(),l());break;case 4:c()&&C.slice_del();break;case 5:c()&&w&&C.slice_del()}C.cursor=C.limit-s,C.out_grouping_b(z,73,232)&&(t=C.limit-C.cursor,C.find_among_b(v,4)&&C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-t,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del())))}var d,_,w,b=[new e("",-1,6),new e("á",0,1),new e("ä",0,1),new e("é",0,2),new e("ë",0,2),new e("í",0,3),new e("ï",0,3),new e("ó",0,4),new e("ö",0,4),new e("ú",0,5),new e("ü",0,5)],p=[new e("",-1,3),new e("I",0,2),new e("Y",0,1)],g=[new e("dd",-1,-1),new e("kk",-1,-1),new e("tt",-1,-1)],h=[new e("ene",-1,2),new e("se",-1,3),new e("en",-1,2),new e("heden",2,1),new e("s",-1,3)],k=[new e("end",-1,1),new e("ig",-1,2),new e("ing",-1,1),new e("lijk",-1,3),new e("baar",-1,4),new e("bar",-1,5)],v=[new e("aa",-1,-1),new e("ee",-1,-1),new e("oo",-1,-1),new e("uu",-1,-1)],q=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],z=[1,0,0,17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],j=[17,67,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],C=new i;this.setCurrent=function(r){C.setCurrent(r)},this.getCurrent=function(){return C.getCurrent()},this.stem=function(){var e=C.cursor;return r(),C.cursor=e,o(),C.limit_backward=e,C.cursor=C.limit,f(),C.cursor=C.limit_backward,s(),!0}};return function(r){return"function"==typeof r.update?r.update(function(r){return n.setCurrent(r),n.stem(),n.getCurrent()}):(n.setCurrent(r),n.stem(),n.getCurrent())}}(),r.Pipeline.registerFunction(r.nl.stemmer,"stemmer-nl"),r.nl.stopWordFilter=r.generateStopWordFilter(" aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou".split(" ")),r.Pipeline.registerFunction(r.nl.stopWordFilter,"stopWordFilter-nl")}});
```

--------------------------------------------------------------------------------
/tests/sample_project_rust/src/lifetimes_references.rs:
--------------------------------------------------------------------------------

```rust
  1 | // lifetimes_references.rs - Demonstrates Rust lifetimes and references
  2 | use std::fmt::Display;
  3 | 
  4 | /// Function with explicit lifetime annotation
  5 | pub fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
  6 |     if x.len() > y.len() {
  7 |         x
  8 |     } else {
  9 |         y
 10 |     }
 11 | }
 12 | 
 13 | /// Multiple lifetime parameters
 14 | pub fn first_word<'a, 'b>(x: &'a str, _y: &'b str) -> &'a str {
 15 |     x.split_whitespace().next().unwrap_or(x)
 16 | }
 17 | 
 18 | /// Lifetime with struct
 19 | #[derive(Debug)]
 20 | pub struct ImportantExcerpt<'a> {
 21 |     pub part: &'a str,
 22 | }
 23 | 
 24 | impl<'a> ImportantExcerpt<'a> {
 25 |     /// Lifetime elision in method
 26 |     pub fn level(&self) -> i32 {
 27 |         3
 28 |     }
 29 | 
 30 |     /// Method with lifetime annotation
 31 |     pub fn announce_and_return_part(&self, announcement: &str) -> &str {
 32 |         println!("Attention please: {}", announcement);
 33 |         self.part
 34 |     }
 35 | }
 36 | 
 37 | /// Struct with multiple lifetime parameters
 38 | #[derive(Debug)]
 39 | pub struct Context<'a, 'b> {
 40 |     pub primary: &'a str,
 41 |     pub secondary: &'b str,
 42 | }
 43 | 
 44 | impl<'a, 'b> Context<'a, 'b> {
 45 |     pub fn new(primary: &'a str, secondary: &'b str) -> Self {
 46 |         Self { primary, secondary }
 47 |     }
 48 | 
 49 |     pub fn get_primary(&self) -> &'a str {
 50 |         self.primary
 51 |     }
 52 | 
 53 |     pub fn get_secondary(&self) -> &'b str {
 54 |         self.secondary
 55 |     }
 56 | }
 57 | 
 58 | /// Static lifetime
 59 | pub fn static_string() -> &'static str {
 60 |     "This string has static lifetime"
 61 | }
 62 | 
 63 | /// Generic with lifetime and trait bound
 64 | pub fn longest_with_announcement<'a, T>(
 65 |     x: &'a str,
 66 |     y: &'a str,
 67 |     announcement: T,
 68 | ) -> &'a str
 69 | where
 70 |     T: Display,
 71 | {
 72 |     println!("Announcement: {}", announcement);
 73 |     if x.len() > y.len() {
 74 |         x
 75 |     } else {
 76 |         y
 77 |     }
 78 | }
 79 | 
 80 | /// Reference to slice
 81 | pub fn first_element<'a, T>(slice: &'a [T]) -> Option<&'a T> {
 82 |     slice.first()
 83 | }
 84 | 
 85 | /// Mutable reference with lifetime
 86 | pub fn append_exclamation<'a>(s: &'a mut String) -> &'a str {
 87 |     s.push('!');
 88 |     s.as_str()
 89 | }
 90 | 
 91 | /// Struct holding references
 92 | #[derive(Debug)]
 93 | pub struct Book<'a> {
 94 |     pub title: &'a str,
 95 |     pub author: &'a str,
 96 |     pub year: u32,
 97 | }
 98 | 
 99 | impl<'a> Book<'a> {
100 |     pub fn new(title: &'a str, author: &'a str, year: u32) -> Self {
101 |         Self { title, author, year }
102 |     }
103 | 
104 |     pub fn display(&self) -> String {
105 |         format!("{} by {} ({})", self.title, self.author, self.year)
106 |     }
107 | }
108 | 
109 | /// Lifetime bounds
110 | pub struct Ref<'a, T: 'a> {
111 |     reference: &'a T,
112 | }
113 | 
114 | impl<'a, T> Ref<'a, T> {
115 |     pub fn new(reference: &'a T) -> Self {
116 |         Self { reference }
117 |     }
118 | 
119 |     pub fn get(&self) -> &'a T {
120 |         self.reference
121 |     }
122 | }
123 | 
124 | /// Higher-ranked trait bounds (HRTBs)
125 | pub fn call_with_ref<F>(f: F)
126 | where
127 |     F: for<'a> Fn(&'a str) -> &'a str,
128 | {
129 |     let s = String::from("Hello");
130 |     let result = f(&s);
131 |     println!("Result: {}", result);
132 | }
133 | 
134 | /// Lifetime elision example 1
135 | pub fn get_first_word(s: &str) -> &str {
136 |     s.split_whitespace().next().unwrap_or("")
137 | }
138 | 
139 | /// Lifetime elision example 2
140 | pub fn parse_pair(s: &str) -> (&str, &str) {
141 |     let parts: Vec<&str> = s.split(',').collect();
142 |     if parts.len() >= 2 {
143 |         (parts[0], parts[1])
144 |     } else {
145 |         ("", "")
146 |     }
147 | }
148 | 
149 | /// Struct with owned and borrowed data
150 | #[derive(Debug)]
151 | pub struct MixedData<'a> {
152 |     pub owned: String,
153 |     pub borrowed: &'a str,
154 | }
155 | 
156 | impl<'a> MixedData<'a> {
157 |     pub fn new(owned: String, borrowed: &'a str) -> Self {
158 |         Self { owned, borrowed }
159 |     }
160 | 
161 |     pub fn combine(&self) -> String {
162 |         format!("{} {}", self.owned, self.borrowed)
163 |     }
164 | }
165 | 
166 | /// Iterator with lifetime
167 | pub struct StrSplitter<'a> {
168 |     remainder: &'a str,
169 |     delimiter: char,
170 | }
171 | 
172 | impl<'a> StrSplitter<'a> {
173 |     pub fn new(s: &'a str, delimiter: char) -> Self {
174 |         Self {
175 |             remainder: s,
176 |             delimiter,
177 |         }
178 |     }
179 | }
180 | 
181 | impl<'a> Iterator for StrSplitter<'a> {
182 |     type Item = &'a str;
183 | 
184 |     fn next(&mut self) -> Option<Self::Item> {
185 |         if self.remainder.is_empty() {
186 |             return None;
187 |         }
188 | 
189 |         match self.remainder.find(self.delimiter) {
190 |             Some(pos) => {
191 |                 let result = &self.remainder[..pos];
192 |                 self.remainder = &self.remainder[pos + 1..];
193 |                 Some(result)
194 |             }
195 |             None => {
196 |                 let result = self.remainder;
197 |                 self.remainder = "";
198 |                 Some(result)
199 |             }
200 |         }
201 |     }
202 | }
203 | 
204 | /// Lifetime with enum
205 | #[derive(Debug)]
206 | pub enum Either<'a, 'b> {
207 |     Left(&'a str),
208 |     Right(&'b str),
209 | }
210 | 
211 | impl<'a, 'b> Either<'a, 'b> {
212 |     pub fn get_value(&self) -> &str {
213 |         match self {
214 |             Either::Left(s) => s,
215 |             Either::Right(s) => s,
216 |         }
217 |     }
218 | }
219 | 
220 | /// Combining lifetimes
221 | pub fn combine_strings<'a>(strings: &'a [&'a str], separator: &str) -> String {
222 |     strings.join(separator)
223 | }
224 | 
225 | /// Reference counting considerations (not strictly lifetimes but related)
226 | use std::rc::Rc;
227 | 
228 | pub struct SharedData {
229 |     pub data: Rc<String>,
230 | }
231 | 
232 | impl SharedData {
233 |     pub fn new(s: String) -> Self {
234 |         Self {
235 |             data: Rc::new(s),
236 |         }
237 |     }
238 | 
239 |     pub fn clone_ref(&self) -> SharedData {
240 |         Self {
241 |             data: Rc::clone(&self.data),
242 |         }
243 |     }
244 | }
245 | 
246 | /// Comparing references with different lifetimes
247 | pub fn compare_lengths<'a, 'b>(s1: &'a str, s2: &'b str) -> bool {
248 |     s1.len() > s2.len()
249 | }
250 | 
251 | #[cfg(test)]
252 | mod tests {
253 |     use super::*;
254 | 
255 |     #[test]
256 |     fn test_longest() {
257 |         let s1 = "hello";
258 |         let s2 = "hi";
259 |         assert_eq!(longest(s1, s2), "hello");
260 |     }
261 | 
262 |     #[test]
263 |     fn test_important_excerpt() {
264 |         let text = "This is a test. This is important.";
265 |         let excerpt = ImportantExcerpt { part: text };
266 |         assert_eq!(excerpt.level(), 3);
267 |     }
268 | 
269 |     #[test]
270 |     fn test_book() {
271 |         let book = Book::new("1984", "George Orwell", 1949);
272 |         assert!(book.display().contains("1984"));
273 |     }
274 | 
275 |     #[test]
276 |     fn test_str_splitter() {
277 |         let text = "a,b,c";
278 |         let splitter = StrSplitter::new(text, ',');
279 |         let parts: Vec<&str> = splitter.collect();
280 |         assert_eq!(parts, vec!["a", "b", "c"]);
281 |     }
282 | }
283 | 
284 | 
```

--------------------------------------------------------------------------------
/docs/site/assets/javascripts/lunr/min/lunr.de.min.js:
--------------------------------------------------------------------------------

```javascript
 1 | /*!
 2 |  * Lunr languages, `German` language
 3 |  * https://github.com/MihaiValentin/lunr-languages
 4 |  *
 5 |  * Copyright 2014, Mihai Valentin
 6 |  * http://www.mozilla.org/MPL/
 7 |  */
 8 | /*!
 9 |  * based on
10 |  * Snowball JavaScript Library v0.3
11 |  * http://code.google.com/p/urim/
12 |  * http://snowball.tartarus.org/
13 |  *
14 |  * Copyright 2010, Oleg Mazko
15 |  * http://www.mozilla.org/MPL/
16 |  */
17 | 
18 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.de=function(){this.pipeline.reset(),this.pipeline.add(e.de.trimmer,e.de.stopWordFilter,e.de.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.de.stemmer))},e.de.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.de.trimmer=e.trimmerSupport.generateTrimmer(e.de.wordCharacters),e.Pipeline.registerFunction(e.de.trimmer,"trimmer-de"),e.de.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(e,r,n){return!(!v.eq_s(1,e)||(v.ket=v.cursor,!v.in_grouping(p,97,252)))&&(v.slice_from(r),v.cursor=n,!0)}function i(){for(var r,n,i,s,t=v.cursor;;)if(r=v.cursor,v.bra=r,v.eq_s(1,"ß"))v.ket=v.cursor,v.slice_from("ss");else{if(r>=v.limit)break;v.cursor=r+1}for(v.cursor=t;;)for(n=v.cursor;;){if(i=v.cursor,v.in_grouping(p,97,252)){if(s=v.cursor,v.bra=s,e("u","U",i))break;if(v.cursor=s,e("y","Y",i))break}if(i>=v.limit)return void(v.cursor=n);v.cursor=i+1}}function s(){for(;!v.in_grouping(p,97,252);){if(v.cursor>=v.limit)return!0;v.cursor++}for(;!v.out_grouping(p,97,252);){if(v.cursor>=v.limit)return!0;v.cursor++}return!1}function t(){m=v.limit,l=m;var e=v.cursor+3;0<=e&&e<=v.limit&&(d=e,s()||(m=v.cursor,m<d&&(m=d),s()||(l=v.cursor)))}function o(){for(var e,r;;){if(r=v.cursor,v.bra=r,!(e=v.find_among(h,6)))return;switch(v.ket=v.cursor,e){case 1:v.slice_from("y");break;case 2:case 5:v.slice_from("u");break;case 3:v.slice_from("a");break;case 4:v.slice_from("o");break;case 6:if(v.cursor>=v.limit)return;v.cursor++}}}function c(){return m<=v.cursor}function u(){return l<=v.cursor}function a(){var e,r,n,i,s=v.limit-v.cursor;if(v.ket=v.cursor,(e=v.find_among_b(w,7))&&(v.bra=v.cursor,c()))switch(e){case 1:v.slice_del();break;case 2:v.slice_del(),v.ket=v.cursor,v.eq_s_b(1,"s")&&(v.bra=v.cursor,v.eq_s_b(3,"nis")&&v.slice_del());break;case 3:v.in_grouping_b(g,98,116)&&v.slice_del()}if(v.cursor=v.limit-s,v.ket=v.cursor,(e=v.find_among_b(f,4))&&(v.bra=v.cursor,c()))switch(e){case 1:v.slice_del();break;case 2:if(v.in_grouping_b(k,98,116)){var t=v.cursor-3;v.limit_backward<=t&&t<=v.limit&&(v.cursor=t,v.slice_del())}}if(v.cursor=v.limit-s,v.ket=v.cursor,(e=v.find_among_b(_,8))&&(v.bra=v.cursor,u()))switch(e){case 1:v.slice_del(),v.ket=v.cursor,v.eq_s_b(2,"ig")&&(v.bra=v.cursor,r=v.limit-v.cursor,v.eq_s_b(1,"e")||(v.cursor=v.limit-r,u()&&v.slice_del()));break;case 2:n=v.limit-v.cursor,v.eq_s_b(1,"e")||(v.cursor=v.limit-n,v.slice_del());break;case 3:if(v.slice_del(),v.ket=v.cursor,i=v.limit-v.cursor,!v.eq_s_b(2,"er")&&(v.cursor=v.limit-i,!v.eq_s_b(2,"en")))break;v.bra=v.cursor,c()&&v.slice_del();break;case 4:v.slice_del(),v.ket=v.cursor,e=v.find_among_b(b,2),e&&(v.bra=v.cursor,u()&&1==e&&v.slice_del())}}var d,l,m,h=[new r("",-1,6),new r("U",0,2),new r("Y",0,1),new r("ä",0,3),new r("ö",0,4),new r("ü",0,5)],w=[new r("e",-1,2),new r("em",-1,1),new r("en",-1,2),new r("ern",-1,1),new r("er",-1,1),new r("s",-1,3),new r("es",5,2)],f=[new r("en",-1,1),new r("er",-1,1),new r("st",-1,2),new r("est",2,1)],b=[new r("ig",-1,1),new r("lich",-1,1)],_=[new r("end",-1,1),new r("ig",-1,2),new r("ung",-1,1),new r("lich",-1,3),new r("isch",-1,2),new r("ik",-1,2),new r("heit",-1,3),new r("keit",-1,4)],p=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32,8],g=[117,30,5],k=[117,30,4],v=new n;this.setCurrent=function(e){v.setCurrent(e)},this.getCurrent=function(){return v.getCurrent()},this.stem=function(){var e=v.cursor;return i(),v.cursor=e,t(),v.limit_backward=e,v.cursor=v.limit,a(),v.cursor=v.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.de.stemmer,"stemmer-de"),e.de.stopWordFilter=e.generateStopWordFilter("aber alle allem allen aller alles als also am an ander andere anderem anderen anderer anderes anderm andern anderr anders auch auf aus bei bin bis bist da damit dann das dasselbe dazu daß dein deine deinem deinen deiner deines dem demselben den denn denselben der derer derselbe derselben des desselben dessen dich die dies diese dieselbe dieselben diesem diesen dieser dieses dir doch dort du durch ein eine einem einen einer eines einig einige einigem einigen einiger einiges einmal er es etwas euch euer eure eurem euren eurer eures für gegen gewesen hab habe haben hat hatte hatten hier hin hinter ich ihm ihn ihnen ihr ihre ihrem ihren ihrer ihres im in indem ins ist jede jedem jeden jeder jedes jene jenem jenen jener jenes jetzt kann kein keine keinem keinen keiner keines können könnte machen man manche manchem manchen mancher manches mein meine meinem meinen meiner meines mich mir mit muss musste nach nicht nichts noch nun nur ob oder ohne sehr sein seine seinem seinen seiner seines selbst sich sie sind so solche solchem solchen solcher solches soll sollte sondern sonst um und uns unse unsem unsen unser unses unter viel vom von vor war waren warst was weg weil weiter welche welchem welchen welcher welches wenn werde werden wie wieder will wir wird wirst wo wollen wollte während würde würden zu zum zur zwar zwischen über".split(" ")),e.Pipeline.registerFunction(e.de.stopWordFilter,"stopWordFilter-de")}});
```

--------------------------------------------------------------------------------
/docs/site/assets/javascripts/lunr/min/lunr.du.min.js:
--------------------------------------------------------------------------------

```javascript
 1 | /*!
 2 |  * Lunr languages, `Dutch` language
 3 |  * https://github.com/MihaiValentin/lunr-languages
 4 |  *
 5 |  * Copyright 2014, Mihai Valentin
 6 |  * http://www.mozilla.org/MPL/
 7 |  */
 8 | /*!
 9 |  * based on
10 |  * Snowball JavaScript Library v0.3
11 |  * http://code.google.com/p/urim/
12 |  * http://snowball.tartarus.org/
13 |  *
14 |  * Copyright 2010, Oleg Mazko
15 |  * http://www.mozilla.org/MPL/
16 |  */
17 | 
18 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");console.warn('[Lunr Languages] Please use the "nl" instead of the "du". The "nl" code is the standard code for Dutch language, and "du" will be removed in the next major versions.'),e.du=function(){this.pipeline.reset(),this.pipeline.add(e.du.trimmer,e.du.stopWordFilter,e.du.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.du.stemmer))},e.du.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.du.trimmer=e.trimmerSupport.generateTrimmer(e.du.wordCharacters),e.Pipeline.registerFunction(e.du.trimmer,"trimmer-du"),e.du.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){for(var e,r,i,o=C.cursor;;){if(C.bra=C.cursor,e=C.find_among(b,11))switch(C.ket=C.cursor,e){case 1:C.slice_from("a");continue;case 2:C.slice_from("e");continue;case 3:C.slice_from("i");continue;case 4:C.slice_from("o");continue;case 5:C.slice_from("u");continue;case 6:if(C.cursor>=C.limit)break;C.cursor++;continue}break}for(C.cursor=o,C.bra=o,C.eq_s(1,"y")?(C.ket=C.cursor,C.slice_from("Y")):C.cursor=o;;)if(r=C.cursor,C.in_grouping(q,97,232)){if(i=C.cursor,C.bra=i,C.eq_s(1,"i"))C.ket=C.cursor,C.in_grouping(q,97,232)&&(C.slice_from("I"),C.cursor=r);else if(C.cursor=i,C.eq_s(1,"y"))C.ket=C.cursor,C.slice_from("Y"),C.cursor=r;else if(n(r))break}else if(n(r))break}function n(e){return C.cursor=e,e>=C.limit||(C.cursor++,!1)}function o(){_=C.limit,f=_,t()||(_=C.cursor,_<3&&(_=3),t()||(f=C.cursor))}function t(){for(;!C.in_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}for(;!C.out_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}return!1}function s(){for(var e;;)if(C.bra=C.cursor,e=C.find_among(p,3))switch(C.ket=C.cursor,e){case 1:C.slice_from("y");break;case 2:C.slice_from("i");break;case 3:if(C.cursor>=C.limit)return;C.cursor++}}function u(){return _<=C.cursor}function c(){return f<=C.cursor}function a(){var e=C.limit-C.cursor;C.find_among_b(g,3)&&(C.cursor=C.limit-e,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del()))}function l(){var e;w=!1,C.ket=C.cursor,C.eq_s_b(1,"e")&&(C.bra=C.cursor,u()&&(e=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-e,C.slice_del(),w=!0,a())))}function m(){var e;u()&&(e=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-e,C.eq_s_b(3,"gem")||(C.cursor=C.limit-e,C.slice_del(),a())))}function d(){var e,r,i,n,o,t,s=C.limit-C.cursor;if(C.ket=C.cursor,e=C.find_among_b(h,5))switch(C.bra=C.cursor,e){case 1:u()&&C.slice_from("heid");break;case 2:m();break;case 3:u()&&C.out_grouping_b(z,97,232)&&C.slice_del()}if(C.cursor=C.limit-s,l(),C.cursor=C.limit-s,C.ket=C.cursor,C.eq_s_b(4,"heid")&&(C.bra=C.cursor,c()&&(r=C.limit-C.cursor,C.eq_s_b(1,"c")||(C.cursor=C.limit-r,C.slice_del(),C.ket=C.cursor,C.eq_s_b(2,"en")&&(C.bra=C.cursor,m())))),C.cursor=C.limit-s,C.ket=C.cursor,e=C.find_among_b(k,6))switch(C.bra=C.cursor,e){case 1:if(c()){if(C.slice_del(),i=C.limit-C.cursor,C.ket=C.cursor,C.eq_s_b(2,"ig")&&(C.bra=C.cursor,c()&&(n=C.limit-C.cursor,!C.eq_s_b(1,"e")))){C.cursor=C.limit-n,C.slice_del();break}C.cursor=C.limit-i,a()}break;case 2:c()&&(o=C.limit-C.cursor,C.eq_s_b(1,"e")||(C.cursor=C.limit-o,C.slice_del()));break;case 3:c()&&(C.slice_del(),l());break;case 4:c()&&C.slice_del();break;case 5:c()&&w&&C.slice_del()}C.cursor=C.limit-s,C.out_grouping_b(j,73,232)&&(t=C.limit-C.cursor,C.find_among_b(v,4)&&C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-t,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del())))}var f,_,w,b=[new r("",-1,6),new r("á",0,1),new r("ä",0,1),new r("é",0,2),new r("ë",0,2),new r("í",0,3),new r("ï",0,3),new r("ó",0,4),new r("ö",0,4),new r("ú",0,5),new r("ü",0,5)],p=[new r("",-1,3),new r("I",0,2),new r("Y",0,1)],g=[new r("dd",-1,-1),new r("kk",-1,-1),new r("tt",-1,-1)],h=[new r("ene",-1,2),new r("se",-1,3),new r("en",-1,2),new r("heden",2,1),new r("s",-1,3)],k=[new r("end",-1,1),new r("ig",-1,2),new r("ing",-1,1),new r("lijk",-1,3),new r("baar",-1,4),new r("bar",-1,5)],v=[new r("aa",-1,-1),new r("ee",-1,-1),new r("oo",-1,-1),new r("uu",-1,-1)],q=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],j=[1,0,0,17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],z=[17,67,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],C=new i;this.setCurrent=function(e){C.setCurrent(e)},this.getCurrent=function(){return C.getCurrent()},this.stem=function(){var r=C.cursor;return e(),C.cursor=r,o(),C.limit_backward=r,C.cursor=C.limit,d(),C.cursor=C.limit_backward,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.du.stemmer,"stemmer-du"),e.du.stopWordFilter=e.generateStopWordFilter(" aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou".split(" ")),e.Pipeline.registerFunction(e.du.stopWordFilter,"stopWordFilter-du")}});
```

--------------------------------------------------------------------------------
/tests/test_end_to_end.py:
--------------------------------------------------------------------------------

```python
  1 | import subprocess
  2 | import json
  3 | import os
  4 | import time
  5 | import pytest
  6 | import random
  7 | import string
  8 | 
  9 | SAMPLE_PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "sample_project"))
 10 | 
 11 | request_id_counter = 1
 12 | 
 13 | def call_tool(server_process, tool_name, tool_args):
 14 |     global request_id_counter
 15 |     request = {
 16 |         "jsonrpc": "2.0",
 17 |         "id": request_id_counter,
 18 |         "method": "tools/call",
 19 |         "params": {"name": tool_name, "arguments": tool_args}
 20 |     }
 21 |     request_id_counter += 1
 22 |     print(f"--> Sending request: {json.dumps(request)}")
 23 |     server_process.stdin.write(json.dumps(request) + "\n")
 24 |     server_process.stdin.flush()
 25 |     while True:
 26 |         response_line = server_process.stdout.readline()
 27 |         print(f"<-- Received line: {response_line.strip()}")
 28 |         try:
 29 |             response = json.loads(response_line)
 30 |             if response.get("id") == request["id"]:
 31 |                 return json.loads(response["result"]["content"][0]["text"])
 32 |         except (json.JSONDecodeError, KeyError):
 33 |             continue
 34 | 
 35 | def run_command(command, shell=False, check=True):
 36 |     cmd_str = command if isinstance(command, str) else ' '.join(command)
 37 |     print(f"[CMD] {cmd_str}")
 38 |     try:
 39 |         process = subprocess.run(
 40 |             command,
 41 |             shell=shell,
 42 |             check=check,
 43 |             capture_output=True,
 44 |             text=True,
 45 |             timeout=300,
 46 |         )
 47 |         return process
 48 |     except subprocess.CalledProcessError as e:
 49 |         print(f"[ERROR] Error executing command: {cmd_str}")
 50 |         if e.stdout:
 51 |             print(f"[ERROR] STDOUT: {e.stdout}")
 52 |         if e.stderr:
 53 |             print(f"[ERROR] STDERR: {e.stderr}")
 54 |         return None
 55 |     except subprocess.TimeoutExpired:
 56 |         print(f"[ERROR] Command timed out: {cmd_str}")
 57 |         return None
 58 | 
 59 | def test_end_to_end_workflow_local_db():
 60 |     if not run_command(["docker", "--version"], check=False) or not run_command(["docker", "compose", "version"], check=False):
 61 |         pytest.skip("Docker or Docker Compose not found. Skipping test.")
 62 | 
 63 |     print("\n--- Setting up local Neo4j database ---")
 64 |     password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(12))
 65 |     compose_content = f"""
 66 | services:
 67 |   neo4j:
 68 |     image: neo4j:5.21
 69 |     container_name: neo4j-cgc-test
 70 |     restart: unless-stopped
 71 |     ports:
 72 |       - "7474:7474"
 73 |       - "7687:7687"
 74 |     environment:
 75 |       - NEO4J_AUTH=neo4j/{password}
 76 |       - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
 77 |     volumes:
 78 |       - neo4j_data:/data
 79 |       - neo4j_logs:/logs
 80 | 
 81 | volumes:
 82 |   neo4j_data:
 83 |   neo4j_logs:
 84 | """
 85 |     compose_file = os.path.join(os.path.dirname(__file__), "..", "docker-compose-test.yml")
 86 |     with open(compose_file, "w") as f:
 87 |         f.write(compose_content)
 88 | 
 89 |     env_path = os.path.join(os.path.dirname(__file__), "..", ".env")
 90 |     server_process = None
 91 | 
 92 |     try:
 93 |         print("--- Starting Neo4j container ---")
 94 |         run_command(["docker", "compose", "-f", compose_file, "up", "-d"])
 95 | 
 96 |         print("--- Waiting for Neo4j to be ready ---")
 97 |         max_attempts = 24
 98 |         for attempt in range(max_attempts):
 99 |             time.sleep(5)
100 |             health_check = run_command([
101 |                 "docker", "exec", "neo4j-cgc-test", "cypher-shell",
102 |                 "-u", "neo4j", "-p", password,
103 |                 "RETURN 'Connection successful' as status"
104 |             ], check=False)
105 |             if health_check and health_check.returncode == 0:
106 |                 print("--- Neo4j is ready ---")
107 |                 break
108 |             if attempt == max_attempts - 1:
109 |                 pytest.fail("Neo4j container did not become ready in time.")
110 | 
111 |         print("--- Creating .env file for server ---")
112 |         env_content = f"""
113 | NEO4J_URI=neo4j://localhost:7687
114 | NEO4J_USERNAME=neo4j
115 | NEO4J_PASSWORD={password}
116 | """
117 |         with open(env_path, "w") as f:
118 |             f.write(env_content)
119 | 
120 |         print("--- Starting server ---")
121 |         server_process = subprocess.Popen(
122 |             ["cgc", "start"],
123 |             stdin=subprocess.PIPE,
124 |             stdout=subprocess.PIPE,
125 |             stderr=subprocess.PIPE,
126 |             text=True,
127 |             cwd=os.path.join(os.path.dirname(__file__), "..")
128 |         )
129 |         for line in iter(server_process.stderr.readline, ''):
130 |             print(f"STDERR: {line.strip()}")
131 |             if "MCP Server is running" in line:
132 |                 break
133 |         
134 |         init_request = {"jsonrpc": "2.0", "id": 0, "method": "initialize", "params": {}}
135 |         server_process.stdin.write(json.dumps(init_request) + "\n")
136 |         server_process.stdin.flush()
137 |         while True:
138 |             response_line = server_process.stdout.readline()
139 |             try:
140 |                 init_response = json.loads(response_line)
141 |                 if init_response.get("id") == 0:
142 |                     break
143 |             except json.JSONDecodeError:
144 |                 continue
145 | 
146 |         print("--- Calling tools ---")
147 |         delete_result = call_tool(server_process, "delete_repository", {"repo_path": SAMPLE_PROJECT_PATH})
148 |         assert delete_result.get("success") is True
149 | 
150 |         add_result = call_tool(server_process, "add_code_to_graph", {"path": SAMPLE_PROJECT_PATH})
151 |         assert add_result.get("success") is True
152 |         job_id = add_result.get("job_id")
153 |         assert job_id is not None
154 | 
155 |         while True:
156 |             status_result = call_tool(server_process, "check_job_status", {"job_id": job_id})
157 |             if status_result.get("job", {}).get("status") == "completed":
158 |                 break
159 |             time.sleep(2)
160 | 
161 |         list_result = call_tool(server_process, "list_indexed_repositories", {})
162 |         assert list_result.get("success") is True
163 |         assert SAMPLE_PROJECT_PATH in [repo["path"] for repo in list_result.get("repositories", [])]
164 | 
165 |     finally:
166 |         print("--- Shutting down server and Neo4j container ---")
167 |         if server_process:
168 |             server_process.terminate()
169 |             server_process.wait()
170 |         run_command(["docker", "compose", "-f", compose_file, "down"])
171 | 
172 |         if os.path.exists(env_path):
173 |             os.remove(env_path)
174 |         if os.path.exists(compose_file):
175 |             os.remove(compose_file)
```

--------------------------------------------------------------------------------
/website/src/components/DemoSection.tsx:
--------------------------------------------------------------------------------

```typescript
  1 | import { Card, CardContent } from "@/components/ui/card";
  2 | import { Badge } from "@/components/ui/badge";
  3 | import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
  4 | import { motion } from "framer-motion";
  5 | import graphTotalImage from "../assets/graph-total.png";
  6 | import functionCallsImage from "../assets/function-calls.png";
  7 | import hierarchyImage from "../assets/hierarchy.png";
  8 | import type { Variants } from "framer-motion";
  9 | 
 10 | const DemoSection = () => {
 11 |   const visualizations = [
 12 |     {
 13 |       title: "Complete Code Graph",
 14 |       description: "All components and relationships between code elements.",
 15 |       image: graphTotalImage,
 16 |       badge: "Full Overview",
 17 |       aos: "fade-up",
 18 |     },
 19 |     {
 20 |       title: "Function Call Analysis",
 21 |       description: "Direct and indirect function calls across directories.",
 22 |       image: functionCallsImage,
 23 |       badge: "Call Chains",
 24 |       aos: "zoom-in",
 25 |     },
 26 |     {
 27 |       title: "Project Hierarchy",
 28 |       description: "Hierarchical structure of files and dependencies.",
 29 |       image: hierarchyImage,
 30 |       badge: "File Structure",
 31 |       aos: "flip-up",
 32 |     },
 33 |   ];
 34 | 
 35 | const containerVariants: Variants = {
 36 |   hidden: { opacity: 0 },
 37 |   visible: {
 38 |     opacity: 1,
 39 |     transition: { staggerChildren: 0.2, delayChildren: 0.1 },
 40 |   },
 41 | };
 42 | 
 43 | const itemVariants: Variants = {
 44 |   hidden: { y: 20, opacity: 0 },
 45 |   visible: {
 46 |     y: 0,
 47 |     opacity: 1,
 48 |     transition: { duration: 0.6, ease: "easeOut" },
 49 |   },
 50 | };
 51 | 
 52 | 
 53 |   return (
 54 |     <section
 55 |       className="py-20 px-4 bg-gradient-to-b from-background to-secondary/10"
 56 |       data-aos="fade-in"
 57 |       data-aos-duration="800"
 58 |     >
 59 |       <div className="container mx-auto max-w-7xl">
 60 |         {/* Heading Section */}
 61 |         <motion.div
 62 |           className="text-center mb-16"
 63 |           initial={{ opacity: 0, y: -20 }}
 64 |           whileInView={{ opacity: 1, y: 0 }}
 65 |           viewport={{ once: true, amount: 0.5 }}
 66 |           transition={{ duration: 0.7 }}
 67 |         >
 68 |           <h2
 69 |             className="text-3xl sm:text-4xl md:text-5xl font-bold mb-6 bg-gradient-to-r from-primary via-primary to-accent bg-clip-text text-transparent py-2"
 70 |             data-aos="fade-down"
 71 |             data-aos-duration="1000"
 72 |           >
 73 |             See CodeGraphContext in Action
 74 |           </h2>
 75 |           <p
 76 |             className="text-xl text-muted-foreground max-w-3xl mx-auto mb-12"
 77 |             data-aos="fade-up"
 78 |             data-aos-delay="200"
 79 |           >
 80 |             Watch how CodeGraphContext transforms complex codebases into
 81 |             interactive knowledge graphs.
 82 |           </p>
 83 |         </motion.div>
 84 | 
 85 |         {/* Embedded Demo Video */}
 86 |         <motion.div
 87 |           className="max-w-4xl mx-auto mb-16"
 88 |           initial={{ opacity: 0, scale: 0.9 }}
 89 |           whileInView={{ opacity: 1, scale: 1 }}
 90 |           viewport={{ once: true, amount: 0.3 }}
 91 |           transition={{ duration: 0.8, ease: "easeInOut" }}
 92 |           data-aos="zoom-in"
 93 |         >
 94 |           <div className="relative aspect-video rounded-lg overflow-hidden shadow-2xl border border-border/50">
 95 |             <iframe
 96 |               src="https://www.youtube.com/embed/KYYSdxhg1xU?autoplay=1&mute=1&loop=1&playlist=KYYSdxhg1xU"
 97 |               title="CodeGraphContext Demo"
 98 |               allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
 99 |               allowFullScreen
100 |               className="w-full h-full"
101 |             />
102 |           </div>
103 |         </motion.div>
104 | 
105 |         {/* Interactive Visualizations Section */}
106 |         <div className="mb-12">
107 |           <h3
108 |             className="text-3xl font-bold text-center mb-8"
109 |             data-aos="fade-up"
110 |             data-aos-delay="100"
111 |           >
112 |             Interactive Visualizations
113 |           </h3>
114 | 
115 |           <motion.div
116 |             className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"
117 |             variants={containerVariants}
118 |             initial="hidden"
119 |             whileInView="visible"
120 |             viewport={{ once: true, amount: 0.2 }}
121 |           >
122 |             {visualizations.map((viz, index) => (
123 |               <motion.div
124 |                 key={index}
125 |                 variants={itemVariants}
126 |                 data-aos={viz.aos}
127 |                 data-aos-delay={index * 150}
128 |               >
129 |                 <Card className="group hover:shadow-xl transition-all duration-300 border-border/50 overflow-hidden w-full h-full bg-background/70 backdrop-blur-sm">
130 |                   <Dialog>
131 |                     <DialogTrigger asChild>
132 |                       <div className="relative cursor-pointer flex flex-col h-full">
133 |                         <div className="relative">
134 |                           <img
135 |                             src={viz.image}
136 |                             alt={viz.title}
137 |                             className="w-full h-48 object-cover group-hover:scale-105 transition-transform duration-300"
138 |                             loading="lazy"
139 |                           />
140 |                           <Badge className="absolute top-2 left-2 text-xs">
141 |                             {viz.badge}
142 |                           </Badge>
143 |                         </div>
144 |                         <CardContent className="p-6 flex-grow flex flex-col">
145 |                           <h4 className="text-xl font-semibold mb-3 group-hover:text-primary transition-colors">
146 |                             {viz.title}
147 |                           </h4>
148 |                           <p className="text-base text-muted-foreground flex-grow">
149 |                             {viz.description}
150 |                           </p>
151 |                         </CardContent>
152 |                       </div>
153 |                     </DialogTrigger>
154 | 
155 |                     {/* Dialog Content */}
156 |                     <DialogContent className="max-w-5xl w-full">
157 |                       <img
158 |                         src={viz.image}
159 |                         alt={`${viz.title} Visualization`}
160 |                         className="w-full h-auto max-h-[80vh] object-contain rounded-lg"
161 |                       />
162 |                     </DialogContent>
163 |                   </Dialog>
164 |                 </Card>
165 |               </motion.div>
166 |             ))}
167 |           </motion.div>
168 |         </div>
169 |       </div>
170 |     </section>
171 |   );
172 | };
173 | 
174 | export default DemoSection;
175 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_rust/src/structs_enums.rs:
--------------------------------------------------------------------------------

```rust
  1 | // structs_enums.rs - Demonstrates Rust structs and enums
  2 | use std::fmt;
  3 | 
  4 | /// Basic struct with public fields
  5 | #[derive(Debug, Clone, PartialEq)]
  6 | pub struct Person {
  7 |     pub name: String,
  8 |     pub age: u32,
  9 | }
 10 | 
 11 | /// Struct with private fields
 12 | #[derive(Debug)]
 13 | pub struct BankAccount {
 14 |     balance: f64,
 15 |     account_number: String,
 16 | }
 17 | 
 18 | /// Tuple struct
 19 | #[derive(Debug, Clone, Copy)]
 20 | pub struct Point(pub i32, pub i32);
 21 | 
 22 | /// Unit struct
 23 | #[derive(Debug)]
 24 | pub struct Unit;
 25 | 
 26 | /// Struct with lifetime parameter
 27 | #[derive(Debug)]
 28 | pub struct BookReference<'a> {
 29 |     title: &'a str,
 30 |     author: &'a str,
 31 | }
 32 | 
 33 | /// Generic struct
 34 | #[derive(Debug)]
 35 | pub struct Container<T> {
 36 |     value: T,
 37 | }
 38 | 
 39 | impl Person {
 40 |     /// Constructor function (associated function)
 41 |     pub fn new(name: String, age: u32) -> Self {
 42 |         Self { name, age }
 43 |     }
 44 | 
 45 |     /// Method with immutable self
 46 |     pub fn greet(&self) -> String {
 47 |         format!("Hello, my name is {} and I'm {} years old", self.name, self.age)
 48 |     }
 49 | 
 50 |     /// Method with mutable self
 51 |     pub fn have_birthday(&mut self) {
 52 |         self.age += 1;
 53 |     }
 54 | 
 55 |     /// Method consuming self
 56 |     pub fn into_name(self) -> String {
 57 |         self.name
 58 |     }
 59 | 
 60 |     /// Method returning reference
 61 |     pub fn get_name(&self) -> &str {
 62 |         &self.name
 63 |     }
 64 | 
 65 |     /// Associated function
 66 |     pub fn default_person() -> Self {
 67 |         Self {
 68 |             name: String::from("Unknown"),
 69 |             age: 0,
 70 |         }
 71 |     }
 72 | 
 73 |     /// Method with additional parameters
 74 |     pub fn is_older_than(&self, other: &Person) -> bool {
 75 |         self.age > other.age
 76 |     }
 77 | }
 78 | 
 79 | impl BankAccount {
 80 |     pub fn new(account_number: String, initial_balance: f64) -> Self {
 81 |         Self {
 82 |             balance: initial_balance,
 83 |             account_number,
 84 |         }
 85 |     }
 86 | 
 87 |     pub fn deposit(&mut self, amount: f64) -> Result<(), String> {
 88 |         if amount <= 0.0 {
 89 |             return Err("Deposit amount must be positive".to_string());
 90 |         }
 91 |         self.balance += amount;
 92 |         Ok(())
 93 |     }
 94 | 
 95 |     pub fn withdraw(&mut self, amount: f64) -> Result<(), String> {
 96 |         if amount <= 0.0 {
 97 |             return Err("Withdrawal amount must be positive".to_string());
 98 |         }
 99 |         if amount > self.balance {
100 |             return Err("Insufficient funds".to_string());
101 |         }
102 |         self.balance -= amount;
103 |         Ok(())
104 |     }
105 | 
106 |     pub fn get_balance(&self) -> f64 {
107 |         self.balance
108 |     }
109 | }
110 | 
111 | impl Point {
112 |     pub fn new(x: i32, y: i32) -> Self {
113 |         Point(x, y)
114 |     }
115 | 
116 |     pub fn distance_from_origin(&self) -> f64 {
117 |         ((self.0.pow(2) + self.1.pow(2)) as f64).sqrt()
118 |     }
119 | 
120 |     pub fn translate(&mut self, dx: i32, dy: i32) {
121 |         self.0 += dx;
122 |         self.1 += dy;
123 |     }
124 | }
125 | 
126 | impl<T> Container<T> {
127 |     pub fn new(value: T) -> Self {
128 |         Self { value }
129 |     }
130 | 
131 |     pub fn get(&self) -> &T {
132 |         &self.value
133 |     }
134 | 
135 |     pub fn set(&mut self, value: T) {
136 |         self.value = value;
137 |     }
138 | 
139 |     pub fn into_inner(self) -> T {
140 |         self.value
141 |     }
142 | }
143 | 
144 | // Enums
145 | 
146 | /// Simple enum
147 | #[derive(Debug, Clone, Copy, PartialEq)]
148 | pub enum Status {
149 |     Active,
150 |     Inactive,
151 |     Pending,
152 | }
153 | 
154 | /// Enum with data
155 | #[derive(Debug, Clone, PartialEq)]
156 | pub enum Message {
157 |     Quit,
158 |     Move { x: i32, y: i32 },
159 |     Write(String),
160 |     ChangeColor(u8, u8, u8),
161 | }
162 | 
163 | /// Result-like enum
164 | #[derive(Debug)]
165 | pub enum MyResult<T, E> {
166 |     Ok(T),
167 |     Err(E),
168 | }
169 | 
170 | /// Option-like enum
171 | #[derive(Debug)]
172 | pub enum MyOption<T> {
173 |     Some(T),
174 |     None,
175 | }
176 | 
177 | /// Enum with methods
178 | #[derive(Debug, Clone)]
179 | pub enum TrafficLight {
180 |     Red,
181 |     Yellow,
182 |     Green,
183 | }
184 | 
185 | impl TrafficLight {
186 |     pub fn duration(&self) -> u32 {
187 |         match self {
188 |             TrafficLight::Red => 60,
189 |             TrafficLight::Yellow => 10,
190 |             TrafficLight::Green => 50,
191 |         }
192 |     }
193 | 
194 |     pub fn next(&self) -> TrafficLight {
195 |         match self {
196 |             TrafficLight::Red => TrafficLight::Green,
197 |             TrafficLight::Yellow => TrafficLight::Red,
198 |             TrafficLight::Green => TrafficLight::Yellow,
199 |         }
200 |     }
201 | }
202 | 
203 | impl Message {
204 |     pub fn call(&self) {
205 |         match self {
206 |             Message::Quit => println!("Quitting"),
207 |             Message::Move { x, y } => println!("Moving to ({}, {})", x, y),
208 |             Message::Write(text) => println!("Writing: {}", text),
209 |             Message::ChangeColor(r, g, b) => println!("Changing color to RGB({}, {}, {})", r, g, b),
210 |         }
211 |     }
212 | }
213 | 
214 | /// Pattern matching with enums
215 | pub fn process_message(msg: Message) -> String {
216 |     match msg {
217 |         Message::Quit => "Quit command".to_string(),
218 |         Message::Move { x, y } if x > 0 && y > 0 => format!("Moving to positive quadrant: ({}, {})", x, y),
219 |         Message::Move { x, y } => format!("Moving to: ({}, {})", x, y),
220 |         Message::Write(text) => format!("Text: {}", text),
221 |         Message::ChangeColor(r, g, b) => format!("Color: RGB({}, {}, {})", r, g, b),
222 |     }
223 | }
224 | 
225 | /// Enum with tuple variants
226 | #[derive(Debug)]
227 | pub enum IpAddr {
228 |     V4(u8, u8, u8, u8),
229 |     V6(String),
230 | }
231 | 
232 | impl IpAddr {
233 |     pub fn is_loopback(&self) -> bool {
234 |         match self {
235 |             IpAddr::V4(127, 0, 0, 1) => true,
236 |             IpAddr::V6(s) if s == "::1" => true,
237 |             _ => false,
238 |         }
239 |     }
240 | }
241 | 
242 | impl fmt::Display for Person {
243 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
244 |         write!(f, "Person {{ name: {}, age: {} }}", self.name, self.age)
245 |     }
246 | }
247 | 
248 | impl fmt::Display for Status {
249 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
250 |         match self {
251 |             Status::Active => write!(f, "Active"),
252 |             Status::Inactive => write!(f, "Inactive"),
253 |             Status::Pending => write!(f, "Pending"),
254 |         }
255 |     }
256 | }
257 | 
258 | #[cfg(test)]
259 | mod tests {
260 |     use super::*;
261 | 
262 |     #[test]
263 |     fn test_person_creation() {
264 |         let person = Person::new("Alice".to_string(), 30);
265 |         assert_eq!(person.name, "Alice");
266 |         assert_eq!(person.age, 30);
267 |     }
268 | 
269 |     #[test]
270 |     fn test_person_birthday() {
271 |         let mut person = Person::new("Bob".to_string(), 25);
272 |         person.have_birthday();
273 |         assert_eq!(person.age, 26);
274 |     }
275 | 
276 |     #[test]
277 |     fn test_message_matching() {
278 |         let msg = Message::Move { x: 10, y: 20 };
279 |         let result = process_message(msg);
280 |         assert!(result.contains("Moving"));
281 |     }
282 | }
283 | 
284 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/carousel.tsx:
--------------------------------------------------------------------------------

```typescript
  1 | import * as React from "react";
  2 | import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
  3 | import { ArrowLeft, ArrowRight } from "lucide-react";
  4 | 
  5 | import { cn } from "@/lib/utils";
  6 | import { Button } from "@/components/ui/button";
  7 | 
  8 | type CarouselApi = UseEmblaCarouselType[1];
  9 | type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
 10 | type CarouselOptions = UseCarouselParameters[0];
 11 | type CarouselPlugin = UseCarouselParameters[1];
 12 | 
 13 | type CarouselProps = {
 14 |   opts?: CarouselOptions;
 15 |   plugins?: CarouselPlugin;
 16 |   orientation?: "horizontal" | "vertical";
 17 |   setApi?: (api: CarouselApi) => void;
 18 | };
 19 | 
 20 | type CarouselContextProps = {
 21 |   carouselRef: ReturnType<typeof useEmblaCarousel>[0];
 22 |   api: ReturnType<typeof useEmblaCarousel>[1];
 23 |   scrollPrev: () => void;
 24 |   scrollNext: () => void;
 25 |   canScrollPrev: boolean;
 26 |   canScrollNext: boolean;
 27 | } & CarouselProps;
 28 | 
 29 | const CarouselContext = React.createContext<CarouselContextProps | null>(null);
 30 | 
 31 | function useCarousel() {
 32 |   const context = React.useContext(CarouselContext);
 33 | 
 34 |   if (!context) {
 35 |     throw new Error("useCarousel must be used within a <Carousel />");
 36 |   }
 37 | 
 38 |   return context;
 39 | }
 40 | 
 41 | const Carousel = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & CarouselProps>(
 42 |   ({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }, ref) => {
 43 |     const [carouselRef, api] = useEmblaCarousel(
 44 |       {
 45 |         ...opts,
 46 |         axis: orientation === "horizontal" ? "x" : "y",
 47 |       },
 48 |       plugins,
 49 |     );
 50 |     const [canScrollPrev, setCanScrollPrev] = React.useState(false);
 51 |     const [canScrollNext, setCanScrollNext] = React.useState(false);
 52 | 
 53 |     const onSelect = React.useCallback((api: CarouselApi) => {
 54 |       if (!api) {
 55 |         return;
 56 |       }
 57 | 
 58 |       setCanScrollPrev(api.canScrollPrev());
 59 |       setCanScrollNext(api.canScrollNext());
 60 |     }, []);
 61 | 
 62 |     const scrollPrev = React.useCallback(() => {
 63 |       api?.scrollPrev();
 64 |     }, [api]);
 65 | 
 66 |     const scrollNext = React.useCallback(() => {
 67 |       api?.scrollNext();
 68 |     }, [api]);
 69 | 
 70 |     const handleKeyDown = React.useCallback(
 71 |       (event: React.KeyboardEvent<HTMLDivElement>) => {
 72 |         if (event.key === "ArrowLeft") {
 73 |           event.preventDefault();
 74 |           scrollPrev();
 75 |         } else if (event.key === "ArrowRight") {
 76 |           event.preventDefault();
 77 |           scrollNext();
 78 |         }
 79 |       },
 80 |       [scrollPrev, scrollNext],
 81 |     );
 82 | 
 83 |     React.useEffect(() => {
 84 |       if (!api || !setApi) {
 85 |         return;
 86 |       }
 87 | 
 88 |       setApi(api);
 89 |     }, [api, setApi]);
 90 | 
 91 |     React.useEffect(() => {
 92 |       if (!api) {
 93 |         return;
 94 |       }
 95 | 
 96 |       onSelect(api);
 97 |       api.on("reInit", onSelect);
 98 |       api.on("select", onSelect);
 99 | 
100 |       return () => {
101 |         api?.off("select", onSelect);
102 |       };
103 |     }, [api, onSelect]);
104 | 
105 |     return (
106 |       <CarouselContext.Provider
107 |         value={{
108 |           carouselRef,
109 |           api: api,
110 |           opts,
111 |           orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
112 |           scrollPrev,
113 |           scrollNext,
114 |           canScrollPrev,
115 |           canScrollNext,
116 |         }}
117 |       >
118 |         <div
119 |           ref={ref}
120 |           onKeyDownCapture={handleKeyDown}
121 |           className={cn("relative", className)}
122 |           role="region"
123 |           aria-roledescription="carousel"
124 |           {...props}
125 |         >
126 |           {children}
127 |         </div>
128 |       </CarouselContext.Provider>
129 |     );
130 |   },
131 | );
132 | Carousel.displayName = "Carousel";
133 | 
134 | const CarouselContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
135 |   ({ className, ...props }, ref) => {
136 |     const { carouselRef, orientation } = useCarousel();
137 | 
138 |     return (
139 |       <div ref={carouselRef} className="overflow-hidden">
140 |         <div
141 |           ref={ref}
142 |           className={cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className)}
143 |           {...props}
144 |         />
145 |       </div>
146 |     );
147 |   },
148 | );
149 | CarouselContent.displayName = "CarouselContent";
150 | 
151 | const CarouselItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
152 |   ({ className, ...props }, ref) => {
153 |     const { orientation } = useCarousel();
154 | 
155 |     return (
156 |       <div
157 |         ref={ref}
158 |         role="group"
159 |         aria-roledescription="slide"
160 |         className={cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className)}
161 |         {...props}
162 |       />
163 |     );
164 |   },
165 | );
166 | CarouselItem.displayName = "CarouselItem";
167 | 
168 | const CarouselPrevious = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(
169 |   ({ className, variant = "outline", size = "icon", ...props }, ref) => {
170 |     const { orientation, scrollPrev, canScrollPrev } = useCarousel();
171 | 
172 |     return (
173 |       <Button
174 |         ref={ref}
175 |         variant={variant}
176 |         size={size}
177 |         className={cn(
178 |           "absolute h-8 w-8 rounded-full",
179 |           orientation === "horizontal"
180 |             ? "-left-12 top-1/2 -translate-y-1/2"
181 |             : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
182 |           className,
183 |         )}
184 |         disabled={!canScrollPrev}
185 |         onClick={scrollPrev}
186 |         {...props}
187 |       >
188 |         <ArrowLeft className="h-4 w-4" />
189 |         <span className="sr-only">Previous slide</span>
190 |       </Button>
191 |     );
192 |   },
193 | );
194 | CarouselPrevious.displayName = "CarouselPrevious";
195 | 
196 | const CarouselNext = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(
197 |   ({ className, variant = "outline", size = "icon", ...props }, ref) => {
198 |     const { orientation, scrollNext, canScrollNext } = useCarousel();
199 | 
200 |     return (
201 |       <Button
202 |         ref={ref}
203 |         variant={variant}
204 |         size={size}
205 |         className={cn(
206 |           "absolute h-8 w-8 rounded-full",
207 |           orientation === "horizontal"
208 |             ? "-right-12 top-1/2 -translate-y-1/2"
209 |             : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
210 |           className,
211 |         )}
212 |         disabled={!canScrollNext}
213 |         onClick={scrollNext}
214 |         {...props}
215 |       >
216 |         <ArrowRight className="h-4 w-4" />
217 |         <span className="sr-only">Next slide</span>
218 |       </Button>
219 |     );
220 |   },
221 | );
222 | CarouselNext.displayName = "CarouselNext";
223 | 
224 | export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext };
225 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_go/generics.go:
--------------------------------------------------------------------------------

```go
  1 | // generics.go - Demonstrates Go generics (Go 1.18+)
  2 | package main
  3 | 
  4 | import (
  5 | 	"fmt"
  6 | 	"golang.org/x/exp/constraints"
  7 | )
  8 | 
  9 | // GenericMax returns the maximum of two values
 10 | func GenericMax[T constraints.Ordered](a, b T) T {
 11 | 	if a > b {
 12 | 		return a
 13 | 	}
 14 | 	return b
 15 | }
 16 | 
 17 | // GenericMin returns the minimum of two values
 18 | func GenericMin[T constraints.Ordered](a, b T) T {
 19 | 	if a < b {
 20 | 		return a
 21 | 	}
 22 | 	return b
 23 | }
 24 | 
 25 | // Stack is a generic stack data structure
 26 | type Stack[T any] struct {
 27 | 	items []T
 28 | }
 29 | 
 30 | // Push adds an item to the stack
 31 | func (s *Stack[T]) Push(item T) {
 32 | 	s.items = append(s.items, item)
 33 | }
 34 | 
 35 | // Pop removes and returns the top item
 36 | func (s *Stack[T]) Pop() (T, bool) {
 37 | 	if len(s.items) == 0 {
 38 | 		var zero T
 39 | 		return zero, false
 40 | 	}
 41 | 	item := s.items[len(s.items)-1]
 42 | 	s.items = s.items[:len(s.items)-1]
 43 | 	return item, true
 44 | }
 45 | 
 46 | // Peek returns the top item without removing it
 47 | func (s *Stack[T]) Peek() (T, bool) {
 48 | 	if len(s.items) == 0 {
 49 | 		var zero T
 50 | 		return zero, false
 51 | 	}
 52 | 	return s.items[len(s.items)-1], true
 53 | }
 54 | 
 55 | // IsEmpty returns true if stack is empty
 56 | func (s *Stack[T]) IsEmpty() bool {
 57 | 	return len(s.items) == 0
 58 | }
 59 | 
 60 | // Size returns the number of items in the stack
 61 | func (s *Stack[T]) Size() int {
 62 | 	return len(s.items)
 63 | }
 64 | 
 65 | // Queue is a generic queue data structure
 66 | type Queue[T any] struct {
 67 | 	items []T
 68 | }
 69 | 
 70 | // Enqueue adds an item to the queue
 71 | func (q *Queue[T]) Enqueue(item T) {
 72 | 	q.items = append(q.items, item)
 73 | }
 74 | 
 75 | // Dequeue removes and returns the first item
 76 | func (q *Queue[T]) Dequeue() (T, bool) {
 77 | 	if len(q.items) == 0 {
 78 | 		var zero T
 79 | 		return zero, false
 80 | 	}
 81 | 	item := q.items[0]
 82 | 	q.items = q.items[1:]
 83 | 	return item, true
 84 | }
 85 | 
 86 | // Map applies a function to each element
 87 | func Map[T any, U any](items []T, fn func(T) U) []U {
 88 | 	result := make([]U, len(items))
 89 | 	for i, item := range items {
 90 | 		result[i] = fn(item)
 91 | 	}
 92 | 	return result
 93 | }
 94 | 
 95 | // Filter filters items based on a predicate
 96 | func Filter[T any](items []T, predicate func(T) bool) []T {
 97 | 	var result []T
 98 | 	for _, item := range items {
 99 | 		if predicate(item) {
100 | 			result = append(result, item)
101 | 		}
102 | 	}
103 | 	return result
104 | }
105 | 
106 | // Reduce reduces a slice to a single value
107 | func Reduce[T any, U any](items []T, initial U, fn func(U, T) U) U {
108 | 	result := initial
109 | 	for _, item := range items {
110 | 		result = fn(result, item)
111 | 	}
112 | 	return result
113 | }
114 | 
115 | // Contains checks if a slice contains an item
116 | func Contains[T comparable](items []T, target T) bool {
117 | 	for _, item := range items {
118 | 		if item == target {
119 | 			return true
120 | 		}
121 | 	}
122 | 	return false
123 | }
124 | 
125 | // Pair is a generic pair type
126 | type Pair[T any, U any] struct {
127 | 	First  T
128 | 	Second U
129 | }
130 | 
131 | // NewPair creates a new pair
132 | func NewPair[T any, U any](first T, second U) Pair[T, U] {
133 | 	return Pair[T, U]{First: first, Second: second}
134 | }
135 | 
136 | // Swap swaps the values in a pair
137 | func (p Pair[T, U]) Swap() Pair[U, T] {
138 | 	return Pair[U, T]{First: p.Second, Second: p.First}
139 | }
140 | 
141 | // LinkedListNode is a generic linked list node
142 | type LinkedListNode[T any] struct {
143 | 	Value T
144 | 	Next  *LinkedListNode[T]
145 | }
146 | 
147 | // LinkedList is a generic linked list
148 | type LinkedList[T any] struct {
149 | 	Head *LinkedListNode[T]
150 | 	Tail *LinkedListNode[T]
151 | 	size int
152 | }
153 | 
154 | // Append adds a value to the end of the list
155 | func (ll *LinkedList[T]) Append(value T) {
156 | 	node := &LinkedListNode[T]{Value: value}
157 | 	if ll.Head == nil {
158 | 		ll.Head = node
159 | 		ll.Tail = node
160 | 	} else {
161 | 		ll.Tail.Next = node
162 | 		ll.Tail = node
163 | 	}
164 | 	ll.size++
165 | }
166 | 
167 | // Prepend adds a value to the beginning of the list
168 | func (ll *LinkedList[T]) Prepend(value T) {
169 | 	node := &LinkedListNode[T]{Value: value, Next: ll.Head}
170 | 	ll.Head = node
171 | 	if ll.Tail == nil {
172 | 		ll.Tail = node
173 | 	}
174 | 	ll.size++
175 | }
176 | 
177 | // ToSlice converts the linked list to a slice
178 | func (ll *LinkedList[T]) ToSlice() []T {
179 | 	result := make([]T, 0, ll.size)
180 | 	current := ll.Head
181 | 	for current != nil {
182 | 		result = append(result, current.Value)
183 | 		current = current.Next
184 | 	}
185 | 	return result
186 | }
187 | 
188 | // Number constraint for numeric types
189 | type Number interface {
190 | 	constraints.Integer | constraints.Float
191 | }
192 | 
193 | // Sum calculates the sum of numbers
194 | func Sum[T Number](numbers []T) T {
195 | 	var sum T
196 | 	for _, num := range numbers {
197 | 		sum += num
198 | 	}
199 | 	return sum
200 | }
201 | 
202 | // Average calculates the average of numbers
203 | func Average[T Number](numbers []T) float64 {
204 | 	if len(numbers) == 0 {
205 | 		return 0
206 | 	}
207 | 	total := Sum(numbers)
208 | 	return float64(total) / float64(len(numbers))
209 | }
210 | 
211 | // Cache is a generic cache with type constraints
212 | type Cache[K comparable, V any] struct {
213 | 	data map[K]V
214 | }
215 | 
216 | // NewCache creates a new cache
217 | func NewCache[K comparable, V any]() *Cache[K, V] {
218 | 	return &Cache[K, V]{
219 | 		data: make(map[K]V),
220 | 	}
221 | }
222 | 
223 | // Set adds or updates a value in the cache
224 | func (c *Cache[K, V]) Set(key K, value V) {
225 | 	c.data[key] = value
226 | }
227 | 
228 | // Get retrieves a value from the cache
229 | func (c *Cache[K, V]) Get(key K) (V, bool) {
230 | 	value, ok := c.data[key]
231 | 	return value, ok
232 | }
233 | 
234 | // Delete removes a value from the cache
235 | func (c *Cache[K, V]) Delete(key K) {
236 | 	delete(c.data, key)
237 | }
238 | 
239 | // Keys returns all keys in the cache
240 | func (c *Cache[K, V]) Keys() []K {
241 | 	keys := make([]K, 0, len(c.data))
242 | 	for k := range c.data {
243 | 		keys = append(keys, k)
244 | 	}
245 | 	return keys
246 | }
247 | 
248 | // FindFirst returns the first item matching the predicate
249 | func FindFirst[T any](items []T, predicate func(T) bool) (T, bool) {
250 | 	for _, item := range items {
251 | 		if predicate(item) {
252 | 			return item, true
253 | 		}
254 | 	}
255 | 	var zero T
256 | 	return zero, false
257 | }
258 | 
259 | // GroupBy groups items by a key function
260 | func GroupBy[T any, K comparable](items []T, keyFn func(T) K) map[K][]T {
261 | 	result := make(map[K][]T)
262 | 	for _, item := range items {
263 | 		key := keyFn(item)
264 | 		result[key] = append(result[key], item)
265 | 	}
266 | 	return result
267 | }
268 | 
269 | func demonstrateGenerics() {
270 | 	// Generic functions
271 | 	fmt.Println("Max:", GenericMax(10, 20))
272 | 	fmt.Println("Max:", GenericMax(3.14, 2.71))
273 | 	
274 | 	// Generic stack
275 | 	stack := Stack[int]{}
276 | 	stack.Push(1)
277 | 	stack.Push(2)
278 | 	stack.Push(3)
279 | 	val, _ := stack.Pop()
280 | 	fmt.Println("Popped:", val)
281 | 	
282 | 	// Generic map/filter/reduce
283 | 	numbers := []int{1, 2, 3, 4, 5}
284 | 	doubled := Map(numbers, func(n int) int { return n * 2 })
285 | 	fmt.Println("Doubled:", doubled)
286 | 	
287 | 	evens := Filter(numbers, func(n int) bool { return n%2 == 0 })
288 | 	fmt.Println("Evens:", evens)
289 | 	
290 | 	sum := Reduce(numbers, 0, func(acc, n int) int { return acc + n })
291 | 	fmt.Println("Sum:", sum)
292 | 	
293 | 	// Generic cache
294 | 	cache := NewCache[string, int]()
295 | 	cache.Set("age", 30)
296 | 	age, _ := cache.Get("age")
297 | 	fmt.Println("Age:", age)
298 | }
299 | 
300 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_go/embedded_composition.go:
--------------------------------------------------------------------------------

```go
  1 | // embedded_composition.go - Demonstrates Go embedding and composition
  2 | package main
  3 | 
  4 | import "fmt"
  5 | 
  6 | // Base is a base struct
  7 | type Base struct {
  8 | 	ID   int
  9 | 	Name string
 10 | }
 11 | 
 12 | // GetID returns the ID
 13 | func (b Base) GetID() int {
 14 | 	return b.ID
 15 | }
 16 | 
 17 | // GetName returns the name
 18 | func (b Base) GetName() string {
 19 | 	return b.Name
 20 | }
 21 | 
 22 | // Describe provides a description
 23 | func (b Base) Describe() string {
 24 | 	return fmt.Sprintf("Base{ID: %d, Name: %s}", b.ID, b.Name)
 25 | }
 26 | 
 27 | // Extended embeds Base and adds functionality
 28 | type Extended struct {
 29 | 	Base
 30 | 	Extra string
 31 | }
 32 | 
 33 | // Describe overrides the Base method
 34 | func (e Extended) Describe() string {
 35 | 	return fmt.Sprintf("Extended{ID: %d, Name: %s, Extra: %s}", e.ID, e.Name, e.Extra)
 36 | }
 37 | 
 38 | // GetExtra returns the extra field
 39 | func (e Extended) GetExtra() string {
 40 | 	return e.Extra
 41 | }
 42 | 
 43 | // Address represents a physical address
 44 | type Address struct {
 45 | 	Street  string
 46 | 	City    string
 47 | 	ZipCode string
 48 | }
 49 | 
 50 | // FullAddress returns formatted address
 51 | func (a Address) FullAddress() string {
 52 | 	return fmt.Sprintf("%s, %s %s", a.Street, a.City, a.ZipCode)
 53 | }
 54 | 
 55 | // ContactInfo has contact details
 56 | type ContactInfo struct {
 57 | 	Email string
 58 | 	Phone string
 59 | }
 60 | 
 61 | // GetContact returns contact string
 62 | func (c ContactInfo) GetContact() string {
 63 | 	return fmt.Sprintf("Email: %s, Phone: %s", c.Email, c.Phone)
 64 | }
 65 | 
 66 | // Customer embeds multiple structs
 67 | type Customer struct {
 68 | 	Base
 69 | 	Address
 70 | 	ContactInfo
 71 | 	LoyaltyPoints int
 72 | }
 73 | 
 74 | // NewCustomer creates a new customer
 75 | func NewCustomer(id int, name, email string) *Customer {
 76 | 	return &Customer{
 77 | 		Base: Base{
 78 | 			ID:   id,
 79 | 			Name: name,
 80 | 		},
 81 | 		ContactInfo: ContactInfo{
 82 | 			Email: email,
 83 | 		},
 84 | 	}
 85 | }
 86 | 
 87 | // GetFullInfo returns all customer info
 88 | func (c Customer) GetFullInfo() string {
 89 | 	return fmt.Sprintf("%s | %s | Points: %d", 
 90 | 		c.Describe(), c.GetContact(), c.LoyaltyPoints)
 91 | }
 92 | 
 93 | // Logger provides logging functionality
 94 | type Logger interface {
 95 | 	Log(message string)
 96 | }
 97 | 
 98 | // ConsoleLogger logs to console
 99 | type ConsoleLogger struct {
100 | 	Prefix string
101 | }
102 | 
103 | // Log implements Logger interface
104 | func (cl ConsoleLogger) Log(message string) {
105 | 	fmt.Printf("[%s] %s\n", cl.Prefix, message)
106 | }
107 | 
108 | // Service embeds a logger
109 | type Service struct {
110 | 	Logger
111 | 	Name string
112 | }
113 | 
114 | // Execute performs service action
115 | func (s Service) Execute() {
116 | 	s.Log(fmt.Sprintf("Executing service: %s", s.Name))
117 | }
118 | 
119 | // Timestamper adds timestamp functionality
120 | type Timestamper struct {
121 | 	timestamp string
122 | }
123 | 
124 | // SetTimestamp sets the timestamp
125 | func (t *Timestamper) SetTimestamp(ts string) {
126 | 	t.timestamp = ts
127 | }
128 | 
129 | // GetTimestamp gets the timestamp
130 | func (t Timestamper) GetTimestamp() string {
131 | 	return t.timestamp
132 | }
133 | 
134 | // Versioned adds version tracking
135 | type Versioned struct {
136 | 	Version int
137 | }
138 | 
139 | // IncrementVersion increases version
140 | func (v *Versioned) IncrementVersion() {
141 | 	v.Version++
142 | }
143 | 
144 | // GetVersion returns the version
145 | func (v Versioned) GetVersion() int {
146 | 	return v.Version
147 | }
148 | 
149 | // Document combines multiple embedded types
150 | type Document struct {
151 | 	Timestamper
152 | 	Versioned
153 | 	Content string
154 | 	Author  string
155 | }
156 | 
157 | // Update updates the document
158 | func (d *Document) Update(content string) {
159 | 	d.Content = content
160 | 	d.IncrementVersion()
161 | }
162 | 
163 | // GetInfo returns document info
164 | func (d Document) GetInfo() string {
165 | 	return fmt.Sprintf("Version %d by %s at %s", 
166 | 		d.GetVersion(), d.Author, d.GetTimestamp())
167 | }
168 | 
169 | // Reader interface
170 | type Reader interface {
171 | 	Read() string
172 | }
173 | 
174 | // Writer interface
175 | type Writer interface {
176 | 	Write(data string) error
177 | }
178 | 
179 | // ReadWriter combines interfaces
180 | type ReadWriter interface {
181 | 	Reader
182 | 	Writer
183 | }
184 | 
185 | // FileHandler implements ReadWriter
186 | type FileHandler struct {
187 | 	Filename string
188 | 	buffer   string
189 | }
190 | 
191 | // Read implements Reader
192 | func (fh FileHandler) Read() string {
193 | 	return fh.buffer
194 | }
195 | 
196 | // Write implements Writer
197 | func (fh *FileHandler) Write(data string) error {
198 | 	fh.buffer = data
199 | 	return nil
200 | }
201 | 
202 | // BufferedHandler embeds FileHandler
203 | type BufferedHandler struct {
204 | 	FileHandler
205 | 	BufferSize int
206 | }
207 | 
208 | // Flush clears the buffer
209 | func (bh *BufferedHandler) Flush() {
210 | 	bh.buffer = ""
211 | }
212 | 
213 | // Engine represents an engine
214 | type Engine struct {
215 | 	Horsepower int
216 | 	Type       string
217 | }
218 | 
219 | // Start starts the engine
220 | func (e Engine) Start() string {
221 | 	return fmt.Sprintf("Starting %s engine with %d HP", e.Type, e.Horsepower)
222 | }
223 | 
224 | // Wheels represents wheels
225 | type Wheels struct {
226 | 	Count int
227 | 	Size  int
228 | }
229 | 
230 | // Roll makes wheels roll
231 | func (w Wheels) Roll() string {
232 | 	return fmt.Sprintf("Rolling on %d wheels of size %d", w.Count, w.Size)
233 | }
234 | 
235 | // Car composes Engine and Wheels
236 | type Car struct {
237 | 	Engine
238 | 	Wheels
239 | 	Make  string
240 | 	Model string
241 | }
242 | 
243 | // Drive drives the car
244 | func (c Car) Drive() string {
245 | 	return fmt.Sprintf("%s %s: %s, %s", 
246 | 		c.Make, c.Model, c.Start(), c.Roll())
247 | }
248 | 
249 | // Metadata provides common metadata
250 | type Metadata struct {
251 | 	CreatedBy string
252 | 	Tags      []string
253 | }
254 | 
255 | // AddTag adds a tag
256 | func (m *Metadata) AddTag(tag string) {
257 | 	m.Tags = append(m.Tags, tag)
258 | }
259 | 
260 | // GetTags returns all tags
261 | func (m Metadata) GetTags() []string {
262 | 	return m.Tags
263 | }
264 | 
265 | // Article combines content and metadata
266 | type Article struct {
267 | 	Metadata
268 | 	Title string
269 | 	Body  string
270 | }
271 | 
272 | // Summary returns article summary
273 | func (a Article) Summary() string {
274 | 	return fmt.Sprintf("'%s' by %s [%d tags]", 
275 | 		a.Title, a.CreatedBy, len(a.Tags))
276 | }
277 | 
278 | // ConflictExample shows field name conflicts
279 | type ConflictExample struct {
280 | 	Base
281 | 	Extended
282 | }
283 | 
284 | // AccessConflict demonstrates accessing conflicting fields
285 | func (c ConflictExample) AccessConflict() string {
286 | 	// Need to specify which embedded type's field to access
287 | 	return fmt.Sprintf("Base Name: %s, Extended Name: %s", 
288 | 		c.Base.Name, c.Extended.Name)
289 | }
290 | 
291 | func demonstrateComposition() {
292 | 	// Basic embedding
293 | 	extended := Extended{
294 | 		Base:  Base{ID: 1, Name: "Test"},
295 | 		Extra: "Additional",
296 | 	}
297 | 	fmt.Println(extended.Describe())
298 | 	fmt.Println(extended.GetID()) // Promoted method from Base
299 | 	
300 | 	// Multiple embedding
301 | 	customer := NewCustomer(100, "John Doe", "[email protected]")
302 | 	customer.Street = "123 Main St"
303 | 	customer.City = "NYC"
304 | 	customer.Phone = "555-1234"
305 | 	fmt.Println(customer.GetFullInfo())
306 | 	
307 | 	// Interface embedding
308 | 	service := Service{
309 | 		Logger: ConsoleLogger{Prefix: "SVC"},
310 | 		Name:   "DataProcessor",
311 | 	}
312 | 	service.Execute()
313 | 	
314 | 	// Composition
315 | 	car := Car{
316 | 		Engine: Engine{Horsepower: 300, Type: "V8"},
317 | 		Wheels: Wheels{Count: 4, Size: 18},
318 | 		Make:   "Tesla",
319 | 		Model:  "Model S",
320 | 	}
321 | 	fmt.Println(car.Drive())
322 | }
323 | 
324 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_go/error_handling.go:
--------------------------------------------------------------------------------

```go
  1 | // error_handling.go - Demonstrates Go error handling patterns
  2 | package main
  3 | 
  4 | import (
  5 | 	"errors"
  6 | 	"fmt"
  7 | 	"io"
  8 | 	"os"
  9 | 	"strconv"
 10 | )
 11 | 
 12 | // CustomError is a custom error type
 13 | type CustomError struct {
 14 | 	Code    int
 15 | 	Message string
 16 | }
 17 | 
 18 | // Error implements error interface for CustomError
 19 | func (e *CustomError) Error() string {
 20 | 	return fmt.Sprintf("Error %d: %s", e.Code, e.Message)
 21 | }
 22 | 
 23 | // ValidationError represents validation failures
 24 | type ValidationError struct {
 25 | 	Field string
 26 | 	Value interface{}
 27 | 	Issue string
 28 | }
 29 | 
 30 | // Error implements error interface for ValidationError
 31 | func (e *ValidationError) Error() string {
 32 | 	return fmt.Sprintf("validation failed for field '%s' with value '%v': %s", 
 33 | 		e.Field, e.Value, e.Issue)
 34 | }
 35 | 
 36 | // NewCustomError creates a new custom error
 37 | func NewCustomError(code int, message string) error {
 38 | 	return &CustomError{Code: code, Message: message}
 39 | }
 40 | 
 41 | // BasicErrorReturn demonstrates simple error return
 42 | func BasicErrorReturn(x int) (int, error) {
 43 | 	if x < 0 {
 44 | 		return 0, errors.New("negative number not allowed")
 45 | 	}
 46 | 	return x * 2, nil
 47 | }
 48 | 
 49 | // ErrorWithFormatting uses fmt.Errorf
 50 | func ErrorWithFormatting(name string, age int) error {
 51 | 	if age < 0 {
 52 | 		return fmt.Errorf("invalid age %d for person %s", age, name)
 53 | 	}
 54 | 	if name == "" {
 55 | 		return fmt.Errorf("name cannot be empty")
 56 | 	}
 57 | 	return nil
 58 | }
 59 | 
 60 | // MultipleErrorChecks demonstrates multiple error checks
 61 | func MultipleErrorChecks(a, b int) (int, error) {
 62 | 	if a < 0 {
 63 | 		return 0, errors.New("first parameter cannot be negative")
 64 | 	}
 65 | 	if b == 0 {
 66 | 		return 0, errors.New("second parameter cannot be zero")
 67 | 	}
 68 | 	if a > 1000 {
 69 | 		return 0, errors.New("first parameter too large")
 70 | 	}
 71 | 	return a / b, nil
 72 | }
 73 | 
 74 | // ErrorWrapping demonstrates error wrapping (Go 1.13+)
 75 | func ErrorWrapping(filename string) error {
 76 | 	if filename == "" {
 77 | 		return fmt.Errorf("filename is empty")
 78 | 	}
 79 | 	
 80 | 	_, err := os.Open(filename)
 81 | 	if err != nil {
 82 | 		return fmt.Errorf("failed to open file %s: %w", filename, err)
 83 | 	}
 84 | 	
 85 | 	return nil
 86 | }
 87 | 
 88 | // ValidateUser validates user data
 89 | func ValidateUser(username string, age int) error {
 90 | 	if len(username) < 3 {
 91 | 		return &ValidationError{
 92 | 			Field: "username",
 93 | 			Value: username,
 94 | 			Issue: "must be at least 3 characters",
 95 | 		}
 96 | 	}
 97 | 	
 98 | 	if age < 18 {
 99 | 		return &ValidationError{
100 | 			Field: "age",
101 | 			Value: age,
102 | 			Issue: "must be 18 or older",
103 | 		}
104 | 	}
105 | 	
106 | 	return nil
107 | }
108 | 
109 | // ParseAndValidate demonstrates error handling chain
110 | func ParseAndValidate(input string) (int, error) {
111 | 	value, err := strconv.Atoi(input)
112 | 	if err != nil {
113 | 		return 0, fmt.Errorf("failed to parse input: %w", err)
114 | 	}
115 | 	
116 | 	if value < 0 {
117 | 		return 0, NewCustomError(400, "value must be non-negative")
118 | 	}
119 | 	
120 | 	if value > 100 {
121 | 		return 0, NewCustomError(400, "value must not exceed 100")
122 | 	}
123 | 	
124 | 	return value, nil
125 | }
126 | 
127 | // ErrorTypeAssertion demonstrates error type checking
128 | func ErrorTypeAssertion(err error) string {
129 | 	if err == nil {
130 | 		return "no error"
131 | 	}
132 | 	
133 | 	// Type assertion for custom error
134 | 	if customErr, ok := err.(*CustomError); ok {
135 | 		return fmt.Sprintf("Custom error with code: %d", customErr.Code)
136 | 	}
137 | 	
138 | 	// Type assertion for validation error
139 | 	if valErr, ok := err.(*ValidationError); ok {
140 | 		return fmt.Sprintf("Validation error on field: %s", valErr.Field)
141 | 	}
142 | 	
143 | 	return "unknown error type"
144 | }
145 | 
146 | // ErrorsIs demonstrates errors.Is (Go 1.13+)
147 | func ErrorsIs(err error) bool {
148 | 	return errors.Is(err, io.EOF)
149 | }
150 | 
151 | // ErrorsAs demonstrates errors.As (Go 1.13+)
152 | func ErrorsAs(err error) (*CustomError, bool) {
153 | 	var customErr *CustomError
154 | 	if errors.As(err, &customErr) {
155 | 		return customErr, true
156 | 	}
157 | 	return nil, false
158 | }
159 | 
160 | // DeferredErrorHandling demonstrates defer with error handling
161 | func DeferredErrorHandling(filename string) (err error) {
162 | 	file, err := os.Open(filename)
163 | 	if err != nil {
164 | 		return fmt.Errorf("cannot open file: %w", err)
165 | 	}
166 | 	
167 | 	defer func() {
168 | 		if closeErr := file.Close(); closeErr != nil {
169 | 			if err != nil {
170 | 				err = fmt.Errorf("close error: %v (original error: %w)", closeErr, err)
171 | 			} else {
172 | 				err = closeErr
173 | 			}
174 | 		}
175 | 	}()
176 | 	
177 | 	// Do something with file
178 | 	_, err = file.Read(make([]byte, 100))
179 | 	if err != nil && err != io.EOF {
180 | 		return fmt.Errorf("read error: %w", err)
181 | 	}
182 | 	
183 | 	return nil
184 | }
185 | 
186 | // SentinelErrors demonstrates sentinel error pattern
187 | var (
188 | 	ErrNotFound     = errors.New("not found")
189 | 	ErrUnauthorized = errors.New("unauthorized")
190 | 	ErrForbidden    = errors.New("forbidden")
191 | )
192 | 
193 | // FindUser demonstrates sentinel error usage
194 | func FindUser(id int) (string, error) {
195 | 	if id < 0 {
196 | 		return "", ErrNotFound
197 | 	}
198 | 	if id > 1000 {
199 | 		return "", ErrUnauthorized
200 | 	}
201 | 	return fmt.Sprintf("user_%d", id), nil
202 | }
203 | 
204 | // HandleUserError demonstrates handling sentinel errors
205 | func HandleUserError(id int) string {
206 | 	user, err := FindUser(id)
207 | 	if err != nil {
208 | 		if errors.Is(err, ErrNotFound) {
209 | 			return "User not found"
210 | 		}
211 | 		if errors.Is(err, ErrUnauthorized) {
212 | 			return "Unauthorized access"
213 | 		}
214 | 		return "Unknown error"
215 | 	}
216 | 	return user
217 | }
218 | 
219 | // PanicToError converts panic to error
220 | func PanicToError() (err error) {
221 | 	defer func() {
222 | 		if r := recover(); r != nil {
223 | 			err = fmt.Errorf("recovered from panic: %v", r)
224 | 		}
225 | 	}()
226 | 	
227 | 	panic("something went wrong")
228 | }
229 | 
230 | // ChainedValidation demonstrates chained error checks
231 | func ChainedValidation(data map[string]interface{}) error {
232 | 	if err := validateName(data); err != nil {
233 | 		return fmt.Errorf("name validation: %w", err)
234 | 	}
235 | 	
236 | 	if err := validateAge(data); err != nil {
237 | 		return fmt.Errorf("age validation: %w", err)
238 | 	}
239 | 	
240 | 	if err := validateEmail(data); err != nil {
241 | 		return fmt.Errorf("email validation: %w", err)
242 | 	}
243 | 	
244 | 	return nil
245 | }
246 | 
247 | func validateName(data map[string]interface{}) error {
248 | 	name, ok := data["name"].(string)
249 | 	if !ok || name == "" {
250 | 		return errors.New("name is required")
251 | 	}
252 | 	return nil
253 | }
254 | 
255 | func validateAge(data map[string]interface{}) error {
256 | 	age, ok := data["age"].(int)
257 | 	if !ok || age < 0 {
258 | 		return errors.New("valid age is required")
259 | 	}
260 | 	return nil
261 | }
262 | 
263 | func validateEmail(data map[string]interface{}) error {
264 | 	email, ok := data["email"].(string)
265 | 	if !ok || email == "" {
266 | 		return errors.New("email is required")
267 | 	}
268 | 	return nil
269 | }
270 | 
271 | func demonstrateErrors() {
272 | 	// Test basic error
273 | 	_, err := BasicErrorReturn(-1)
274 | 	if err != nil {
275 | 		fmt.Println("Error:", err)
276 | 	}
277 | 	
278 | 	// Test custom error
279 | 	err = NewCustomError(404, "Resource not found")
280 | 	fmt.Println(ErrorTypeAssertion(err))
281 | 	
282 | 	// Test validation error
283 | 	err = ValidateUser("ab", 15)
284 | 	fmt.Println(err)
285 | }
286 | 
287 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_rust/src/traits.rs:
--------------------------------------------------------------------------------

```rust
  1 | // traits.rs - Demonstrates Rust traits and trait implementations
  2 | use std::fmt;
  3 | use std::ops::Add;
  4 | 
  5 | /// Basic trait definition
  6 | pub trait Describable {
  7 |     fn describe(&self) -> String;
  8 | }
  9 | 
 10 | /// Trait with default implementation
 11 | pub trait Greetable {
 12 |     fn greet(&self) -> String {
 13 |         "Hello!".to_string()
 14 |     }
 15 | 
 16 |     fn formal_greet(&self) -> String;
 17 | }
 18 | 
 19 | /// Trait with associated types
 20 | pub trait Container {
 21 |     type Item;
 22 | 
 23 |     fn add(&mut self, item: Self::Item);
 24 |     fn get(&self, index: usize) -> Option<&Self::Item>;
 25 |     fn len(&self) -> usize;
 26 |     
 27 |     fn is_empty(&self) -> bool {
 28 |         self.len() == 0
 29 |     }
 30 | }
 31 | 
 32 | /// Trait with associated constants
 33 | pub trait MathConstants {
 34 |     const PI: f64;
 35 |     const E: f64;
 36 | }
 37 | 
 38 | /// Trait for conversion
 39 | pub trait FromString {
 40 |     fn from_string(s: &str) -> Result<Self, String>
 41 |     where
 42 |         Self: Sized;
 43 | }
 44 | 
 45 | /// Marker trait (empty trait)
 46 | pub trait Serializable {}
 47 | 
 48 | // Struct definitions
 49 | 
 50 | #[derive(Debug, Clone)]
 51 | pub struct Rectangle {
 52 |     pub width: f64,
 53 |     pub height: f64,
 54 | }
 55 | 
 56 | #[derive(Debug, Clone)]
 57 | pub struct Circle {
 58 |     pub radius: f64,
 59 | }
 60 | 
 61 | #[derive(Debug, Clone)]
 62 | pub struct Triangle {
 63 |     pub a: f64,
 64 |     pub b: f64,
 65 |     pub c: f64,
 66 | }
 67 | 
 68 | #[derive(Debug)]
 69 | pub struct Student {
 70 |     pub name: String,
 71 |     pub grade: u32,
 72 | }
 73 | 
 74 | #[derive(Debug)]
 75 | pub struct Teacher {
 76 |     pub name: String,
 77 |     pub subject: String,
 78 | }
 79 | 
 80 | // Trait implementations
 81 | 
 82 | impl Describable for Rectangle {
 83 |     fn describe(&self) -> String {
 84 |         format!("Rectangle with width {} and height {}", self.width, self.height)
 85 |     }
 86 | }
 87 | 
 88 | impl Describable for Circle {
 89 |     fn describe(&self) -> String {
 90 |         format!("Circle with radius {}", self.radius)
 91 |     }
 92 | }
 93 | 
 94 | impl Describable for Triangle {
 95 |     fn describe(&self) -> String {
 96 |         format!("Triangle with sides {}, {}, {}", self.a, self.b, self.c)
 97 |     }
 98 | }
 99 | 
100 | impl Greetable for Student {
101 |     fn formal_greet(&self) -> String {
102 |         format!("Good day, student {}", self.name)
103 |     }
104 | }
105 | 
106 | impl Greetable for Teacher {
107 |     fn greet(&self) -> String {
108 |         format!("Hello, I'm {}", self.name)
109 |     }
110 | 
111 |     fn formal_greet(&self) -> String {
112 |         format!("Good day, Professor {}", self.name)
113 |     }
114 | }
115 | 
116 | // Trait for area calculation
117 | pub trait Area {
118 |     fn area(&self) -> f64;
119 | }
120 | 
121 | impl Area for Rectangle {
122 |     fn area(&self) -> f64 {
123 |         self.width * self.height
124 |     }
125 | }
126 | 
127 | impl Area for Circle {
128 |     fn area(&self) -> f64 {
129 |         std::f64::consts::PI * self.radius * self.radius
130 |     }
131 | }
132 | 
133 | impl Area for Triangle {
134 |     fn area(&self) -> f64 {
135 |         // Heron's formula
136 |         let s = (self.a + self.b + self.c) / 2.0;
137 |         (s * (s - self.a) * (s - self.b) * (s - self.c)).sqrt()
138 |     }
139 | }
140 | 
141 | // Trait for perimeter calculation
142 | pub trait Perimeter {
143 |     fn perimeter(&self) -> f64;
144 | }
145 | 
146 | impl Perimeter for Rectangle {
147 |     fn perimeter(&self) -> f64 {
148 |         2.0 * (self.width + self.height)
149 |     }
150 | }
151 | 
152 | impl Perimeter for Circle {
153 |     fn perimeter(&self) -> f64 {
154 |         2.0 * std::f64::consts::PI * self.radius
155 |     }
156 | }
157 | 
158 | impl Perimeter for Triangle {
159 |     fn perimeter(&self) -> f64 {
160 |         self.a + self.b + self.c
161 |     }
162 | }
163 | 
164 | // Generic functions using traits
165 | 
166 | /// Function accepting any type implementing Describable
167 | pub fn print_description<T: Describable>(item: &T) {
168 |     println!("{}", item.describe());
169 | }
170 | 
171 | /// Function with multiple trait bounds
172 | pub fn print_area_and_perimeter<T: Area + Perimeter>(shape: &T) {
173 |     println!("Area: {}, Perimeter: {}", shape.area(), shape.perimeter());
174 | }
175 | 
176 | /// Function with where clause
177 | pub fn compare_areas<T, U>(shape1: &T, shape2: &U) -> bool
178 | where
179 |     T: Area,
180 |     U: Area,
181 | {
182 |     shape1.area() > shape2.area()
183 | }
184 | 
185 | /// Function returning impl Trait
186 | pub fn create_circle(radius: f64) -> impl Area + Perimeter {
187 |     Circle { radius }
188 | }
189 | 
190 | /// Generic struct with trait bounds
191 | #[derive(Debug)]
192 | pub struct Pair<T> {
193 |     first: T,
194 |     second: T,
195 | }
196 | 
197 | impl<T> Pair<T> {
198 |     pub fn new(first: T, second: T) -> Self {
199 |         Self { first, second }
200 |     }
201 | }
202 | 
203 | impl<T: PartialOrd> Pair<T> {
204 |     pub fn max(&self) -> &T {
205 |         if self.first > self.second {
206 |             &self.first
207 |         } else {
208 |             &self.second
209 |         }
210 |     }
211 | }
212 | 
213 | impl<T: Clone> Pair<T> {
214 |     pub fn clone_first(&self) -> T {
215 |         self.first.clone()
216 |     }
217 | }
218 | 
219 | // Trait with supertraits
220 | pub trait Shape: Area + Perimeter + fmt::Display {
221 |     fn name(&self) -> &str;
222 | }
223 | 
224 | impl fmt::Display for Rectangle {
225 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
226 |         write!(f, "Rectangle({}x{})", self.width, self.height)
227 |     }
228 | }
229 | 
230 | impl Shape for Rectangle {
231 |     fn name(&self) -> &str {
232 |         "Rectangle"
233 |     }
234 | }
235 | 
236 | // Trait object example
237 | pub fn total_area(shapes: &[&dyn Area]) -> f64 {
238 |     shapes.iter().map(|s| s.area()).sum()
239 | }
240 | 
241 | // Associated type example
242 | pub struct VecContainer<T> {
243 |     items: Vec<T>,
244 | }
245 | 
246 | impl<T> Container for VecContainer<T> {
247 |     type Item = T;
248 | 
249 |     fn add(&mut self, item: Self::Item) {
250 |         self.items.push(item);
251 |     }
252 | 
253 |     fn get(&self, index: usize) -> Option<&Self::Item> {
254 |         self.items.get(index)
255 |     }
256 | 
257 |     fn len(&self) -> usize {
258 |         self.items.len()
259 |     }
260 | }
261 | 
262 | // Operator overloading using traits
263 | #[derive(Debug, Clone, Copy, PartialEq)]
264 | pub struct Point {
265 |     pub x: i32,
266 |     pub y: i32,
267 | }
268 | 
269 | impl Add for Point {
270 |     type Output = Point;
271 | 
272 |     fn add(self, other: Point) -> Point {
273 |         Point {
274 |             x: self.x + other.x,
275 |             y: self.y + other.y,
276 |         }
277 |     }
278 | }
279 | 
280 | // Trait for custom equality
281 | pub trait CustomEq {
282 |     fn custom_eq(&self, other: &Self) -> bool;
283 | }
284 | 
285 | impl CustomEq for Rectangle {
286 |     fn custom_eq(&self, other: &Self) -> bool {
287 |         (self.width * self.height - other.width * other.height).abs() < 0.001
288 |     }
289 | }
290 | 
291 | // Blanket implementations
292 | pub trait Summary {
293 |     fn summarize(&self) -> String;
294 | }
295 | 
296 | impl<T: Describable> Summary for T {
297 |     fn summarize(&self) -> String {
298 |         format!("Summary: {}", self.describe())
299 |     }
300 | }
301 | 
302 | #[cfg(test)]
303 | mod tests {
304 |     use super::*;
305 | 
306 |     #[test]
307 |     fn test_rectangle_area() {
308 |         let rect = Rectangle { width: 10.0, height: 5.0 };
309 |         assert_eq!(rect.area(), 50.0);
310 |     }
311 | 
312 |     #[test]
313 |     fn test_circle_area() {
314 |         let circle = Circle { radius: 5.0 };
315 |         let area = circle.area();
316 |         assert!((area - 78.54).abs() < 0.01);
317 |     }
318 | 
319 |     #[test]
320 |     fn test_point_add() {
321 |         let p1 = Point { x: 1, y: 2 };
322 |         let p2 = Point { x: 3, y: 4 };
323 |         let p3 = p1 + p2;
324 |         assert_eq!(p3, Point { x: 4, y: 6 });
325 |     }
326 | }
327 | 
328 | 
```

--------------------------------------------------------------------------------
/tests/test_graph_indexing_js.py:
--------------------------------------------------------------------------------

```python
  1 | 
  2 | import pytest
  3 | import os
  4 | 
  5 | # Path to the sample JavaScript project used in tests
  6 | SAMPLE_JS_PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "sample_project_javascript"))
  7 | 
  8 | # ==============================================================================
  9 | # == EXPECTED RELATIONSHIPS
 10 | # ==============================================================================
 11 | 
 12 | EXPECTED_STRUCTURE = [
 13 |     ("functions.js", "regularFunction", "Function"),
 14 |     ("functions.js", "greetPerson", "Function"),
 15 |     ("functions.js", "functionExpression", "Function"),
 16 |     ("functions.js", "arrowFunction", "Function"),
 17 |     ("classes.js", "Person", "Class"),
 18 |     ("classes.js", "Employee", "Class"),
 19 |     ("classes.js", "BankAccount", "Class"),
 20 |     ("objects.js", "calculator", "Variable"),
 21 | ]
 22 | 
 23 | EXPECTED_INHERITANCE = [
 24 |     pytest.param("Employee", "classes.js", "Person", "classes.js", id="Employee inherits from Person"),
 25 | ]
 26 | 
 27 | EXPECTED_CALLS = [
 28 |     pytest.param("getData", "asyncAwait.js", None, "fetchData", "asyncAwait.js", None, id="asyncAwait.getData->fetchData", marks=pytest.mark.skip(reason="JS parser does not yet detect all call relationships.")),
 29 |     pytest.param("orchestrator", "functions.js", None, "regularFunction", "functions.js", None, id="functions.orchestrator->regularFunction", marks=pytest.mark.skip(reason="JS parser does not yet detect all call relationships.")),
 30 | ]
 31 | 
 32 | EXPECTED_IMPORTS = [
 33 |     pytest.param("importer.js", "defaultExport", "exporter.js", "defaultExportedFunction", id="importer.js imports defaultExport", marks=pytest.mark.xfail(reason="Symbol-level import relationships are not yet implemented for JavaScript.")),
 34 |     pytest.param("importer.js", "exportedFunction", "exporter.js", "exportedFunction", id="importer.js imports exportedFunction", marks=pytest.mark.xfail(reason="Symbol-level import relationships are not yet implemented for JavaScript.")),
 35 |     pytest.param("importer.js", "ExportedClass", "exporter.js", "ExportedClass", id="importer.js imports ExportedClass", marks=pytest.mark.xfail(reason="Symbol-level import relationships are not yet implemented for JavaScript.")),
 36 | ]
 37 | 
 38 | 
 39 | # ==============================================================================
 40 | # == TEST IMPLEMENTATIONS
 41 | # ==============================================================================
 42 | 
 43 | def check_query(graph, query, description):
 44 |     """Helper function to execute a Cypher query and assert that a match is found."""
 45 |     try:
 46 |         result = graph.query(query)
 47 |     except Exception as e:
 48 |         pytest.fail(f"Query failed for {description} with error: {e}\nQuery was:\n{query}")
 49 | 
 50 |     assert result is not None, f"Query for {description} returned None.\nQuery was:\n{query}"
 51 |     assert len(result) > 0, f"Query for {description} returned no records.\nQuery was:\n{query}"
 52 |     assert result[0].get('count', 0) > 0, f"No match found for {description}.\nQuery was:\n{query}"
 53 | 
 54 | @pytest.mark.parametrize("file_name, item_name, item_label", EXPECTED_STRUCTURE)
 55 | def test_file_contains_item(graph, file_name, item_name, item_label):
 56 |     """Verifies that a File node correctly CONTAINS a Function or Class node."""
 57 |     description = f"CONTAINS from [{file_name}] to [{item_name}]"
 58 |     abs_file_path = os.path.join(SAMPLE_JS_PROJECT_PATH, file_name)
 59 |     query = f"""
 60 |     MATCH (f:File {{path: '{abs_file_path}'}})-[:CONTAINS]->(item:{item_label} {{name: '{item_name}'}})
 61 |     RETURN count(*) AS count
 62 |     """
 63 |     check_query(graph, query, description)
 64 | 
 65 | @pytest.mark.parametrize("child_name, child_file, parent_name, parent_file", EXPECTED_INHERITANCE)
 66 | def test_inheritance_relationship(graph, child_name, child_file, parent_name, parent_file):
 67 |     """Verifies that an INHERITS relationship exists between two classes."""
 68 |     description = f"INHERITS from [{child_name}] to [{parent_name}]"
 69 |     child_path = os.path.join(SAMPLE_JS_PROJECT_PATH, child_file)
 70 |     parent_path = os.path.join(SAMPLE_JS_PROJECT_PATH, parent_file)
 71 |     query = f"""
 72 |     MATCH (child:Class {{name: '{child_name}', file_path: '{child_path}'}})-[:INHERITS]->(parent:Class {{name: '{parent_name}', file_path: '{parent_path}'}})
 73 |     RETURN count(*) as count
 74 |     """
 75 |     check_query(graph, query, description)
 76 | 
 77 | @pytest.mark.parametrize("caller_name, caller_file, caller_class, callee_name, callee_file, callee_class", EXPECTED_CALLS)
 78 | def test_function_call_relationship(graph, caller_name, caller_file, caller_class, callee_name, callee_file, callee_class):
 79 |     """Verifies that a CALLS relationship exists by checking for nodes first, then the relationship."""
 80 |     caller_path = os.path.join(SAMPLE_JS_PROJECT_PATH, caller_file)
 81 |     callee_path = os.path.join(SAMPLE_JS_PROJECT_PATH, callee_file)
 82 | 
 83 |     if caller_class:
 84 |         caller_match = f"(caller_class:Class {{name: '{caller_class}', file_path: '{caller_path}'}})-[:CONTAINS]->(caller:Function {{name: '{caller_name}'}})"
 85 |     else:
 86 |         caller_match = f"(caller:Function {{name: '{caller_name}', file_path: '{caller_path}'}})"
 87 | 
 88 |     if callee_class:
 89 |         callee_match = f"(callee_class:Class {{name: '{callee_class}', file_path: '{callee_path}'}})-[:CONTAINS]->(callee:Function {{name: '{callee_name}'}})"
 90 |     else:
 91 |         callee_match = f"(callee:Function {{name: '{callee_name}', file_path: '{callee_path}'}})"
 92 | 
 93 |     relationship_description = f"CALLS from [{caller_name}] to [{callee_name}]"
 94 |     relationship_query = f"""
 95 |     MATCH {caller_match}
 96 |     MATCH {callee_match}
 97 |     MATCH (caller)-[:CALLS]->(callee)
 98 |     RETURN count(*) as count
 99 |     """
100 |     check_query(graph, relationship_query, relationship_description)
101 | 
102 | @pytest.mark.parametrize("importing_file, imported_symbol_alias, exporting_file, original_symbol_name", EXPECTED_IMPORTS)
103 | def test_import_relationship(graph, importing_file, imported_symbol_alias, exporting_file, original_symbol_name):
104 |     """Verifies that a specific IMPORTS relationship exists between a file and a symbol from another file."""
105 |     description = f"IMPORTS from [{importing_file}] of symbol [{original_symbol_name}] as [{imported_symbol_alias}] from [{exporting_file}]"
106 |     importing_path = os.path.join(SAMPLE_JS_PROJECT_PATH, importing_file)
107 |     exporting_path = os.path.join(SAMPLE_JS_PROJECT_PATH, exporting_file)
108 | 
109 |     # This query is designed to fail until the feature is implemented.
110 |     # It checks for a direct relationship between the importing file and the specific imported function/class.
111 |     query = f"""
112 |     MATCH (importer:File {{path: '{importing_path}'}})-[:IMPORTS]->(symbol:Node {{name: '{original_symbol_name}', file_path: '{exporting_path}'}})
113 |     RETURN count(*) as count
114 |     """
115 |     check_query(graph, query, description)
116 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/objects.js:
--------------------------------------------------------------------------------

```javascript
  1 | /**
  2 |  * Sample JavaScript file demonstrating object methods and function assignments
  3 |  * This file tests methods defined in object literals and prototype assignments
  4 |  */
  5 | 
  6 | // Object with method definitions
  7 | const calculator = {
  8 |     result: 0,
  9 | 
 10 |     // Method shorthand syntax
 11 |     add(value) {
 12 |         this.result += value;
 13 |         return this;
 14 |     },
 15 | 
 16 |     // Method shorthand syntax with parameters
 17 |     subtract(value) {
 18 |         this.result -= value;
 19 |         return this;
 20 |     },
 21 | 
 22 |     // Traditional method definition
 23 |     multiply: function(value) {
 24 |         this.result *= value;
 25 |         return this;
 26 |     },
 27 | 
 28 |     // Arrow function as method (note: 'this' behaves differently)
 29 |     reset: () => {
 30 |         // Note: Arrow functions don't have their own 'this'
 31 |         console.log('Calculator reset');
 32 |     },
 33 | 
 34 |     // Method with complex logic
 35 |     calculate(operation, value) {
 36 |         switch (operation) {
 37 |             case 'add':
 38 |                 return this.add(value);
 39 |             case 'subtract':
 40 |                 return this.subtract(value);
 41 |             case 'multiply':
 42 |                 return this.multiply(value);
 43 |             default:
 44 |                 throw new Error('Unknown operation');
 45 |         }
 46 |     },
 47 | 
 48 |     // Getter method
 49 |     get value() {
 50 |         return this.result;
 51 |     },
 52 | 
 53 |     // Setter method
 54 |     set value(newValue) {
 55 |         this.result = newValue;
 56 |     }
 57 | };
 58 | 
 59 | // Object with nested methods
 60 | const api = {
 61 |     baseUrl: 'https://api.example.com',
 62 |     
 63 |     users: {
 64 |         // Nested method
 65 |         getAll() {
 66 |             return fetch(`${this.baseUrl}/users`);
 67 |         },
 68 | 
 69 |         // Nested method with parameters
 70 |         getById(id) {
 71 |             return fetch(`${this.baseUrl}/users/${id}`);
 72 |         },
 73 | 
 74 |         // Async nested method
 75 |         async create(userData) {
 76 |             const response = await fetch(`${this.baseUrl}/users`, {
 77 |                 method: 'POST',
 78 |                 body: JSON.stringify(userData)
 79 |             });
 80 |             return response.json();
 81 |         }
 82 |     },
 83 | 
 84 |     posts: {
 85 |         getAll() {
 86 |             return fetch(`${this.baseUrl}/posts`);
 87 |         },
 88 | 
 89 |         getByUserId(userId) {
 90 |             return fetch(`${this.baseUrl}/posts?userId=${userId}`);
 91 |         }
 92 |     }
 93 | };
 94 | 
 95 | // Constructor function with prototype methods
 96 | function Vehicle(make, model, year) {
 97 |     this.make = make;
 98 |     this.model = model;
 99 |     this.year = year;
100 | }
101 | 
102 | // Prototype method assignment
103 | Vehicle.prototype.getInfo = function() {
104 |     return `${this.year} ${this.make} ${this.model}`;
105 | };
106 | 
107 | // Another prototype method
108 | Vehicle.prototype.start = function() {
109 |     console.log(`Starting ${this.getInfo()}`);
110 | };
111 | 
112 | // Prototype method with parameters
113 | Vehicle.prototype.drive = function(distance) {
114 |     console.log(`Driving ${this.getInfo()} for ${distance} miles`);
115 | };
116 | 
117 | // Static method assignment to constructor function
118 | Vehicle.createElectric = function(make, model, year, batteryCapacity) {
119 |     const vehicle = new Vehicle(make, model, year);
120 |     vehicle.batteryCapacity = batteryCapacity;
121 |     vehicle.charge = function(percentage) {
122 |         console.log(`Charging to ${percentage}%`);
123 |     };
124 |     return vehicle;
125 | };
126 | 
127 | // Object with methods that call other methods
128 | const gameEngine = {
129 |     score: 0,
130 |     level: 1,
131 | 
132 |     // Method that calls other methods
133 |     startGame() {
134 |         this.initializeLevel();
135 |         this.resetScore();
136 |         this.showWelcomeMessage();
137 |     },
138 | 
139 |     initializeLevel() {
140 |         console.log(`Initializing level ${this.level}`);
141 |     },
142 | 
143 |     resetScore() {
144 |         this.score = 0;
145 |         console.log('Score reset to 0');
146 |     },
147 | 
148 |     showWelcomeMessage() {
149 |         console.log('Welcome to the game!');
150 |     },
151 | 
152 |     // Method with callback parameter
153 |     processInput(input, callback) {
154 |         console.log(`Processing input: ${input}`);
155 |         if (callback && typeof callback === 'function') {
156 |             callback(input);
157 |         }
158 |     },
159 | 
160 |     // Method that returns a function
161 |     createScoreHandler() {
162 |         return (points) => {
163 |             this.score += points;
164 |             console.log(`Score: ${this.score}`);
165 |         };
166 |     }
167 | };
168 | 
169 | // Module pattern with private and public methods
170 | const counterModule = (function() {
171 |     let count = 0;
172 | 
173 |     // Private function
174 |     function validateIncrement(value) {
175 |         return typeof value === 'number' && value > 0;
176 |     }
177 | 
178 |     // Return public interface
179 |     return {
180 |         // Public method
181 |         increment(value = 1) {
182 |             if (validateIncrement(value)) {
183 |                 count += value;
184 |             }
185 |         },
186 | 
187 |         // Public method
188 |         decrement(value = 1) {
189 |             if (validateIncrement(value)) {
190 |                 count -= value;
191 |             }
192 |         },
193 | 
194 |         // Public getter
195 |         getCount() {
196 |             return count;
197 |         },
198 | 
199 |         // Public method that uses private function
200 |         reset() {
201 |             count = 0;
202 |             console.log('Counter reset');
203 |         }
204 |     };
205 | })();
206 | 
207 | // Factory function that creates objects with methods
208 | function createTimer(name) {
209 |     let startTime = null;
210 |     let endTime = null;
211 | 
212 |     return {
213 |         name: name,
214 | 
215 |         start() {
216 |             startTime = Date.now();
217 |             console.log(`Timer ${this.name} started`);
218 |         },
219 | 
220 |         stop() {
221 |             endTime = Date.now();
222 |             console.log(`Timer ${this.name} stopped`);
223 |         },
224 | 
225 |         getElapsed() {
226 |             if (startTime && endTime) {
227 |                 return endTime - startTime;
228 |             }
229 |             return 0;
230 |         },
231 | 
232 |         reset() {
233 |             startTime = null;
234 |             endTime = null;
235 |             console.log(`Timer ${this.name} reset`);
236 |         }
237 |     };
238 | }
239 | 
240 | // Function that demonstrates object method usage
241 | function demonstrateObjects() {
242 |     // Use calculator
243 |     calculator.add(10).multiply(2).subtract(5);
244 |     console.log('Calculator result:', calculator.value);
245 | 
246 |     // Use vehicle
247 |     const car = new Vehicle('Toyota', 'Camry', 2022);
248 |     car.start();
249 |     car.drive(100);
250 | 
251 |     // Use game engine
252 |     gameEngine.startGame();
253 |     const scoreHandler = gameEngine.createScoreHandler();
254 |     scoreHandler(100);
255 | 
256 |     // Use counter module
257 |     counterModule.increment(5);
258 |     counterModule.decrement(2);
259 |     console.log('Counter value:', counterModule.getCount());
260 | 
261 |     // Use timer factory
262 |     const timer = createTimer('TestTimer');
263 |     timer.start();
264 |     setTimeout(() => {
265 |         timer.stop();
266 |         console.log('Elapsed time:', timer.getElapsed());
267 |     }, 1000);
268 | 
269 |     return {
270 |         calculator,
271 |         car,
272 |         gameEngine,
273 |         counterModule,
274 |         timer
275 |     };
276 | }
277 | 
278 | // Export objects and functions
279 | export { calculator, api, Vehicle, gameEngine, counterModule, createTimer };
280 | export default demonstrateObjects;
```

--------------------------------------------------------------------------------
/website/src/components/HeroSection.tsx:
--------------------------------------------------------------------------------

```typescript
  1 | import { Button } from "@/components/ui/button";
  2 | import { Badge } from "@/components/ui/badge";
  3 | import { Github, Download, ExternalLink } from "lucide-react";
  4 | import heroGraph from "@/assets/hero-graph.jpg";
  5 | import { useState, useEffect } from "react";
  6 | import ShowDownloads from "@/components/ShowDownloads";
  7 | import ShowStarGraph from "@/components/ShowStarGraph";
  8 | import { ThemeToggle } from "@/components/ThemeToggle";
  9 | 
 10 | const HeroSection = () => {
 11 |   const [stars, setStars] = useState(null);
 12 |   const [forks, setForks] = useState(null);
 13 |    const [version, setVersion] = useState("");
 14 |   useEffect(() => {
 15 |     async function fetchVersion() {
 16 |       try {
 17 |         const res = await fetch(
 18 |           "https://raw.githubusercontent.com/Shashankss1205/CodeGraphContext/main/README.md"
 19 |         );
 20 |         if (!res.ok) throw new Error("Failed to fetch README");
 21 | 
 22 |         const text = await res.text();
 23 |         const match = text.match(
 24 |           /\*\*Version:\*\*\s*([0-9]+\.[0-9]+\.[0-9]+)/i
 25 |         );
 26 |         setVersion(match ? match[1] : "N/A");
 27 |       } catch (err) {
 28 |         console.error(err);
 29 |         setVersion("N/A");
 30 |       }
 31 |     }
 32 | 
 33 |     fetchVersion();
 34 |   }, []);
 35 |   useEffect(() => {
 36 |     fetch("https://api.github.com/repos/Shashankss1205/CodeGraphContext")
 37 |       .then((response) => response.json())
 38 |       .then((data) => {
 39 |         setStars(data.stargazers_count);
 40 |         setForks(data.forks_count);
 41 |       })
 42 |       .catch((error) => console.error("Error fetching GitHub stats:", error));
 43 |   }, []);
 44 | 
 45 |   return (
 46 |     <section className="relative min-h-screen flex items-center justify-center overflow-hidden">
 47 |       {/* Header with Theme Toggle */}
 48 |       <div className="absolute top-0 left-0 right-0 z-20 p-4" data-aos="fade-down">
 49 |         <div className="container mx-auto flex justify-end">
 50 |           <div className="rounded-full bg-white/60 backdrop-blur-md border border-gray-200 shadow-sm p-2 dark:bg-transparent dark:border-transparent dark:shadow-none">
 51 |             <ThemeToggle />
 52 |           </div>
 53 |         </div>
 54 |       </div>
 55 | 
 56 |       {/* Background Image */}
 57 |       <div 
 58 |         className="absolute inset-0 bg-cover bg-center bg-no-repeat opacity-20 brightness-110 saturate-110 dark:opacity-30 dark:brightness-100 dark:saturate-100"
 59 |         style={{ backgroundImage: `url(${heroGraph})` }}
 60 |       />
 61 |       
 62 |       {/* Gradient Overlay */}
 63 |       <div className="absolute inset-0 bg-gradient-to-b from-white/60 via-white/40 to-white/80 dark:from-background/90 dark:via-background/80 dark:to-background/90" />
 64 |       
 65 |       {/* Content */}
 66 |       <div className="relative z-10 container mx-auto px-4 text-center max-w-5xl">
 67 |         <div className="animate-float-up" data-aos="fade-up">
 68 |           <Badge variant="secondary" className="mb-6 text-sm font-medium">
 69 |             <div className="w-2 h-2 bg-accent rounded-full mr-2 animate-graph-pulse" />
 70 |             Version {version} • MIT License
 71 |           </Badge>
 72 |           
 73 |           <h1 className="text-3xl sm:text-4xl md:text-5xl lg:text-6xl xl:text-7xl font-bold mb-6 bg-gradient-to-r from-purple-700 via-indigo-700 to-purple-900 dark:bg-gradient-primary bg-clip-text py-2 text-transparent leading-tight tracking-tight drop-shadow-[0_2px_8px_rgba(0,0,0,0.15)]">
 74 |             CodeGraphContext
 75 |           </h1>
 76 |           
 77 |           <p className="text-xl md:text-2xl text-muted-foreground mb-4 leading-relaxed">
 78 |             An MCP server that indexes local code into a
 79 |           </p>
 80 |           <p className="text-xl md:text-2xl text-accent font-semibold mb-8">
 81 |             knowledge graph for AI assistants
 82 |           </p>
 83 |           
 84 |           <div className="flex flex-col sm:flex-row gap-4 justify-center items-center mb-12" data-aos="fade-up" data-aos-delay="200">
 85 |             <Button size="lg" className="bg-gradient-to-r from-purple-600 via-indigo-600 to-purple-800 text-primary-foreground hover:opacity-90 transition-all duration-300 shadow-glow ring-1 ring-primary/20 dark:bg-gradient-primary" asChild>
 86 |               <a href="https://pypi.org/project/codegraphcontext/" target="_blank" rel="noopener noreferrer">
 87 |                 <Download className="mr-2 h-5 w-5" />
 88 |                 pip install codegraphcontext
 89 |               </a>
 90 |             </Button>
 91 |             
 92 |             <Button variant="outline" size="lg" asChild className="border-gray-300 hover:border-primary/60 bg-white/80 backdrop-blur-sm shadow-sm transition-smooth text-gray-900 dark:bg-transparent dark:text-foreground dark:border-primary/30">
 93 |               <a href="https://github.com/Shashankss1205/CodeGraphContext" target="_blank" rel="noopener noreferrer">
 94 |                 <Github className="mr-2 h-5 w-5" />
 95 |                 View on GitHub
 96 |                 <ExternalLink className="ml-2 h-4 w-4" />
 97 |               </a>
 98 |             </Button>
 99 |             <Button variant="ghost" size="lg" asChild>
100 |               <a href="https://shashankss1205.github.io/CodeGraphContext/" target="_blank" rel="noopener noreferrer" className="flex items-center gap-2">
101 |                 <ExternalLink className="h-5 w-5" />
102 |                 Documentation
103 |               </a>
104 |             </Button>
105 |           </div>
106 |           
107 |           {/* Stats */}
108 |           <div className="flex flex-wrap justify-center gap-8 text-sm text-muted-foreground" data-aos="fade-up" data-aos-delay="400">
109 |             <div className="flex items-center gap-2">
110 |               <div className="w-3 h-3 bg-graph-node-1 rounded-full animate-graph-pulse" />
111 |               {stars !== null ? <span>{stars} GitHub Stars</span> : <span>Loading...</span>}
112 |             </div>
113 |             <div className="flex items-center gap-2">
114 |               <div className="w-3 h-3 bg-graph-node-2 rounded-full animate-graph-pulse" style={{animationDelay: '0.5s'}} />
115 |               {forks !== null ? <span>{forks} Forks</span> : <span>Loading...</span>}
116 |             </div>
117 |             <div className="flex items-center gap-2">
118 |               <div className="w-3 h-3 bg-graph-node-3 rounded-full animate-graph-pulse" style={{animationDelay: '1s'}} />
119 |               <span><ShowDownloads /></span>
120 |             </div>
121 |           </div>
122 |         </div>
123 |       </div>
124 |       
125 |       {/* Floating Graph Nodes */}
126 |       <div className="absolute top-20 left-10 w-8 h-8 graph-node animate-graph-pulse" style={{animationDelay: '0.2s'}} />
127 |       <div className="absolute top-40 right-20 w-6 h-6 graph-node animate-graph-pulse" style={{animationDelay: '0.8s'}} />
128 |       <div className="absolute bottom-32 left-20 w-10 h-10 graph-node animate-graph-pulse" style={{animationDelay: '1.2s'}} />
129 |       <div className="absolute bottom-20 right-10 w-7 h-7 graph-node animate-graph-pulse" style={{animationDelay: '0.6s'}} />
130 |     </section>
131 |   );
132 | };
133 | 
134 | export default HeroSection;
135 | 
136 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_rust/src/smart_pointers.rs:
--------------------------------------------------------------------------------

```rust
  1 | // smart_pointers.rs - Demonstrates Rust smart pointers
  2 | use std::cell::{Cell, RefCell};
  3 | use std::rc::{Rc, Weak};
  4 | use std::sync::Arc;
  5 | 
  6 | // Box - heap allocation
  7 | 
  8 | /// Basic Box usage
  9 | pub fn box_example() -> Box<i32> {
 10 |     Box::new(42)
 11 | }
 12 | 
 13 | /// Recursive type with Box
 14 | #[derive(Debug)]
 15 | pub enum List {
 16 |     Cons(i32, Box<List>),
 17 |     Nil,
 18 | }
 19 | 
 20 | impl List {
 21 |     pub fn new() -> Self {
 22 |         List::Nil
 23 |     }
 24 | 
 25 |     pub fn prepend(self, value: i32) -> Self {
 26 |         List::Cons(value, Box::new(self))
 27 |     }
 28 | 
 29 |     pub fn len(&self) -> usize {
 30 |         match self {
 31 |             List::Cons(_, tail) => 1 + tail.len(),
 32 |             List::Nil => 0,
 33 |         }
 34 |     }
 35 | }
 36 | 
 37 | /// Box with trait object
 38 | pub trait Shape {
 39 |     fn area(&self) -> f64;
 40 | }
 41 | 
 42 | pub struct Circle {
 43 |     radius: f64,
 44 | }
 45 | 
 46 | pub struct Rectangle {
 47 |     width: f64,
 48 |     height: f64,
 49 | }
 50 | 
 51 | impl Shape for Circle {
 52 |     fn area(&self) -> f64 {
 53 |         std::f64::consts::PI * self.radius * self.radius
 54 |     }
 55 | }
 56 | 
 57 | impl Shape for Rectangle {
 58 |     fn area(&self) -> f64 {
 59 |         self.width * self.height
 60 |     }
 61 | }
 62 | 
 63 | pub fn create_shapes() -> Vec<Box<dyn Shape>> {
 64 |     vec![
 65 |         Box::new(Circle { radius: 5.0 }),
 66 |         Box::new(Rectangle {
 67 |             width: 10.0,
 68 |             height: 5.0,
 69 |         }),
 70 |     ]
 71 | }
 72 | 
 73 | // Rc - reference counting
 74 | 
 75 | /// Shared ownership with Rc
 76 | pub fn rc_example() {
 77 |     let data = Rc::new(vec![1, 2, 3, 4, 5]);
 78 |     let data2 = Rc::clone(&data);
 79 |     let data3 = Rc::clone(&data);
 80 | 
 81 |     println!("Data: {:?}, count: {}", data, Rc::strong_count(&data));
 82 | }
 83 | 
 84 | /// Graph structure with Rc
 85 | #[derive(Debug)]
 86 | pub struct Node {
 87 |     value: i32,
 88 |     children: Vec<Rc<Node>>,
 89 | }
 90 | 
 91 | impl Node {
 92 |     pub fn new(value: i32) -> Rc<Self> {
 93 |         Rc::new(Self {
 94 |             value,
 95 |             children: Vec::new(),
 96 |         })
 97 |     }
 98 | 
 99 |     pub fn value(&self) -> i32 {
100 |         self.value
101 |     }
102 | }
103 | 
104 | /// Tree with Rc and Weak
105 | #[derive(Debug)]
106 | pub struct TreeNode {
107 |     value: i32,
108 |     parent: RefCell<Weak<TreeNode>>,
109 |     children: RefCell<Vec<Rc<TreeNode>>>,
110 | }
111 | 
112 | impl TreeNode {
113 |     pub fn new(value: i32) -> Rc<Self> {
114 |         Rc::new(Self {
115 |             value,
116 |             parent: RefCell::new(Weak::new()),
117 |             children: RefCell::new(Vec::new()),
118 |         })
119 |     }
120 | 
121 |     pub fn add_child(self: &Rc<Self>, child: Rc<TreeNode>) {
122 |         *child.parent.borrow_mut() = Rc::downgrade(self);
123 |         self.children.borrow_mut().push(child);
124 |     }
125 | }
126 | 
127 | // RefCell - interior mutability
128 | 
129 | /// RefCell for interior mutability
130 | pub struct MockMessenger {
131 |     pub sent_messages: RefCell<Vec<String>>,
132 | }
133 | 
134 | impl MockMessenger {
135 |     pub fn new() -> Self {
136 |         Self {
137 |             sent_messages: RefCell::new(Vec::new()),
138 |         }
139 |     }
140 | 
141 |     pub fn send(&self, message: &str) {
142 |         self.sent_messages.borrow_mut().push(message.to_string());
143 |     }
144 | 
145 |     pub fn message_count(&self) -> usize {
146 |         self.sent_messages.borrow().len()
147 |     }
148 | }
149 | 
150 | /// Combining Rc and RefCell
151 | pub struct SharedData {
152 |     data: Rc<RefCell<Vec<i32>>>,
153 | }
154 | 
155 | impl SharedData {
156 |     pub fn new() -> Self {
157 |         Self {
158 |             data: Rc::new(RefCell::new(Vec::new())),
159 |         }
160 |     }
161 | 
162 |     pub fn add(&self, value: i32) {
163 |         self.data.borrow_mut().push(value);
164 |     }
165 | 
166 |     pub fn get(&self, index: usize) -> Option<i32> {
167 |         self.data.borrow().get(index).copied()
168 |     }
169 | 
170 |     pub fn clone_ref(&self) -> SharedData {
171 |         SharedData {
172 |             data: Rc::clone(&self.data),
173 |         }
174 |     }
175 | }
176 | 
177 | // Cell - for Copy types
178 | 
179 | pub struct CellExample {
180 |     value: Cell<i32>,
181 | }
182 | 
183 | impl CellExample {
184 |     pub fn new(value: i32) -> Self {
185 |         Self {
186 |             value: Cell::new(value),
187 |         }
188 |     }
189 | 
190 |     pub fn get(&self) -> i32 {
191 |         self.value.get()
192 |     }
193 | 
194 |     pub fn set(&self, value: i32) {
195 |         self.value.set(value);
196 |     }
197 | 
198 |     pub fn increment(&self) {
199 |         let current = self.value.get();
200 |         self.value.set(current + 1);
201 |     }
202 | }
203 | 
204 | // Weak references
205 | 
206 | pub fn weak_reference_example() {
207 |     let strong = Rc::new(42);
208 |     let weak = Rc::downgrade(&strong);
209 | 
210 |     println!("Strong count: {}", Rc::strong_count(&strong));
211 |     println!("Weak count: {}", Rc::weak_count(&strong));
212 | 
213 |     match weak.upgrade() {
214 |         Some(value) => println!("Value: {}", value),
215 |         None => println!("Value has been dropped"),
216 |     }
217 | }
218 | 
219 | // Custom smart pointer
220 | 
221 | pub struct MyBox<T> {
222 |     value: T,
223 | }
224 | 
225 | impl<T> MyBox<T> {
226 |     pub fn new(value: T) -> Self {
227 |         Self { value }
228 |     }
229 | }
230 | 
231 | impl<T> std::ops::Deref for MyBox<T> {
232 |     type Target = T;
233 | 
234 |     fn deref(&self) -> &Self::Target {
235 |         &self.value
236 |     }
237 | }
238 | 
239 | impl<T> std::ops::DerefMut for MyBox<T> {
240 |     fn deref_mut(&mut self) -> &mut Self::Target {
241 |         &mut self.value
242 |     }
243 | }
244 | 
245 | // Drop trait
246 | 
247 | pub struct CustomDrop {
248 |     data: String,
249 | }
250 | 
251 | impl CustomDrop {
252 |     pub fn new(data: String) -> Self {
253 |         println!("Creating CustomDrop with: {}", data);
254 |         Self { data }
255 |     }
256 | }
257 | 
258 | impl Drop for CustomDrop {
259 |     fn drop(&mut self) {
260 |         println!("Dropping CustomDrop with: {}", self.data);
261 |     }
262 | }
263 | 
264 | // Arc for thread-safe reference counting
265 | use std::sync::Mutex;
266 | use std::thread;
267 | 
268 | pub fn arc_example() {
269 |     let data = Arc::new(Mutex::new(vec![1, 2, 3]));
270 |     let mut handles = vec![];
271 | 
272 |     for i in 0..3 {
273 |         let data = Arc::clone(&data);
274 |         let handle = thread::spawn(move || {
275 |             let mut data = data.lock().unwrap();
276 |             data.push(i);
277 |         });
278 |         handles.push(handle);
279 |     }
280 | 
281 |     for handle in handles {
282 |         handle.join().unwrap();
283 |     }
284 | 
285 |     println!("Result: {:?}", data.lock().unwrap());
286 | }
287 | 
288 | // Cow - Clone on Write
289 | use std::borrow::Cow;
290 | 
291 | pub fn cow_example(input: &str) -> Cow<str> {
292 |     if input.contains(' ') {
293 |         Cow::Owned(input.replace(' ', "_"))
294 |     } else {
295 |         Cow::Borrowed(input)
296 |     }
297 | }
298 | 
299 | pub fn cow_modify(mut data: Cow<[i32]>) -> Cow<[i32]> {
300 |     data.to_mut().push(4);
301 |     data
302 | }
303 | 
304 | #[cfg(test)]
305 | mod tests {
306 |     use super::*;
307 | 
308 |     #[test]
309 |     fn test_list() {
310 |         let list = List::new().prepend(3).prepend(2).prepend(1);
311 |         assert_eq!(list.len(), 3);
312 |     }
313 | 
314 |     #[test]
315 |     fn test_shared_data() {
316 |         let data = SharedData::new();
317 |         let data2 = data.clone_ref();
318 |         
319 |         data.add(1);
320 |         data2.add(2);
321 |         
322 |         assert_eq!(data.get(0), Some(1));
323 |         assert_eq!(data.get(1), Some(2));
324 |         assert_eq!(data2.get(0), Some(1));
325 |     }
326 | 
327 |     #[test]
328 |     fn test_cell() {
329 |         let cell = CellExample::new(5);
330 |         assert_eq!(cell.get(), 5);
331 |         cell.increment();
332 |         assert_eq!(cell.get(), 6);
333 |     }
334 | 
335 |     #[test]
336 |     fn test_mock_messenger() {
337 |         let messenger = MockMessenger::new();
338 |         messenger.send("hello");
339 |         messenger.send("world");
340 |         assert_eq!(messenger.message_count(), 2);
341 |     }
342 | 
343 |     #[test]
344 |     fn test_cow() {
345 |         let borrowed = cow_example("hello");
346 |         assert!(matches!(borrowed, Cow::Borrowed(_)));
347 |         
348 |         let owned = cow_example("hello world");
349 |         assert!(matches!(owned, Cow::Owned(_)));
350 |     }
351 | }
352 | 
353 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_go/packages_imports.go:
--------------------------------------------------------------------------------

```go
  1 | // packages_imports.go - Demonstrates Go package imports and usage
  2 | package main
  3 | 
  4 | import (
  5 | 	// Standard library imports
  6 | 	"fmt"
  7 | 	"io"
  8 | 	"math"
  9 | 	"math/rand"
 10 | 	"net/http"
 11 | 	"os"
 12 | 	"strings"
 13 | 	"time"
 14 | 	
 15 | 	// Aliased imports
 16 | 	str "strings"
 17 | 	
 18 | 	// Dot imports (imports all exported names directly)
 19 | 	// . "fmt"  // Uncomment to use - not recommended in production
 20 | 	
 21 | 	// Blank imports (for side effects only)
 22 | 	_ "image/png"
 23 | 	
 24 | 	// Local package import (would be actual import in real project)
 25 | 	// "github.com/user/project/module"
 26 | )
 27 | 
 28 | // StandardLibraryUsage demonstrates standard library usage
 29 | func StandardLibraryUsage() {
 30 | 	// fmt package
 31 | 	fmt.Println("Hello from fmt")
 32 | 	
 33 | 	// strings package
 34 | 	upper := strings.ToUpper("hello")
 35 | 	fmt.Println(upper)
 36 | 	
 37 | 	// math package
 38 | 	sqrt := math.Sqrt(16)
 39 | 	fmt.Printf("Square root: %.2f\n", sqrt)
 40 | 	
 41 | 	// time package
 42 | 	now := time.Now()
 43 | 	fmt.Println("Current time:", now.Format(time.RFC3339))
 44 | 	
 45 | 	// rand package
 46 | 	rand.Seed(time.Now().UnixNano())
 47 | 	randomNum := rand.Intn(100)
 48 | 	fmt.Println("Random number:", randomNum)
 49 | }
 50 | 
 51 | // AliasedImportUsage demonstrates aliased imports
 52 | func AliasedImportUsage() {
 53 | 	// Using str alias for strings package
 54 | 	result := str.Contains("hello world", "world")
 55 | 	fmt.Println("Contains:", result)
 56 | 	
 57 | 	trimmed := str.TrimSpace("  spaces  ")
 58 | 	fmt.Println("Trimmed:", trimmed)
 59 | }
 60 | 
 61 | // FileOperations demonstrates os and io packages
 62 | func FileOperations() error {
 63 | 	// Create a file
 64 | 	file, err := os.Create("example.txt")
 65 | 	if err != nil {
 66 | 		return fmt.Errorf("failed to create file: %w", err)
 67 | 	}
 68 | 	defer file.Close()
 69 | 	
 70 | 	// Write to file
 71 | 	_, err = io.WriteString(file, "Hello, File!\n")
 72 | 	if err != nil {
 73 | 		return fmt.Errorf("failed to write to file: %w", err)
 74 | 	}
 75 | 	
 76 | 	// Read file
 77 | 	content, err := os.ReadFile("example.txt")
 78 | 	if err != nil {
 79 | 		return fmt.Errorf("failed to read file: %w", err)
 80 | 	}
 81 | 	
 82 | 	fmt.Println("File content:", string(content))
 83 | 	
 84 | 	// Clean up
 85 | 	os.Remove("example.txt")
 86 | 	
 87 | 	return nil
 88 | }
 89 | 
 90 | // HTTPClientExample demonstrates net/http package
 91 | func HTTPClientExample() error {
 92 | 	// Make HTTP request
 93 | 	resp, err := http.Get("https://api.github.com")
 94 | 	if err != nil {
 95 | 		return fmt.Errorf("failed to make request: %w", err)
 96 | 	}
 97 | 	defer resp.Body.Close()
 98 | 	
 99 | 	fmt.Println("Status:", resp.Status)
100 | 	
101 | 	// Read response body
102 | 	body, err := io.ReadAll(resp.Body)
103 | 	if err != nil {
104 | 		return fmt.Errorf("failed to read response: %w", err)
105 | 	}
106 | 	
107 | 	fmt.Println("Response length:", len(body))
108 | 	
109 | 	return nil
110 | }
111 | 
112 | // HTTPServerExample demonstrates creating an HTTP server
113 | func HTTPServerExample() {
114 | 	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
115 | 		fmt.Fprintf(w, "Hello, %s!", r.URL.Path[1:])
116 | 	})
117 | 	
118 | 	http.HandleFunc("/api/users", handleUsers)
119 | 	
120 | 	// This would start the server (commented out for sample)
121 | 	// http.ListenAndServe(":8080", nil)
122 | }
123 | 
124 | func handleUsers(w http.ResponseWriter, r *http.Request) {
125 | 	switch r.Method {
126 | 	case http.MethodGet:
127 | 		fmt.Fprintf(w, "Getting users")
128 | 	case http.MethodPost:
129 | 		fmt.Fprintf(w, "Creating user")
130 | 	default:
131 | 		http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
132 | 	}
133 | }
134 | 
135 | // StringsPackageUsage demonstrates extensive strings package usage
136 | func StringsPackageUsage() {
137 | 	// Various string operations
138 | 	text := "Hello, World! Hello, Go!"
139 | 	
140 | 	contains := strings.Contains(text, "World")
141 | 	hasPrefix := strings.HasPrefix(text, "Hello")
142 | 	hasSuffix := strings.HasSuffix(text, "Go!")
143 | 	
144 | 	count := strings.Count(text, "Hello")
145 | 	index := strings.Index(text, "World")
146 | 	
147 | 	split := strings.Split(text, " ")
148 | 	joined := strings.Join(split, "-")
149 | 	
150 | 	replaced := strings.Replace(text, "Hello", "Hi", -1)
151 | 	
152 | 	fmt.Printf("Contains: %v, Prefix: %v, Suffix: %v\n", contains, hasPrefix, hasSuffix)
153 | 	fmt.Printf("Count: %d, Index: %d\n", count, index)
154 | 	fmt.Printf("Split: %v\n", split)
155 | 	fmt.Printf("Joined: %s\n", joined)
156 | 	fmt.Printf("Replaced: %s\n", replaced)
157 | }
158 | 
159 | // MathPackageUsage demonstrates math package
160 | func MathPackageUsage() {
161 | 	// Math constants
162 | 	fmt.Println("Pi:", math.Pi)
163 | 	fmt.Println("E:", math.E)
164 | 	
165 | 	// Math functions
166 | 	fmt.Println("Sqrt(16):", math.Sqrt(16))
167 | 	fmt.Println("Pow(2, 10):", math.Pow(2, 10))
168 | 	fmt.Println("Max(10, 20):", math.Max(10, 20))
169 | 	fmt.Println("Min(10, 20):", math.Min(10, 20))
170 | 	fmt.Println("Abs(-42):", math.Abs(-42))
171 | 	fmt.Println("Ceil(4.2):", math.Ceil(4.2))
172 | 	fmt.Println("Floor(4.8):", math.Floor(4.8))
173 | 	fmt.Println("Round(4.5):", math.Round(4.5))
174 | }
175 | 
176 | // TimePackageUsage demonstrates time package
177 | func TimePackageUsage() {
178 | 	// Current time
179 | 	now := time.Now()
180 | 	fmt.Println("Current time:", now)
181 | 	
182 | 	// Time formatting
183 | 	formatted := now.Format("2006-01-02 15:04:05")
184 | 	fmt.Println("Formatted:", formatted)
185 | 	
186 | 	// Parsing time
187 | 	parsed, _ := time.Parse("2006-01-02", "2024-01-15")
188 | 	fmt.Println("Parsed:", parsed)
189 | 	
190 | 	// Time arithmetic
191 | 	tomorrow := now.Add(24 * time.Hour)
192 | 	yesterday := now.Add(-24 * time.Hour)
193 | 	fmt.Println("Tomorrow:", tomorrow.Format("2006-01-02"))
194 | 	fmt.Println("Yesterday:", yesterday.Format("2006-01-02"))
195 | 	
196 | 	// Duration
197 | 	duration := 2 * time.Hour
198 | 	fmt.Println("Duration:", duration)
199 | 	
200 | 	// Sleep
201 | 	// time.Sleep(time.Second)
202 | }
203 | 
204 | // OSPackageUsage demonstrates os package
205 | func OSPackageUsage() {
206 | 	// Environment variables
207 | 	os.Setenv("MY_VAR", "my_value")
208 | 	value := os.Getenv("MY_VAR")
209 | 	fmt.Println("Environment variable:", value)
210 | 	
211 | 	// Command line arguments
212 | 	args := os.Args
213 | 	fmt.Println("Program name:", args[0])
214 | 	
215 | 	// Working directory
216 | 	wd, _ := os.Getwd()
217 | 	fmt.Println("Working directory:", wd)
218 | 	
219 | 	// File info
220 | 	fileInfo, err := os.Stat("packages_imports.go")
221 | 	if err == nil {
222 | 		fmt.Println("File size:", fileInfo.Size())
223 | 		fmt.Println("Is directory:", fileInfo.IsDir())
224 | 		fmt.Println("Modified:", fileInfo.ModTime())
225 | 	}
226 | }
227 | 
228 | // IOPackageUsage demonstrates io package
229 | func IOPackageUsage() {
230 | 	// String reader
231 | 	reader := strings.NewReader("Hello from io package")
232 | 	
233 | 	// Read all
234 | 	content, _ := io.ReadAll(reader)
235 | 	fmt.Println("Content:", string(content))
236 | 	
237 | 	// Copy example (would copy from one reader/writer to another)
238 | 	// io.Copy(dst, src)
239 | }
240 | 
241 | // MultiplePackageUsage uses multiple packages together
242 | func MultiplePackageUsage() error {
243 | 	// Combine time, strings, and fmt
244 | 	now := time.Now()
245 | 	formatted := now.Format(time.RFC3339)
246 | 	upper := strings.ToUpper(formatted)
247 | 	final := fmt.Sprintf("Current time: %s", upper)
248 | 	
249 | 	// Combine math and fmt
250 | 	result := math.Sqrt(math.Pow(3, 2) + math.Pow(4, 2))
251 | 	output := fmt.Sprintf("Hypotenuse: %.2f", result)
252 | 	
253 | 	fmt.Println(final)
254 | 	fmt.Println(output)
255 | 	
256 | 	return nil
257 | }
258 | 
259 | // PackageInitPattern demonstrates initialization patterns
260 | var (
261 | 	initialized bool
262 | 	config      map[string]string
263 | )
264 | 
265 | func init() {
266 | 	// This runs automatically when package is imported
267 | 	initialized = true
268 | 	config = make(map[string]string)
269 | 	config["version"] = "1.0.0"
270 | 	config["env"] = "development"
271 | 	
272 | 	fmt.Println("Package initialized")
273 | }
274 | 
275 | // GetConfig returns the config
276 | func GetConfig(key string) string {
277 | 	return config[key]
278 | }
279 | 
280 | func demonstrateImports() {
281 | 	StandardLibraryUsage()
282 | 	AliasedImportUsage()
283 | 	StringsPackageUsage()
284 | 	MathPackageUsage()
285 | 	TimePackageUsage()
286 | 	OSPackageUsage()
287 | 	IOPackageUsage()
288 | 	MultiplePackageUsage()
289 | }
290 | 
291 | 
```
Page 4/18FirstPrevNextLast