#
tokens: 48869/50000 52/367 files (page 2/18)
lines: on (toggle) GitHub
raw markdown copy reset
This is page 2 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

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

```typescript
 1 | import * as React from "react";
 2 | import * as PopoverPrimitive from "@radix-ui/react-popover";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const Popover = PopoverPrimitive.Root;
 7 | 
 8 | const PopoverTrigger = PopoverPrimitive.Trigger;
 9 | 
10 | const PopoverContent = React.forwardRef<
11 |   React.ElementRef<typeof PopoverPrimitive.Content>,
12 |   React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
13 | >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
14 |   <PopoverPrimitive.Portal>
15 |     <PopoverPrimitive.Content
16 |       ref={ref}
17 |       align={align}
18 |       sideOffset={sideOffset}
19 |       className={cn(
20 |         "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
21 |         className,
22 |       )}
23 |       {...props}
24 |     />
25 |   </PopoverPrimitive.Portal>
26 | ));
27 | PopoverContent.displayName = PopoverPrimitive.Content.displayName;
28 | 
29 | export { Popover, PopoverTrigger, PopoverContent };
30 | 
```

--------------------------------------------------------------------------------
/website/src/pages/Index.tsx:
--------------------------------------------------------------------------------

```typescript
 1 | import HeroSection from "../components/HeroSection";
 2 | import FeaturesSection from "../components/FeaturesSection";
 3 | import InstallationSection from "../components/InstallationSection";
 4 | import DemoSection from "../components/DemoSection";
 5 | import ExamplesSection from "../components/ExamplesSection";
 6 | import CookbookSection from "../components/CookbookSection";
 7 | import Footer from "../components/Footer";
 8 | import TestimonialSection from "../components/TestimonialSection";
 9 | import ComparisonTable from "../components/ComparisonTable";
10 | 
11 | const Index = () => {
12 |   return (
13 |     <main className="min-h-screen overflow-x-hidden">
14 |       <div data-aos="fade-in">
15 |         <HeroSection />
16 |       </div>
17 |       <div data-aos="fade-up">
18 |         <DemoSection />
19 |       </div>
20 |       <div data-aos="fade-up">
21 |         <ComparisonTable />
22 |       </div>
23 |       <div data-aos="fade-up">
24 |         <FeaturesSection />
25 |       </div>
26 |       <div data-aos="fade-up">
27 |         <InstallationSection />
28 |       </div>
29 |       <div data-aos="fade-up">
30 |         <ExamplesSection />
31 |       </div>
32 |       <div data-aos="fade-up">
33 |         <TestimonialSection />
34 |       </div>
35 |       <div data-aos="fade-up">
36 |         <CookbookSection />
37 |       </div>
38 |       <div data-aos="fade-up" data-aos-anchor-placement="top-bottom">
39 |         <Footer />
40 |       </div>
41 |     </main>
42 |   );
43 | };
44 | 
45 | export default Index;
46 | 
47 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as AvatarPrimitive from "@radix-ui/react-avatar";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const Avatar = React.forwardRef<
 7 |   React.ElementRef<typeof AvatarPrimitive.Root>,
 8 |   React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
 9 | >(({ className, ...props }, ref) => (
10 |   <AvatarPrimitive.Root
11 |     ref={ref}
12 |     className={cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className)}
13 |     {...props}
14 |   />
15 | ));
16 | Avatar.displayName = AvatarPrimitive.Root.displayName;
17 | 
18 | const AvatarImage = React.forwardRef<
19 |   React.ElementRef<typeof AvatarPrimitive.Image>,
20 |   React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
21 | >(({ className, ...props }, ref) => (
22 |   <AvatarPrimitive.Image ref={ref} className={cn("aspect-square h-full w-full", className)} {...props} />
23 | ));
24 | AvatarImage.displayName = AvatarPrimitive.Image.displayName;
25 | 
26 | const AvatarFallback = React.forwardRef<
27 |   React.ElementRef<typeof AvatarPrimitive.Fallback>,
28 |   React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
29 | >(({ className, ...props }, ref) => (
30 |   <AvatarPrimitive.Fallback
31 |     ref={ref}
32 |     className={cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className)}
33 |     {...props}
34 |   />
35 | ));
36 | AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
37 | 
38 | export { Avatar, AvatarImage, AvatarFallback };
39 | 
```

--------------------------------------------------------------------------------
/.github/workflows/post_discord_invite.yml:
--------------------------------------------------------------------------------

```yaml
 1 | name: Post Discord Invite on Issue or PR
 2 | 
 3 | permissions:
 4 |   issues: write
 5 |   pull-requests: write
 6 | 
 7 | on:
 8 |   issues:
 9 |     types: [opened]
10 |   pull_request:
11 |     types: [opened]
12 | 
13 | jobs:
14 |   post_discord_invite:
15 |     # Skip if the event is a PR from a fork; still run for issues and in-repo PRs
16 |     if: ${{ github.event_name == 'issues' || (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork) }}
17 |     runs-on: ubuntu-latest
18 |     steps:
19 |       - name: Post Discord Invite Comment
20 |         uses: actions/github-script@v6
21 |         with:
22 |           github-token: ${{ secrets.GITHUB_TOKEN }}
23 |           script: |
24 |             const discord_link = "https://discord.gg/dR4QY32uYQ";
25 | 
26 |             let number;
27 |             if (context.payload.issue) {
28 |               number = context.payload.issue.number;
29 |             } else if (context.payload.pull_request) {
30 |               number = context.payload.pull_request.number;
31 |             } else {
32 |               console.log("No issue or PR found. Exiting.");
33 |               return;
34 |             }
35 | 
36 |             console.log("Detected issue/PR number:", number);
37 | 
38 |             await github.rest.issues.createComment({
39 |               owner: context.repo.owner,
40 |               repo: context.repo.repo,
41 |               issue_number: number,
42 |               body: `Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: ${discord_link}`
43 |             });
44 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as TogglePrimitive from "@radix-ui/react-toggle";
 3 | import { cva, type VariantProps } from "class-variance-authority";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | 
 7 | const toggleVariants = cva(
 8 |   "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
 9 |   {
10 |     variants: {
11 |       variant: {
12 |         default: "bg-transparent",
13 |         outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
14 |       },
15 |       size: {
16 |         default: "h-10 px-3",
17 |         sm: "h-9 px-2.5",
18 |         lg: "h-11 px-5",
19 |       },
20 |     },
21 |     defaultVariants: {
22 |       variant: "default",
23 |       size: "default",
24 |     },
25 |   },
26 | );
27 | 
28 | const Toggle = React.forwardRef<
29 |   React.ElementRef<typeof TogglePrimitive.Root>,
30 |   React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>
31 | >(({ className, variant, size, ...props }, ref) => (
32 |   <TogglePrimitive.Root ref={ref} className={cn(toggleVariants({ variant, size, className }))} {...props} />
33 | ));
34 | 
35 | Toggle.displayName = TogglePrimitive.Root.displayName;
36 | 
37 | export { Toggle, toggleVariants };
38 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/radio-group.tsx:
--------------------------------------------------------------------------------

```typescript
 1 | import * as React from "react";
 2 | import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
 3 | import { Circle } from "lucide-react";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | 
 7 | const RadioGroup = React.forwardRef<
 8 |   React.ElementRef<typeof RadioGroupPrimitive.Root>,
 9 |   React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
10 | >(({ className, ...props }, ref) => {
11 |   return <RadioGroupPrimitive.Root className={cn("grid gap-2", className)} {...props} ref={ref} />;
12 | });
13 | RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
14 | 
15 | const RadioGroupItem = React.forwardRef<
16 |   React.ElementRef<typeof RadioGroupPrimitive.Item>,
17 |   React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
18 | >(({ className, ...props }, ref) => {
19 |   return (
20 |     <RadioGroupPrimitive.Item
21 |       ref={ref}
22 |       className={cn(
23 |         "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
24 |         className,
25 |       )}
26 |       {...props}
27 |     >
28 |       <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
29 |         <Circle className="h-2.5 w-2.5 fill-current text-current" />
30 |       </RadioGroupPrimitive.Indicator>
31 |     </RadioGroupPrimitive.Item>
32 |   );
33 | });
34 | RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
35 | 
36 | export { RadioGroup, RadioGroupItem };
37 | 
```

--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------

```toml
 1 | [project]
 2 | name = "codegraphcontext"
 3 | version = "0.1.17"
 4 | description = "An MCP server that indexes local code into a graph database to provide context to AI assistants."
 5 | authors = [{ name = "Shashank Shekhar Singh", email = "[email protected]" }]
 6 | readme = "README.md"
 7 | license = { file = "LICENSE" }
 8 | requires-python = ">=3.9"
 9 | classifiers = [
10 |     "Programming Language :: Python :: 3",
11 |     "License :: OSI Approved :: MIT License",
12 |     "Operating System :: OS Independent",
13 |     "Development Status :: 3 - Alpha",
14 |     "Intended Audience :: Developers",
15 |     "Topic :: Software Development :: Libraries :: Application Frameworks",
16 | ]
17 | dependencies = [
18 |     "neo4j>=5.15.0",
19 |     "watchdog>=3.0.0",
20 |     "requests>=2.31.0",
21 |     "stdlibs>=2023.11.18",
22 |     "typer[all]>=0.9.0",
23 |     "rich>=13.7.0",
24 |     "inquirerpy>=0.3.4",
25 |     "python-dotenv>=1.0.0",
26 |     "tree-sitter==0.20.4",                   
27 |     "tree-sitter-languages==1.10.2",
28 |     "pyyaml",
29 |     "pytest",
30 |     "nbformat",
31 |     "nbconvert>=7.16.6",
32 |     "pathspec>=0.12.1"
33 | ]
34 | 
35 | [project.urls]
36 | "Homepage" = "https://github.com/Shashankss1205/CodeGraphContext"
37 | "Bug Tracker" = "https://github.com/Shashankss1205/CodeGraphContext/issues"
38 | 
39 | [project.scripts]
40 | cgc = "codegraphcontext.cli.main:app"
41 | codegraphcontext = "codegraphcontext.cli.main:app"
42 | 
43 | [project.optional-dependencies]
44 | dev = [
45 |     "pytest>=7.4.0",
46 |     "black>=23.11.0",
47 |     "pytest-asyncio>=0.21.0",
48 | ]
49 | 
50 | [tool.setuptools]
51 | package-dir = { "" = "src" }
52 | 
53 | [tool.setuptools.packages.find]
54 | where = ["src"]
55 | include = ["codegraphcontext*"]
56 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import { cva, type VariantProps } from "class-variance-authority";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const alertVariants = cva(
 7 |   "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
 8 |   {
 9 |     variants: {
10 |       variant: {
11 |         default: "bg-background text-foreground",
12 |         destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
13 |       },
14 |     },
15 |     defaultVariants: {
16 |       variant: "default",
17 |     },
18 |   },
19 | );
20 | 
21 | const Alert = React.forwardRef<
22 |   HTMLDivElement,
23 |   React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
24 | >(({ className, variant, ...props }, ref) => (
25 |   <div ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} {...props} />
26 | ));
27 | Alert.displayName = "Alert";
28 | 
29 | const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
30 |   ({ className, ...props }, ref) => (
31 |     <h5 ref={ref} className={cn("mb-1 font-medium leading-none tracking-tight", className)} {...props} />
32 |   ),
33 | );
34 | AlertTitle.displayName = "AlertTitle";
35 | 
36 | const AlertDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
37 |   ({ className, ...props }, ref) => (
38 |     <div ref={ref} className={cn("text-sm [&_p]:leading-relaxed", className)} {...props} />
39 |   ),
40 | );
41 | AlertDescription.displayName = "AlertDescription";
42 | 
43 | export { Alert, AlertTitle, AlertDescription };
44 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/scroll-area.tsx:
--------------------------------------------------------------------------------

```typescript
 1 | import * as React from "react";
 2 | import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const ScrollArea = React.forwardRef<
 7 |   React.ElementRef<typeof ScrollAreaPrimitive.Root>,
 8 |   React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
 9 | >(({ className, children, ...props }, ref) => (
10 |   <ScrollAreaPrimitive.Root ref={ref} className={cn("relative overflow-hidden", className)} {...props}>
11 |     <ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">{children}</ScrollAreaPrimitive.Viewport>
12 |     <ScrollBar />
13 |     <ScrollAreaPrimitive.Corner />
14 |   </ScrollAreaPrimitive.Root>
15 | ));
16 | ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
17 | 
18 | const ScrollBar = React.forwardRef<
19 |   React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
20 |   React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
21 | >(({ className, orientation = "vertical", ...props }, ref) => (
22 |   <ScrollAreaPrimitive.ScrollAreaScrollbar
23 |     ref={ref}
24 |     orientation={orientation}
25 |     className={cn(
26 |       "flex touch-none select-none transition-colors",
27 |       orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
28 |       orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
29 |       className,
30 |     )}
31 |     {...props}
32 |   >
33 |     <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
34 |   </ScrollAreaPrimitive.ScrollAreaScrollbar>
35 | ));
36 | ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
37 | 
38 | export { ScrollArea, ScrollBar };
39 | 
```

--------------------------------------------------------------------------------
/website/src/App.tsx:
--------------------------------------------------------------------------------

```typescript
 1 | import { useEffect } from "react";
 2 | import { Toaster } from "@/components/ui/toaster";
 3 | import { Toaster as Sonner } from "@/components/ui/sonner";
 4 | import { TooltipProvider } from "@/components/ui/tooltip";
 5 | import { ThemeProvider } from "@/components/ThemeProvider";
 6 | import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
 7 | import { BrowserRouter, Routes, Route } from "react-router-dom";
 8 | import Index from "./pages/Index";
 9 | import NotFound from "./pages/NotFound";
10 | import MoveToTop from "./components/MoveToTop";
11 | 
12 | // ✅ Import AOS library and CSS
13 | import AOS from "aos";
14 | import "aos/dist/aos.css";
15 | 
16 | const queryClient = new QueryClient();
17 | 
18 | const App: React.FC = () => {
19 |   // ✅ Initialize AOS once on mount
20 |   useEffect(() => {
21 |     AOS.init({
22 |       duration: 800, // Animation duration (ms)
23 |       easing: "ease-in-out", // Smooth transition
24 |       once: true, // Run animation only once
25 |       mirror: false, // Do not animate when scrolling back up
26 |     });
27 |   }, []);
28 | 
29 |   return (
30 |     <QueryClientProvider client={queryClient}>
31 |       <ThemeProvider
32 |         attribute="class"
33 |         defaultTheme="dark"
34 |         enableSystem
35 |         disableTransitionOnChange
36 |       >
37 |         <TooltipProvider>
38 |           <Toaster />
39 |           <Sonner />
40 |           <BrowserRouter>
41 |             <Routes>
42 |               <Route path="/" element={<Index />} />
43 |               {/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
44 |               <Route path="*" element={<NotFound />} />
45 |             </Routes>
46 |           </BrowserRouter>
47 | 
48 |           {/* Move to Top button */}
49 |           <MoveToTop />
50 |         </TooltipProvider>
51 |       </ThemeProvider>
52 |     </QueryClientProvider>
53 |   );
54 | };
55 | 
56 | export default App;
57 | 
```

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

```typescript
 1 | import { GripVertical } from "lucide-react";
 2 | import * as ResizablePrimitive from "react-resizable-panels";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const ResizablePanelGroup = ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
 7 |   <ResizablePrimitive.PanelGroup
 8 |     className={cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", className)}
 9 |     {...props}
10 |   />
11 | );
12 | 
13 | const ResizablePanel = ResizablePrimitive.Panel;
14 | 
15 | const ResizableHandle = ({
16 |   withHandle,
17 |   className,
18 |   ...props
19 | }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
20 |   withHandle?: boolean;
21 | }) => (
22 |   <ResizablePrimitive.PanelResizeHandle
23 |     className={cn(
24 |       "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 [&[data-panel-group-direction=vertical]>div]:rotate-90",
25 |       className,
26 |     )}
27 |     {...props}
28 |   >
29 |     {withHandle && (
30 |       <div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
31 |         <GripVertical className="h-2.5 w-2.5" />
32 |       </div>
33 |     )}
34 |   </ResizablePrimitive.PanelResizeHandle>
35 | );
36 | 
37 | export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
38 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/toggle-group.tsx:
--------------------------------------------------------------------------------

```typescript
 1 | import * as React from "react";
 2 | import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
 3 | import { type VariantProps } from "class-variance-authority";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | import { toggleVariants } from "@/components/ui/toggle";
 7 | 
 8 | const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({
 9 |   size: "default",
10 |   variant: "default",
11 | });
12 | 
13 | const ToggleGroup = React.forwardRef<
14 |   React.ElementRef<typeof ToggleGroupPrimitive.Root>,
15 |   React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>
16 | >(({ className, variant, size, children, ...props }, ref) => (
17 |   <ToggleGroupPrimitive.Root ref={ref} className={cn("flex items-center justify-center gap-1", className)} {...props}>
18 |     <ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>
19 |   </ToggleGroupPrimitive.Root>
20 | ));
21 | 
22 | ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
23 | 
24 | const ToggleGroupItem = React.forwardRef<
25 |   React.ElementRef<typeof ToggleGroupPrimitive.Item>,
26 |   React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>
27 | >(({ className, children, variant, size, ...props }, ref) => {
28 |   const context = React.useContext(ToggleGroupContext);
29 | 
30 |   return (
31 |     <ToggleGroupPrimitive.Item
32 |       ref={ref}
33 |       className={cn(
34 |         toggleVariants({
35 |           variant: context.variant || variant,
36 |           size: context.size || size,
37 |         }),
38 |         className,
39 |       )}
40 |       {...props}
41 |     >
42 |       {children}
43 |     </ToggleGroupPrimitive.Item>
44 |   );
45 | });
46 | 
47 | ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
48 | 
49 | export { ToggleGroup, ToggleGroupItem };
50 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/orbiting-circles.tsx:
--------------------------------------------------------------------------------

```typescript
 1 | import React from "react"
 2 | 
 3 | import { cn } from "@/lib/utils"
 4 | 
 5 | export interface OrbitingCirclesProps
 6 |   extends React.HTMLAttributes<HTMLDivElement> {
 7 |   className?: string
 8 |   children?: React.ReactNode
 9 |   reverse?: boolean
10 |   duration?: number
11 |   delay?: number
12 |   radius?: number
13 |   path?: boolean
14 |   iconSize?: number
15 |   speed?: number
16 | }
17 | 
18 | export function OrbitingCircles({
19 |   className,
20 |   children,
21 |   reverse,
22 |   duration = 20,
23 |   radius = 160,
24 |   path = true,
25 |   iconSize = 30,
26 |   speed = 1,
27 |   ...props
28 | }: OrbitingCirclesProps) {
29 |   const calculatedDuration = duration / speed
30 |   return (
31 |     <>
32 |       {path && (
33 |         <svg
34 |           xmlns="http://www.w3.org/2000/svg"
35 |           version="1.1"
36 |           className="pointer-events-none absolute inset-0 size-full"
37 |         >
38 |           <circle
39 |             className="stroke-black/10 stroke-1 dark:stroke-white/10"
40 |             cx="50%"
41 |             cy="50%"
42 |             r={radius}
43 |             fill="none"
44 |           />
45 |         </svg>
46 |       )}
47 |       {React.Children.map(children, (child, index) => {
48 |         const angle = (360 / React.Children.count(children)) * index
49 |         return (
50 |           <div
51 |             style={
52 |               {
53 |                 "--duration": calculatedDuration,
54 |                 "--radius": radius,
55 |                 "--angle": angle,
56 |                 "--icon-size": `${iconSize}px`,
57 |               } as React.CSSProperties
58 |             }
59 |             className={cn(
60 |               `animate-orbit absolute flex size-[var(--icon-size)] transform-gpu items-center justify-center rounded-full`,
61 |               { "[animation-direction:reverse]": reverse },
62 |               className
63 |             )}
64 |             {...props}
65 |           >
66 |             {child}
67 |           </div>
68 |         )
69 |       })}
70 |     </>
71 |   )
72 | }
73 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/edge_cases/long_functions.py:
--------------------------------------------------------------------------------

```python
 1 | def long_loop_example(n):
 2 |     result = []
 3 |     for i in range(n):
 4 |         if i % 2 == 0:
 5 |             result.append(i * 2)
 6 |         else:
 7 |             result.append(i + 3)
 8 |         if i % 5 == 0:
 9 |             result.append(i - 1)
10 |         if i % 7 == 0:
11 |             result.append(i * i)
12 |         if i % 3 == 0:
13 |             result.append(i // 2)
14 |         if i % 4 == 0:
15 |             result.append(i + 10)
16 |         if i % 6 == 0:
17 |             result.append(i - 5)
18 |         if i % 8 == 0:
19 |             result.append(i * 3)
20 |         if i % 9 == 0:
21 |             result.append(i + 7)
22 |         if i % 10 == 0:
23 |             result.append(i - 2)
24 |     return result
25 | 
26 | def verbose_conditions(x, y):
27 |     if x > 0:
28 |         a = x + y
29 |     else:
30 |         a = x - y
31 |     if y > 0:
32 |         b = y * 2
33 |     else:
34 |         b = y // 2
35 |     if x == y:
36 |         c = x * y
37 |     else:
38 |         c = x + y
39 |     if x % 2 == 0:
40 |         d = x // 2
41 |     else:
42 |         d = x * 2
43 |     if y % 3 == 0:
44 |         e = y // 3
45 |     else:
46 |         e = y * 3
47 |     if x > 10:
48 |         f = x - 10
49 |     else:
50 |         f = x + 10
51 |     return a + b + c + d + e + f
52 | 
53 | def extended_try_except(val):
54 |     try:
55 |         if val < 0:
56 |             raise ValueError("Negative value")
57 |         elif val == 0:
58 |             raise ZeroDivisionError("Zero value")
59 |         elif val > 100:
60 |             raise OverflowError("Too large")
61 |         result = val * 2
62 |         for i in range(5):
63 |             result += i
64 |         if result % 2 == 0:
65 |             result //= 2
66 |         else:
67 |             result += 1
68 |         return result
69 |     except ValueError as ve:
70 |         return str(ve)
71 |     except ZeroDivisionError as zde:
72 |         return str(zde)
73 |     except OverflowError as oe:
74 |         return str(oe)
75 |     except Exception as e:
76 |         return "Unknown error: " + str(e)
77 |     finally:
78 |         _ = "done"
```

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

```typescript
 1 | import * as React from "react";
 2 | 
 3 | import { cn } from "@/lib/utils";
 4 | 
 5 | const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (
 6 |   <div ref={ref} className={cn("rounded-lg border bg-card text-card-foreground shadow-sm", className)} {...props} />
 7 | ));
 8 | Card.displayName = "Card";
 9 | 
10 | const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
11 |   ({ className, ...props }, ref) => (
12 |     <div ref={ref} className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} />
13 |   ),
14 | );
15 | CardHeader.displayName = "CardHeader";
16 | 
17 | const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
18 |   ({ className, ...props }, ref) => (
19 |     <h3 ref={ref} className={cn("text-2xl font-semibold leading-none tracking-tight", className)} {...props} />
20 |   ),
21 | );
22 | CardTitle.displayName = "CardTitle";
23 | 
24 | const CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
25 |   ({ className, ...props }, ref) => (
26 |     <p ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />
27 |   ),
28 | );
29 | CardDescription.displayName = "CardDescription";
30 | 
31 | const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
32 |   ({ className, ...props }, ref) => <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />,
33 | );
34 | CardContent.displayName = "CardContent";
35 | 
36 | const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
37 |   ({ className, ...props }, ref) => (
38 |     <div ref={ref} className={cn("flex items-center p-6 pt-0", className)} {...props} />
39 |   ),
40 | );
41 | CardFooter.displayName = "CardFooter";
42 | 
43 | export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
44 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import { Slot } from "@radix-ui/react-slot";
 3 | import { cva, type VariantProps } from "class-variance-authority";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | 
 7 | const buttonVariants = cva(
 8 |   "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
 9 |   {
10 |     variants: {
11 |       variant: {
12 |         default: "bg-primary text-primary-foreground hover:bg-primary/90",
13 |         destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
14 |         outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
15 |         secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
16 |         ghost: "hover:bg-accent hover:text-accent-foreground",
17 |         link: "text-primary underline-offset-4 hover:underline",
18 |       },
19 |       size: {
20 |         default: "h-10 px-4 py-2",
21 |         sm: "h-9 rounded-md px-3",
22 |         lg: "h-11 rounded-md px-8",
23 |         icon: "h-10 w-10",
24 |       },
25 |     },
26 |     defaultVariants: {
27 |       variant: "default",
28 |       size: "default",
29 |     },
30 |   },
31 | );
32 | 
33 | export interface ButtonProps
34 |   extends React.ButtonHTMLAttributes<HTMLButtonElement>,
35 |     VariantProps<typeof buttonVariants> {
36 |   asChild?: boolean;
37 | }
38 | 
39 | const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
40 |   ({ className, variant, size, asChild = false, ...props }, ref) => {
41 |     const Comp = asChild ? Slot : "button";
42 |     return <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />;
43 |   },
44 | );
45 | Button.displayName = "Button";
46 | 
47 | export { Button, buttonVariants };
48 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as TabsPrimitive from "@radix-ui/react-tabs";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const Tabs = TabsPrimitive.Root;
 7 | 
 8 | const TabsList = React.forwardRef<
 9 |   React.ElementRef<typeof TabsPrimitive.List>,
10 |   React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
11 | >(({ className, ...props }, ref) => (
12 |   <TabsPrimitive.List
13 |     ref={ref}
14 |     className={cn(
15 |       "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
16 |       className,
17 |     )}
18 |     {...props}
19 |   />
20 | ));
21 | TabsList.displayName = TabsPrimitive.List.displayName;
22 | 
23 | const TabsTrigger = React.forwardRef<
24 |   React.ElementRef<typeof TabsPrimitive.Trigger>,
25 |   React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
26 | >(({ className, ...props }, ref) => (
27 |   <TabsPrimitive.Trigger
28 |     ref={ref}
29 |     className={cn(
30 |       "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
31 |       className,
32 |     )}
33 |     {...props}
34 |   />
35 | ));
36 | TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
37 | 
38 | const TabsContent = React.forwardRef<
39 |   React.ElementRef<typeof TabsPrimitive.Content>,
40 |   React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
41 | >(({ className, ...props }, ref) => (
42 |   <TabsPrimitive.Content
43 |     ref={ref}
44 |     className={cn(
45 |       "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
46 |       className,
47 |     )}
48 |     {...props}
49 |   />
50 | ));
51 | TabsContent.displayName = TabsPrimitive.Content.displayName;
52 | 
53 | export { Tabs, TabsList, TabsTrigger, TabsContent };
54 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_misc/tables.html:
--------------------------------------------------------------------------------

```html
 1 | <!DOCTYPE html>
 2 | <html lang="en">
 3 | <head>
 4 |     <meta charset="UTF-8">
 5 |     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 6 |     <title>Hacktoberfest Contributors</title>
 7 |     <link rel="stylesheet" href="tables.css">
 8 | </head>
 9 | <body>
10 |     <h1>Hacktoberfest 2025 Contributors</h1>
11 |     
12 |     <table>
13 |         <caption>Open Source Contributors</caption>
14 |         <thead>
15 |             <tr>
16 |                 <th>Contributor</th>
17 |                 <th>Project</th>
18 |                 <th>Pull Requests</th>
19 |                 <th>Contribution Type</th>
20 |                 <th>Status</th>
21 |             </tr>
22 |         </thead>
23 |         <tbody>
24 |             <tr>
25 |                 <td>Nureni Jamiu</td>
26 |                 <td>CodeGraphContext</td>
27 |                 <td>2</td>
28 |                 <td>Indexing Pipeline</td>
29 |                 <td>Completed</td>
30 |             </tr>
31 |             <tr>
32 |                 <td>Alex Chen</td>
33 |                 <td>PyViz</td>
34 |                 <td>3</td>
35 |                 <td>Bug Fixes</td>
36 |                 <td>In Progress</td>
37 |             </tr>
38 |             <tr>
39 |                 <td>Maria Garcia</td>
40 |                 <td>WebTools</td>
41 |                 <td>5</td>
42 |                 <td>Feature</td>
43 |                 <td>Completed</td>
44 |             </tr>
45 |             <tr>
46 |                 <td>James Wilson</td>
47 |                 <td>DataFlow</td>
48 |                 <td>2</td>
49 |                 <td>Testing</td>
50 |                 <td>In Progress</td>
51 |             </tr>
52 |             <tr>
53 |                 <td>Aisha Patel</td>
54 |                 <td>UIKit</td>
55 |                 <td>4</td>
56 |                 <td>Enhancement</td>
57 |                 <td>Completed</td>
58 |             </tr>
59 |         </tbody>
60 |         <tfoot>
61 |             <tr>
62 |                 <th colspan="2">Total Contributions:</th>
63 |                 <td>18</td>
64 |                 <td colspan="2">80% Complete</td>
65 |             </tr>
66 |         </tfoot>
67 |     </table>
68 | </body>
69 | </html>
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as AccordionPrimitive from "@radix-ui/react-accordion";
 3 | import { ChevronDown } from "lucide-react";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | 
 7 | const Accordion = AccordionPrimitive.Root;
 8 | 
 9 | const AccordionItem = React.forwardRef<
10 |   React.ElementRef<typeof AccordionPrimitive.Item>,
11 |   React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
12 | >(({ className, ...props }, ref) => (
13 |   <AccordionPrimitive.Item ref={ref} className={cn("border-b", className)} {...props} />
14 | ));
15 | AccordionItem.displayName = "AccordionItem";
16 | 
17 | const AccordionTrigger = React.forwardRef<
18 |   React.ElementRef<typeof AccordionPrimitive.Trigger>,
19 |   React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
20 | >(({ className, children, ...props }, ref) => (
21 |   <AccordionPrimitive.Header className="flex">
22 |     <AccordionPrimitive.Trigger
23 |       ref={ref}
24 |       className={cn(
25 |         "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
26 |         className,
27 |       )}
28 |       {...props}
29 |     >
30 |       {children}
31 |       <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
32 |     </AccordionPrimitive.Trigger>
33 |   </AccordionPrimitive.Header>
34 | ));
35 | AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
36 | 
37 | const AccordionContent = React.forwardRef<
38 |   React.ElementRef<typeof AccordionPrimitive.Content>,
39 |   React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
40 | >(({ className, children, ...props }, ref) => (
41 |   <AccordionPrimitive.Content
42 |     ref={ref}
43 |     className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
44 |     {...props}
45 |   >
46 |     <div className={cn("pb-4 pt-0", className)}>{children}</div>
47 |   </AccordionPrimitive.Content>
48 | ));
49 | 
50 | AccordionContent.displayName = AccordionPrimitive.Content.displayName;
51 | 
52 | export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
53 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/types_variable_assignments.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | #include <iostream>
 2 | #include <string>
 3 | #include <vector>
 4 | 
 5 | // --- Demo class ---
 6 | class Demo {
 7 | public:
 8 |     int member;                  // non-static member
 9 |     static int static_member;     // static member
10 |     const char* name = "Demo";
11 | 
12 |     void setMember(int value) { member = value; }
13 | };
14 | 
15 | int Demo::static_member = 100;
16 | 
17 | // --- Point struct for structured bindings ---
18 | struct Point {
19 |     int x;
20 |     int y;
21 | };
22 | 
23 | // --- Global variable declarations ---
24 | int global_int = 10;
25 | double global_double(3.14);
26 | std::string global_str = "Hello";
27 | const int CONST_VAL = 42;
28 | int *global_ptr = &global_int;
29 | int global_arr[5] = {1, 2, 3, 4, 5};
30 | 
31 | // --- Function demonstrating variable declarations ---
32 | void testVariables() {
33 |     // Basic declarations
34 |     int a = 5;
35 |     float b = 2.5f;
36 |     double c(9.81);
37 |     bool flag = true;
38 |     char ch = 'A';
39 |     std::string s = "Tree-sitter";
40 | 
41 |     // Pointer and reference
42 |     int x = 10;
43 |     int *p = &x;
44 |     int &ref = x;
45 |     const int *const_ptr = &x;
46 | 
47 |     // Arrays
48 |     int nums[3] = {1, 2, 3};
49 |     char letters[] = {'a', 'b', 'c'};
50 |     std::string words[2] = {"hello", "world"};
51 | 
52 |     // Vector and auto type
53 |     std::vector<int> vec = {1, 2, 3, 4};
54 |     auto val = vec[2];
55 | 
56 |     // Structured bindings (C++17)
57 |     Point pt = {10, 20};
58 |     auto [px, py] = pt;
59 | 
60 |     // Assignments and compound ops
61 |     a = 10;
62 |     a += 5;
63 |     b *= 3.0f;
64 |     c /= 2;
65 |     flag = !flag;
66 |     s += " test";
67 |     x = a + b - c;
68 | 
69 |     // Expressions and function calls
70 |     std::cout << "Sum: " << (a + b + c) << std::endl;
71 | 
72 |     // Dynamic allocation
73 |     int *dyn = new int(99);
74 |     delete dyn;
75 | 
76 |     // Static and const local variables
77 |     static int counter = 0;
78 |     const double PI = 3.14159;
79 | 
80 |     // Lambda with captured variable
81 |     auto lambda = [=]() { return PI * a; };
82 |     double result = lambda();
83 | 
84 |     // Object and member assignments
85 |     Demo d;
86 |     d.member = 50;
87 |     d.setMember(25);
88 |     Demo::static_member = 200;
89 | }
90 | 
91 | int main() {
92 |     testVariables();
93 |     return 0;
94 | }
95 | 
```

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

```typescript
 1 | import React, { useState, useEffect } from "react";
 2 | 
 3 | const MoveToTop: React.FC = () => {
 4 |     const [showButton, setShowButton] = useState<boolean>(false);
 5 | 
 6 |     useEffect(() => {
 7 |         const handleScroll = () => {
 8 |             if (window.scrollY > window.innerHeight * 0.05) {
 9 |                 setShowButton(true);
10 |             } else {
11 |                 setShowButton(false);
12 |             }
13 |         };
14 | 
15 |         window.addEventListener("scroll", handleScroll);
16 |         return () => window.removeEventListener("scroll", handleScroll);
17 |     }, []);
18 | 
19 |     const scrollToTop = () => {
20 |         window.scrollTo({ top: 0, behavior: "smooth" });
21 |     };
22 | 
23 |     return (
24 |         <>
25 |             {showButton && (
26 |                 <button
27 |                     onClick={scrollToTop}
28 |                     data-aos="fade-in"
29 |                     data-aos-duration="300"
30 |                     style={{
31 |                         position: "fixed",
32 |                         bottom: "40px",
33 |                         right: "40px",
34 |                         width: "40px",
35 |                         height: "40px",
36 |                         borderRadius: "50%",
37 |                         border: "none",
38 |                         background: "linear-gradient(135deg, hsl(263 70% 65%), hsl(180 100% 70%))",
39 |                         color: "#fff",
40 |                         cursor: "pointer",
41 |                         zIndex: 99,
42 |                         display: "flex",
43 |                         alignItems: "center",
44 |                         justifyContent: "center",
45 |                         padding: 0,
46 |                     }}
47 |                 >
48 |                     <div
49 |                         style={{
50 |                             width: "14px",
51 |                             height: "14px",
52 |                             borderTop: "1.5px solid black",
53 |                             borderLeft: "1.5px solid black",
54 |                             transform: "rotate(45deg) translateY(3px) translateX(2px)",
55 |                         }}
56 |                     ></div>
57 |                 </button>
58 |             )}
59 |         </>
60 |     );
61 | };
62 | 
63 | export default MoveToTop;
64 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_go/basic_functions.go:
--------------------------------------------------------------------------------

```go
  1 | // basic_functions.go - Demonstrates basic Go function patterns
  2 | package main
  3 | 
  4 | import (
  5 | 	"fmt"
  6 | 	"math"
  7 | )
  8 | 
  9 | // SimpleFunction is a basic function with single return
 10 | func SimpleFunction(x int) int {
 11 | 	return x * 2
 12 | }
 13 | 
 14 | // MultipleReturns demonstrates multiple return values
 15 | func MultipleReturns(a, b int) (int, int, error) {
 16 | 	if b == 0 {
 17 | 		return 0, 0, fmt.Errorf("division by zero")
 18 | 	}
 19 | 	return a + b, a - b, nil
 20 | }
 21 | 
 22 | // NamedReturns uses named return values
 23 | func NamedReturns(x, y int) (sum int, product int) {
 24 | 	sum = x + y
 25 | 	product = x * y
 26 | 	return // naked return
 27 | }
 28 | 
 29 | // VariadicFunction accepts variable number of arguments
 30 | func VariadicFunction(prefix string, numbers ...int) string {
 31 | 	result := prefix
 32 | 	for _, num := range numbers {
 33 | 		result += fmt.Sprintf(" %d", num)
 34 | 	}
 35 | 	return result
 36 | }
 37 | 
 38 | // HigherOrderFunction takes a function as parameter
 39 | func HigherOrderFunction(fn func(int) int, value int) int {
 40 | 	return fn(value) + 10
 41 | }
 42 | 
 43 | // FunctionReturningFunction returns a closure
 44 | func FunctionReturningFunction(multiplier int) func(int) int {
 45 | 	return func(x int) int {
 46 | 		return x * multiplier
 47 | 	}
 48 | }
 49 | 
 50 | // RecursiveFunction demonstrates recursion
 51 | func RecursiveFunction(n int) int {
 52 | 	if n <= 1 {
 53 | 		return 1
 54 | 	}
 55 | 	return n * RecursiveFunction(n-1)
 56 | }
 57 | 
 58 | // DeferExample shows defer usage
 59 | func DeferExample() string {
 60 | 	defer fmt.Println("This runs last")
 61 | 	fmt.Println("This runs first")
 62 | 	return "Function complete"
 63 | }
 64 | 
 65 | // PanicRecoverExample demonstrates panic and recover
 66 | func PanicRecoverExample(shouldPanic bool) (result string) {
 67 | 	defer func() {
 68 | 		if r := recover(); r != nil {
 69 | 			result = fmt.Sprintf("Recovered from: %v", r)
 70 | 		}
 71 | 	}()
 72 | 	
 73 | 	if shouldPanic {
 74 | 		panic("something went wrong")
 75 | 	}
 76 | 	
 77 | 	result = "No panic occurred"
 78 | 	return
 79 | }
 80 | 
 81 | // MathHelper calls external package function
 82 | func MathHelper(x float64) float64 {
 83 | 	return math.Sqrt(x)
 84 | }
 85 | 
 86 | // init function runs before main
 87 | func init() {
 88 | 	fmt.Println("Initializing basic_functions package")
 89 | }
 90 | 
 91 | func main() {
 92 | 	fmt.Println(SimpleFunction(5))
 93 | 	sum, diff, _ := MultipleReturns(10, 3)
 94 | 	fmt.Println(sum, diff)
 95 | 	
 96 | 	doubler := FunctionReturningFunction(2)
 97 | 	fmt.Println(doubler(5))
 98 | }
 99 | 
100 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/input-otp.tsx:
--------------------------------------------------------------------------------

```typescript
 1 | import * as React from "react";
 2 | import { OTPInput, OTPInputContext } from "input-otp";
 3 | import { Dot } from "lucide-react";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | 
 7 | const InputOTP = React.forwardRef<React.ElementRef<typeof OTPInput>, React.ComponentPropsWithoutRef<typeof OTPInput>>(
 8 |   ({ className, containerClassName, ...props }, ref) => (
 9 |     <OTPInput
10 |       ref={ref}
11 |       containerClassName={cn("flex items-center gap-2 has-[:disabled]:opacity-50", containerClassName)}
12 |       className={cn("disabled:cursor-not-allowed", className)}
13 |       {...props}
14 |     />
15 |   ),
16 | );
17 | InputOTP.displayName = "InputOTP";
18 | 
19 | const InputOTPGroup = React.forwardRef<React.ElementRef<"div">, React.ComponentPropsWithoutRef<"div">>(
20 |   ({ className, ...props }, ref) => <div ref={ref} className={cn("flex items-center", className)} {...props} />,
21 | );
22 | InputOTPGroup.displayName = "InputOTPGroup";
23 | 
24 | const InputOTPSlot = React.forwardRef<
25 |   React.ElementRef<"div">,
26 |   React.ComponentPropsWithoutRef<"div"> & { index: number }
27 | >(({ index, className, ...props }, ref) => {
28 |   const inputOTPContext = React.useContext(OTPInputContext);
29 |   const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
30 | 
31 |   return (
32 |     <div
33 |       ref={ref}
34 |       className={cn(
35 |         "relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
36 |         isActive && "z-10 ring-2 ring-ring ring-offset-background",
37 |         className,
38 |       )}
39 |       {...props}
40 |     >
41 |       {char}
42 |       {hasFakeCaret && (
43 |         <div className="pointer-events-none absolute inset-0 flex items-center justify-center">
44 |           <div className="animate-caret-blink h-4 w-px bg-foreground duration-1000" />
45 |         </div>
46 |       )}
47 |     </div>
48 |   );
49 | });
50 | InputOTPSlot.displayName = "InputOTPSlot";
51 | 
52 | const InputOTPSeparator = React.forwardRef<React.ElementRef<"div">, React.ComponentPropsWithoutRef<"div">>(
53 |   ({ ...props }, ref) => (
54 |     <div ref={ref} role="separator" {...props}>
55 |       <Dot />
56 |     </div>
57 |   ),
58 | );
59 | InputOTPSeparator.displayName = "InputOTPSeparator";
60 | 
61 | export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
62 | 
```

--------------------------------------------------------------------------------
/docs/docs/core.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Core Concepts
 2 | 
 3 | The core of CodeGraphContext is built upon a few key components that manage the database connection, handle background tasks, and watch for file system changes.
 4 | 
 5 | ## `DatabaseManager`
 6 | 
 7 | The `DatabaseManager` class in `database.py` is a thread-safe singleton responsible for managing the connection to the Neo4j database. This ensures that only one connection pool is created and shared across the application, which is crucial for performance and resource management.
 8 | 
 9 | ### Key Methods
10 | 
11 | -   `get_driver()`: Returns the active Neo4j Driver instance, creating it if it doesn't exist.
12 | -   `close_driver()`: Closes the Neo4j driver connection.
13 | -   `is_connected()`: Checks if the database connection is currently active.
14 | 
15 | ## `JobManager`
16 | 
17 | The `JobManager` class in `jobs.py` handles long-running, background jobs, such as code indexing. It stores job information in memory and provides a thread-safe way to create, update, and retrieve information about these jobs.
18 | 
19 | ### `JobStatus`
20 | 
21 | An enumeration for the possible statuses of a background job:
22 | - `PENDING`
23 | - `RUNNING`
24 | - `COMPLETED`
25 | - `FAILED`
26 | - `CANCELLED`
27 | 
28 | ### `JobInfo`
29 | 
30 | A data class that holds all information about a single background job, including its ID, status, start/end times, progress, and any errors.
31 | 
32 | ### Key Methods
33 | 
34 | -   `create_job()`: Creates a new job with a unique ID.
35 | -   `update_job()`: Updates the information for a specific job.
36 | -   `get_job()`: Retrieves the information for a single job.
37 | -   `list_jobs()`: Returns a list of all jobs.
38 | -   `cleanup_old_jobs()`: Removes old, completed jobs from memory.
39 | 
40 | ## `CodeWatcher`
41 | 
42 | The `CodeWatcher` class in `watcher.py` implements the live file-watching functionality using the `watchdog` library. It observes directories for changes and triggers updates to the code graph.
43 | 
44 | ### `RepositoryEventHandler`
45 | 
46 | A dedicated event handler for a single repository. It performs an initial scan and then uses a debouncing mechanism to efficiently handle file changes, creations, or deletions.
47 | 
48 | ### Key Methods
49 | 
50 | -   `watch_directory()`: Schedules a directory to be watched for changes.
51 | -   `unwatch_directory()`: Stops watching a directory.
52 | -   `list_watched_paths()`: Returns a list of all currently watched directory paths.
53 | -   `start()`: Starts the observer thread.
54 | -   `stop()`: Stops the observer thread gracefully.
```

--------------------------------------------------------------------------------
/organizer/Tools_Exploration.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Tools Exploration
 2 | There are a total of 14 tools available to the users, and here we have attached illustrative demos for each one of them.
 3 | 
 4 | ## find_code Tool
 5 | 
 6 | The `find_code` tool allows users to search for code snippets, functions, classes, and variables within the codebase using natural language queries. This tool helps developers understand and navigate large codebases efficiently.
 7 | 
 8 | Below is an embedded link to a demo video showcasing the usage of the `find_code` tool in action.
 9 | [![Watch the demo video](./images/tool_images/1.png)](https://drive.google.com/file/d/1ojCDIIAwcir9e3jgHHIVC5weZ9nuIQcs/view?usp=drive_link)
10 | 
11 | ---
12 | 
13 | ## watch_directory Tool
14 | 
15 | The `watch_directory` tool allows users to monitor a specified directory for file changes, additions, or deletions in real-time. It helps developers automate workflows such as triggering scripts, updating indexes, or syncing files whenever changes occur in the directory.
16 | 
17 | Below is an embedded link to a demo video showcasing the usage of the `watch_directory` tool in a development environment.
18 | [![Watch the demo](./images/tool_images/2.png)](https://drive.google.com/file/d/1OEjcS2iwwymss99zLidbeBjcblferKBX/view?usp=drive_link) 
19 | 
20 | ---
21 | 
22 | ## analyze_code_relationships Tool
23 | 
24 | The `analyze_code_relationships` tool in CodeGraphContext is designed to let users query and explore the various relationships between code elements in a codebase, represented as a graph in Neo4j. 
25 | 
26 | ### Relationship Types That Can Be Analyzed
27 | 
28 | - **CALLS:** Finds which functions call or are called by a function.
29 | - **CALLED_BY:** Finds all functions that directly or indirectly call a target function (inverse of CALLS).
30 | - **INHERITS_FROM:** Finds class inheritance relationships; which classes inherit from which.
31 | - **CONTAINS:** Shows containment (which classes/functions are inside which modules or files).
32 | - **IMPLEMENTS:** Shows which classes implement an interface.
33 | - **IMPORTS:** Identifies which files or modules import a specific module.
34 | - **DEFINED_IN:** Locates where an entity (function/class) is defined.
35 | - **HAS_ARGUMENT:** Shows relationships from functions to their arguments.
36 | - **DECLARES:** Finds variables declared in functions or classes.
37 | 
38 | Below is an embedded link to a demo video showcasing the usage of the `analyse_code_relationships` tool.
39 | [![Watch the demo](./images/tool_images/3.png)](https://drive.google.com/file/d/154M_lTPbg9_Gj9bd2ErnAVbJArSbcb2M/view?usp=drive_link) 
40 | 
41 | ---
42 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import { ChevronLeft, ChevronRight } from "lucide-react";
 3 | import { DayPicker } from "react-day-picker";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | import { buttonVariants } from "@/components/ui/button";
 7 | 
 8 | export type CalendarProps = React.ComponentProps<typeof DayPicker>;
 9 | 
10 | function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {
11 |   return (
12 |     <DayPicker
13 |       showOutsideDays={showOutsideDays}
14 |       className={cn("p-3", className)}
15 |       classNames={{
16 |         months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
17 |         month: "space-y-4",
18 |         caption: "flex justify-center pt-1 relative items-center",
19 |         caption_label: "text-sm font-medium",
20 |         nav: "space-x-1 flex items-center",
21 |         nav_button: cn(
22 |           buttonVariants({ variant: "outline" }),
23 |           "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
24 |         ),
25 |         nav_button_previous: "absolute left-1",
26 |         nav_button_next: "absolute right-1",
27 |         table: "w-full border-collapse space-y-1",
28 |         head_row: "flex",
29 |         head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
30 |         row: "flex w-full mt-2",
31 |         cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
32 |         day: cn(buttonVariants({ variant: "ghost" }), "h-9 w-9 p-0 font-normal aria-selected:opacity-100"),
33 |         day_range_end: "day-range-end",
34 |         day_selected:
35 |           "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
36 |         day_today: "bg-accent text-accent-foreground",
37 |         day_outside:
38 |           "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
39 |         day_disabled: "text-muted-foreground opacity-50",
40 |         day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
41 |         day_hidden: "invisible",
42 |         ...classNames,
43 |       }}
44 |       components={{
45 |         IconLeft: ({ ..._props }) => <ChevronLeft className="h-4 w-4" />,
46 |         IconRight: ({ ..._props }) => <ChevronRight className="h-4 w-4" />,
47 |       }}
48 |       {...props}
49 |     />
50 |   );
51 | }
52 | Calendar.displayName = "Calendar";
53 | 
54 | export { Calendar };
55 | 
```

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

```rust
  1 | // modules.rs - Demonstrates Rust module system and organization
  2 | 
  3 | // Nested modules
  4 | pub mod geometry {
  5 |     pub mod shapes {
  6 |         pub struct Circle {
  7 |             pub radius: f64,
  8 |         }
  9 | 
 10 |         pub struct Rectangle {
 11 |             pub width: f64,
 12 |             pub height: f64,
 13 |         }
 14 | 
 15 |         impl Circle {
 16 |             pub fn new(radius: f64) -> Self {
 17 |                 Self { radius }
 18 |             }
 19 | 
 20 |             pub fn area(&self) -> f64 {
 21 |                 std::f64::consts::PI * self.radius * self.radius
 22 |             }
 23 |         }
 24 | 
 25 |         impl Rectangle {
 26 |             pub fn new(width: f64, height: f64) -> Self {
 27 |                 Self { width, height }
 28 |             }
 29 | 
 30 |             pub fn area(&self) -> f64 {
 31 |                 self.width * self.height
 32 |             }
 33 |         }
 34 |     }
 35 | 
 36 |     pub mod calculations {
 37 |         use super::shapes::{Circle, Rectangle};
 38 | 
 39 |         pub fn total_area(circle: &Circle, rectangle: &Rectangle) -> f64 {
 40 |             circle.area() + rectangle.area()
 41 |         }
 42 |     }
 43 | }
 44 | 
 45 | // Module with private items
 46 | pub mod data {
 47 |     pub struct PublicStruct {
 48 |         pub public_field: i32,
 49 |         private_field: i32,
 50 |     }
 51 | 
 52 |     impl PublicStruct {
 53 |         pub fn new(public_field: i32, private_field: i32) -> Self {
 54 |             Self {
 55 |                 public_field,
 56 |                 private_field,
 57 |             }
 58 |         }
 59 | 
 60 |         pub fn get_private(&self) -> i32 {
 61 |             self.private_field
 62 |         }
 63 |     }
 64 | 
 65 |     pub fn public_function() -> i32 {
 66 |         private_function() + 10
 67 |     }
 68 | 
 69 |     fn private_function() -> i32 {
 70 |         42
 71 |     }
 72 | }
 73 | 
 74 | // Re-exports
 75 | pub mod utils {
 76 |     pub use super::geometry::shapes::Circle;
 77 |     pub use super::geometry::shapes::Rectangle;
 78 | 
 79 |     pub fn create_default_circle() -> Circle {
 80 |         Circle::new(1.0)
 81 |     }
 82 | }
 83 | 
 84 | // Module with use statements
 85 | pub mod operations {
 86 |     use std::collections::HashMap;
 87 | 
 88 |     pub fn create_map() -> HashMap<String, i32> {
 89 |         let mut map = HashMap::new();
 90 |         map.insert("one".to_string(), 1);
 91 |         map.insert("two".to_string(), 2);
 92 |         map
 93 |     }
 94 | }
 95 | 
 96 | // Glob imports (use with caution)
 97 | pub mod prelude {
 98 |     pub use super::geometry::shapes::*;
 99 |     pub use super::data::*;
100 | }
101 | 
102 | #[cfg(test)]
103 | mod tests {
104 |     use super::*;
105 | 
106 |     #[test]
107 |     fn test_circle_area() {
108 |         let circle = geometry::shapes::Circle::new(5.0);
109 |         let area = circle.area();
110 |         assert!((area - 78.54).abs() < 0.01);
111 |     }
112 | 
113 |     #[test]
114 |     fn test_public_struct() {
115 |         let s = data::PublicStruct::new(10, 20);
116 |         assert_eq!(s.public_field, 10);
117 |         assert_eq!(s.get_private(), 20);
118 |     }
119 | }
120 | 
121 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | import { ButtonProps, buttonVariants } from "@/components/ui/button";
 6 | 
 7 | const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
 8 |   <nav
 9 |     role="navigation"
10 |     aria-label="pagination"
11 |     className={cn("mx-auto flex w-full justify-center", className)}
12 |     {...props}
13 |   />
14 | );
15 | Pagination.displayName = "Pagination";
16 | 
17 | const PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentProps<"ul">>(
18 |   ({ className, ...props }, ref) => (
19 |     <ul ref={ref} className={cn("flex flex-row items-center gap-1", className)} {...props} />
20 |   ),
21 | );
22 | PaginationContent.displayName = "PaginationContent";
23 | 
24 | const PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentProps<"li">>(({ className, ...props }, ref) => (
25 |   <li ref={ref} className={cn("", className)} {...props} />
26 | ));
27 | PaginationItem.displayName = "PaginationItem";
28 | 
29 | type PaginationLinkProps = {
30 |   isActive?: boolean;
31 | } & Pick<ButtonProps, "size"> &
32 |   React.ComponentProps<"a">;
33 | 
34 | const PaginationLink = ({ className, isActive, size = "icon", ...props }: PaginationLinkProps) => (
35 |   <a
36 |     aria-current={isActive ? "page" : undefined}
37 |     className={cn(
38 |       buttonVariants({
39 |         variant: isActive ? "outline" : "ghost",
40 |         size,
41 |       }),
42 |       className,
43 |     )}
44 |     {...props}
45 |   />
46 | );
47 | PaginationLink.displayName = "PaginationLink";
48 | 
49 | const PaginationPrevious = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (
50 |   <PaginationLink aria-label="Go to previous page" size="default" className={cn("gap-1 pl-2.5", className)} {...props}>
51 |     <ChevronLeft className="h-4 w-4" />
52 |     <span>Previous</span>
53 |   </PaginationLink>
54 | );
55 | PaginationPrevious.displayName = "PaginationPrevious";
56 | 
57 | const PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (
58 |   <PaginationLink aria-label="Go to next page" size="default" className={cn("gap-1 pr-2.5", className)} {...props}>
59 |     <span>Next</span>
60 |     <ChevronRight className="h-4 w-4" />
61 |   </PaginationLink>
62 | );
63 | PaginationNext.displayName = "PaginationNext";
64 | 
65 | const PaginationEllipsis = ({ className, ...props }: React.ComponentProps<"span">) => (
66 |   <span aria-hidden className={cn("flex h-9 w-9 items-center justify-center", className)} {...props}>
67 |     <MoreHorizontal className="h-4 w-4" />
68 |     <span className="sr-only">More pages</span>
69 |   </span>
70 | );
71 | PaginationEllipsis.displayName = "PaginationEllipsis";
72 | 
73 | export {
74 |   Pagination,
75 |   PaginationContent,
76 |   PaginationEllipsis,
77 |   PaginationItem,
78 |   PaginationLink,
79 |   PaginationNext,
80 |   PaginationPrevious,
81 | };
82 | 
```

--------------------------------------------------------------------------------
/docs/docs/cli.md:
--------------------------------------------------------------------------------

```markdown
  1 | # CLI Reference
  2 | 
  3 | The CodeGraphContext CLI provides a set of commands to manage the server, index your code, and interact with the code graph.
  4 | 
  5 | ## `cgc setup`
  6 | 
  7 | Runs the interactive setup wizard to configure the server and database connection. This helps users set up a local Docker-based Neo4j instance or connect to a remote one.
  8 | 
  9 | **Usage:**
 10 | ```bash
 11 | cgc setup
 12 | ```
 13 | 
 14 | ## `cgc start`
 15 | 
 16 | Starts the CodeGraphContext MCP server, which listens for JSON-RPC requests from stdin.
 17 | 
 18 | **Usage:**
 19 | ```bash
 20 | cgc start
 21 | ```
 22 | 
 23 | ## `cgc index [PATH]`
 24 | 
 25 | Indexes a directory or file by adding it to the code graph. If no path is provided, it indexes the current directory.
 26 | 
 27 | **Arguments:**
 28 | *   `PATH` (optional): Path to the directory or file to index. Defaults to the current directory.
 29 | 
 30 | **Usage:**
 31 | ```bash
 32 | cgc index /path/to/your/project
 33 | ```
 34 | 
 35 | ### Ignoring Files (`.cgcignore`)
 36 | 
 37 | You can tell CodeGraphContext to ignore specific files and directories by creating a `.cgcignore` file in the root of your project. This file uses the same syntax as `.gitignore`.
 38 | 
 39 | When you run `cgc index`, the command will look for a `.cgcignore` file in the directory being indexed and exclude any files or directories that match the patterns in the file.
 40 | 
 41 | **Example `.cgcignore` file:**
 42 | ```
 43 | # Ignore build artifacts
 44 | /build/
 45 | /dist/
 46 | 
 47 | # Ignore dependencies
 48 | /node_modules/
 49 | /vendor/
 50 | 
 51 | # Ignore logs
 52 | *.log
 53 | ```
 54 | 
 55 | 
 56 | ## `cgc delete <PATH>`
 57 | 
 58 | Deletes a repository from the code graph.
 59 | 
 60 | **Arguments:**
 61 | *   `PATH` (required): Path of the repository to delete from the code graph.
 62 | 
 63 | **Usage:**
 64 | ```bash
 65 | cgc delete /path/to/your/project
 66 | ```
 67 | 
 68 | ## `cgc visualize [QUERY]`
 69 | 
 70 | Generates a URL to visualize a Cypher query in the Neo4j Browser. If no query is provided, a default query will be used.
 71 | 
 72 | **Arguments:**
 73 | *   `QUERY` (optional): The Cypher query to visualize.
 74 | 
 75 | **Usage:**
 76 | ```bash
 77 | cgc visualize "MATCH (n) RETURN n"
 78 | ```
 79 | 
 80 | ## `cgc list_repos`
 81 | 
 82 | Lists all indexed repositories.
 83 | 
 84 | **Usage:**
 85 | ```bash
 86 | cgc list_repos
 87 | ```
 88 | 
 89 | ## `cgc add_package <PACKAGE_NAME>`
 90 | 
 91 | Adds a Python package to the code graph.
 92 | 
 93 | **Arguments:**
 94 | *   `PACKAGE_NAME` (required): Name of the Python package to add.
 95 | 
 96 | **Usage:**
 97 | ```bash
 98 | cgc add_package requests
 99 | ```
100 | 
101 | ## `cgc cypher <QUERY>`
102 | 
103 | Executes a read-only Cypher query.
104 | 
105 | **Arguments:**
106 | *   `QUERY` (required): The read-only Cypher query to execute.
107 | 
108 | **Usage:**
109 | ```bash
110 | cgc cypher "MATCH (n:Function) RETURN n.name"
111 | ```
112 | 
113 | ## `cgc list_mcp_tools`
114 | 
115 | Lists all available tools and their descriptions.
116 | 
117 | **Usage:**
118 | ```bash
119 | cgc list_mcp_tools
120 | ```
121 | 
122 | ## `cgc help`
123 | 
124 | Show the main help message and exit.
125 | 
126 | **Usage:**
127 | ```bash
128 | cgc help
129 | ```
130 | 
131 | ## `cgc version`
132 | 
133 | Show the application version.
134 | 
135 | **Usage:**
136 | ```bash
137 | cgc --version
138 | ```
139 | or
140 | ```bash
141 | cgc version
142 | ```
```

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

```typescript
 1 | import * as React from "react";
 2 | import { Slot } from "@radix-ui/react-slot";
 3 | import { ChevronRight, MoreHorizontal } from "lucide-react";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | 
 7 | const Breadcrumb = React.forwardRef<
 8 |   HTMLElement,
 9 |   React.ComponentPropsWithoutRef<"nav"> & {
10 |     separator?: React.ReactNode;
11 |   }
12 | >(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />);
13 | Breadcrumb.displayName = "Breadcrumb";
14 | 
15 | const BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<"ol">>(
16 |   ({ className, ...props }, ref) => (
17 |     <ol
18 |       ref={ref}
19 |       className={cn(
20 |         "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
21 |         className,
22 |       )}
23 |       {...props}
24 |     />
25 |   ),
26 | );
27 | BreadcrumbList.displayName = "BreadcrumbList";
28 | 
29 | const BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<"li">>(
30 |   ({ className, ...props }, ref) => (
31 |     <li ref={ref} className={cn("inline-flex items-center gap-1.5", className)} {...props} />
32 |   ),
33 | );
34 | BreadcrumbItem.displayName = "BreadcrumbItem";
35 | 
36 | const BreadcrumbLink = React.forwardRef<
37 |   HTMLAnchorElement,
38 |   React.ComponentPropsWithoutRef<"a"> & {
39 |     asChild?: boolean;
40 |   }
41 | >(({ asChild, className, ...props }, ref) => {
42 |   const Comp = asChild ? Slot : "a";
43 | 
44 |   return <Comp ref={ref} className={cn("transition-colors hover:text-foreground", className)} {...props} />;
45 | });
46 | BreadcrumbLink.displayName = "BreadcrumbLink";
47 | 
48 | const BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWithoutRef<"span">>(
49 |   ({ className, ...props }, ref) => (
50 |     <span
51 |       ref={ref}
52 |       role="link"
53 |       aria-disabled="true"
54 |       aria-current="page"
55 |       className={cn("font-normal text-foreground", className)}
56 |       {...props}
57 |     />
58 |   ),
59 | );
60 | BreadcrumbPage.displayName = "BreadcrumbPage";
61 | 
62 | const BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<"li">) => (
63 |   <li role="presentation" aria-hidden="true" className={cn("[&>svg]:size-3.5", className)} {...props}>
64 |     {children ?? <ChevronRight />}
65 |   </li>
66 | );
67 | BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
68 | 
69 | const BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<"span">) => (
70 |   <span
71 |     role="presentation"
72 |     aria-hidden="true"
73 |     className={cn("flex h-9 w-9 items-center justify-center", className)}
74 |     {...props}
75 |   >
76 |     <MoreHorizontal className="h-4 w-4" />
77 |     <span className="sr-only">More</span>
78 |   </span>
79 | );
80 | BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
81 | 
82 | export {
83 |   Breadcrumb,
84 |   BreadcrumbList,
85 |   BreadcrumbItem,
86 |   BreadcrumbLink,
87 |   BreadcrumbPage,
88 |   BreadcrumbSeparator,
89 |   BreadcrumbEllipsis,
90 | };
91 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | 
 3 | import { cn } from "@/lib/utils";
 4 | 
 5 | const Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(
 6 |   ({ className, ...props }, ref) => (
 7 |     <div className="relative w-full overflow-auto">
 8 |       <table ref={ref} className={cn("w-full caption-bottom text-sm", className)} {...props} />
 9 |     </div>
10 |   ),
11 | );
12 | Table.displayName = "Table";
13 | 
14 | const TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(
15 |   ({ className, ...props }, ref) => <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />,
16 | );
17 | TableHeader.displayName = "TableHeader";
18 | 
19 | const TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(
20 |   ({ className, ...props }, ref) => (
21 |     <tbody ref={ref} className={cn("[&_tr:last-child]:border-0", className)} {...props} />
22 |   ),
23 | );
24 | TableBody.displayName = "TableBody";
25 | 
26 | const TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(
27 |   ({ className, ...props }, ref) => (
28 |     <tfoot ref={ref} className={cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)} {...props} />
29 |   ),
30 | );
31 | TableFooter.displayName = "TableFooter";
32 | 
33 | const TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(
34 |   ({ className, ...props }, ref) => (
35 |     <tr
36 |       ref={ref}
37 |       className={cn("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50", className)}
38 |       {...props}
39 |     />
40 |   ),
41 | );
42 | TableRow.displayName = "TableRow";
43 | 
44 | const TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<HTMLTableCellElement>>(
45 |   ({ className, ...props }, ref) => (
46 |     <th
47 |       ref={ref}
48 |       className={cn(
49 |         "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
50 |         className,
51 |       )}
52 |       {...props}
53 |     />
54 |   ),
55 | );
56 | TableHead.displayName = "TableHead";
57 | 
58 | const TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(
59 |   ({ className, ...props }, ref) => (
60 |     <td ref={ref} className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)} {...props} />
61 |   ),
62 | );
63 | TableCell.displayName = "TableCell";
64 | 
65 | const TableCaption = React.forwardRef<HTMLTableCaptionElement, React.HTMLAttributes<HTMLTableCaptionElement>>(
66 |   ({ className, ...props }, ref) => (
67 |     <caption ref={ref} className={cn("mt-4 text-sm text-muted-foreground", className)} {...props} />
68 |   ),
69 | );
70 | TableCaption.displayName = "TableCaption";
71 | 
72 | export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
73 | 
```

--------------------------------------------------------------------------------
/docs/docs/installation.md:
--------------------------------------------------------------------------------

```markdown
 1 | ## 🧩 Installation Guide
 2 | 
 3 | Welcome to **CodeGraphContext**! This guide provides a clear and seamless path to installing and configuring the tool, from prerequisites to launching your server.
 4 | 
 5 | ## ⚙️ Prerequisites
 6 | 
 7 | Ensure the following are installed before you begin:
 8 | 
 9 | - **Python**: Version 3.8 or higher.
10 | - **AI Agentic Coding Tool**: An MCP-compatible AI assistant (e.g., Gemini, Claude) if you plan to use the MCP server.
11 | 
12 | ## 🚀 Getting Started
13 | 
14 | Follow these steps to set up **CodeGraphContext** effortlessly.
15 | 
16 | ### 1. Install from PyPI
17 | 
18 | Install the `codegraphcontext` package directly from PyPI using pip:
19 | 
20 | ```bash
21 | pip install codegraphcontext
22 | ```
23 | 
24 | ### 2. Run the Setup Wizard
25 | 
26 | Launch the interactive setup wizard to configure your Neo4j database and development environment:
27 | 
28 | ```bash
29 | cgc setup
30 | ```
31 | 
32 | The wizard guides you through a series of intuitive prompts to tailor your setup.
33 | 
34 | ## 🧭 "Step-by-Step Guide for the Setup Wizard"
35 | 
36 | When you run `cgc setup`, the wizard offers a thoughtful journey through configuration. Follow these steps to complete your setup with ease:
37 | 
38 | **1. Select Your Database Location**
39 | 
40 | Choose where your Neo4j database will reside:
41 | 
42 | - **Local (Recommended)**: Host Neo4j on your machine for simplicity.  
43 |   - **Docker**: With Docker installed, the wizard crafts a `docker-compose.yml` file and launches a Neo4j container seamlessly.  
44 |   - **Local Binary**: On Debian-based systems (e.g., Ubuntu) or Mac Systems, the wizard installs Neo4j directly with your permission.  
45 | - **Hosted**: Connect to a remote Neo4j instance, such as AuraDB, by providing your database URI, username, and password.  
46 | - **Existing Instance**: For an existing Neo4j server (local or remote), enter its connection credentials.
47 | 
48 | 
49 | **2. Configure Your Development Environment**
50 | 
51 | Integrate CodeGraphContext with your preferred development tool for a harmonious workflow. Select from supported options:
52 | 
53 | - VS Code
54 | - Cursor
55 | - Windsurf
56 | - Claude
57 | - Gemini CLI
58 | - ChatGPT Codex
59 | - Cline
60 | - RooCode
61 | - Amazon Q Developer
62 | 
63 | The wizard automatically updates configuration files to align with your choice.
64 | Upon completing the prompts, the wizard creates two essential files:
65 | 
66 | - **`mcp.json`**: Placed in your working directory, this file configures the MCP server.  
67 | - **`.env`**: Stored securely in `~/.codegraphcontext`, this file safeguards your Neo4j credentials.
68 | 
69 | These files ensure smooth communication between CodeGraphContext, your Neo4j instance, and your AI assistant.
70 | 
71 | ### 3. Start the Server
72 | 
73 | Once configuration is complete, launch the MCP server with:
74 | 
75 | ```bash
76 | cgc start
77 | ```
78 | 
79 | Your **CodeGraphContext** server is now active, ready to power AI-assisted graph queries.
80 | 
81 | ## Next Steps
82 | 
83 | With **CodeGraphContext** installed and configured, you’re ready to explore its AI-powered capabilities. Happy coding ✨!
84 | 
```

--------------------------------------------------------------------------------
/tests/test_typescript_parser.py:
--------------------------------------------------------------------------------

```python
 1 | import pytest
 2 | from pathlib import Path
 3 | import time
 4 | 
 5 | # Import the helper function from the conftest.py file
 6 | from .conftest import call_tool
 7 | 
 8 | # Define the path to the TypeScript sample project
 9 | TS_SAMPLE_PROJECT_PATH = str(Path(__file__).parent / "sample_project_typescript")
10 | 
11 | def wait_for_job_completion(server, job_id, timeout=60):
12 |     """Helper function to wait for an indexing job to complete."""
13 |     start_time = time.time()
14 |     while True:
15 |         if time.time() - start_time > timeout:
16 |             pytest.fail(f"Job {job_id} timed out after {timeout} seconds.")
17 |         
18 |         status_result = call_tool(server, "check_job_status", {"job_id": job_id})
19 |         job_status = status_result.get("job", {}).get("status")
20 |         
21 |         if job_status == "completed":
22 |             break
23 |         elif job_status in ["failed", "cancelled"]:
24 |             pytest.fail(f"Indexing job failed with status: {job_status}")
25 |             
26 |         time.sleep(1)
27 | 
28 | # This test uses the 'server' fixture from conftest.py
29 | # Pytest automatically starts the cgc server and passes in a communication function.
30 | def test_typescript_interfaces_and_types_are_indexed(server):
31 |     """
32 |     This is an integration test. It indexes the TypeScript sample project 
33 |     and then queries the live database to verify the results.
34 |     """
35 |     # ARRANGE: First, delete any previous data for this project to ensure a clean slate.
36 |     call_tool(server, "delete_repository", {"repo_path": TS_SAMPLE_PROJECT_PATH})
37 | 
38 |     # ACT (Part 1): Index the entire TypeScript sample project.
39 |     add_result = call_tool(server, "add_code_to_graph", {"path": TS_SAMPLE_PROJECT_PATH})
40 |     assert add_result.get("success") is True, "Failed to start indexing job"
41 |     job_id = add_result.get("job_id")
42 |     
43 |     # Wait for the indexing to finish.
44 |     wait_for_job_completion(server, job_id)
45 | 
46 |     # ACT (Part 2): Query the database for the interfaces and types we expect to find.
47 |     interface_query = "MATCH (i:Interface {name: 'User'}) RETURN i.name AS name"
48 |     type_alias_query = "MATCH (t:TypeAlias {name: 'UserID'}) RETURN t.name AS name"
49 | 
50 |     interface_result = call_tool(server, "execute_cypher_query", {"cypher_query": interface_query})
51 |     type_alias_result = call_tool(server, "execute_cypher_query", {"cypher_query": type_alias_query})
52 | 
53 |     # ASSERT: Check that the queries returned the expected results from the database.
54 |     assert interface_result.get("success") is True
55 |     assert len(interface_result.get("results", [])) == 1, "Should find exactly one 'User' interface"
56 |     assert interface_result["results"][0]["name"] == "User"
57 | 
58 |     assert type_alias_result.get("success") is True
59 |     assert len(type_alias_result.get("results", [])) == 1, "Should find exactly one 'UserID' type alias"
60 |     assert type_alias_result["results"][0]["name"] == "UserID"
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/functions.js:
--------------------------------------------------------------------------------

```javascript
  1 | /**
  2 |  * Sample JavaScript file demonstrating various function definitions
  3 |  * This file tests function declarations, arrow functions, and method definitions
  4 |  */
  5 | 
  6 | // Regular function declaration
  7 | function regularFunction(param1, param2) {
  8 |     console.log('Regular function called with:', param1, param2);
  9 |     return param1 + param2;
 10 | }
 11 | 
 12 | /**
 13 |  * Function with JSDoc documentation
 14 |  * @param {string} name - The name to greet
 15 |  * @param {number} age - The age of the person
 16 |  * @returns {string} A greeting message
 17 |  */
 18 | function greetPerson(name, age = 25) {
 19 |     return `Hello ${name}, you are ${age} years old!`;
 20 | }
 21 | 
 22 | // Function expression assigned to variable
 23 | const functionExpression = function(x, y) {
 24 |     return x * y;
 25 | };
 26 | 
 27 | // Arrow function with multiple parameters
 28 | const arrowFunction = (a, b, c) => {
 29 |     const result = a + b + c;
 30 |     return result;
 31 | };
 32 | 
 33 | // Arrow function with single parameter (no parentheses)
 34 | const singleParamArrow = x => x * 2;
 35 | 
 36 | // Arrow function with no parameters
 37 | const noParamsArrow = () => {
 38 |     console.log('No parameters arrow function');
 39 |     return 42;
 40 | };
 41 | 
 42 | // Arrow function with rest parameters
 43 | const restParamsFunction = (...args) => {
 44 |     return args.reduce((sum, val) => sum + val, 0);
 45 | };
 46 | 
 47 | // Arrow function with destructuring parameters
 48 | const destructuringParams = ({name, age}) => {
 49 |     return `${name} is ${age} years old`;
 50 | };
 51 | 
 52 | // Higher-order function
 53 | const higherOrderFunction = (callback) => {
 54 |     return function(value) {
 55 |         return callback(value * 2);
 56 |     };
 57 | };
 58 | 
 59 | // Immediately Invoked Function Expression (IIFE)
 60 | const iife = (function() {
 61 |     const privateVar = 'secret';
 62 |     return function() {
 63 |         return privateVar;
 64 |     };
 65 | })();
 66 | 
 67 | // Function with complex parameters
 68 | function complexParams(required, optional = 'default', ...rest) {
 69 |     console.log('Required:', required);
 70 |     console.log('Optional:', optional);
 71 |     console.log('Rest:', rest);
 72 | }
 73 | 
 74 | // Async function
 75 | async function asyncFunction(url) {
 76 |     try {
 77 |         const response = await fetch(url);
 78 |         return await response.json();
 79 |     } catch (error) {
 80 |         console.error('Error:', error);
 81 |         throw error;
 82 |     }
 83 | }
 84 | 
 85 | // Async arrow function
 86 | const asyncArrowFunction = async (data) => {
 87 |     const processed = await processData(data);
 88 |     return processed;
 89 | };
 90 | 
 91 | // Generator function
 92 | function* generatorFunction(start, end) {
 93 |     for (let i = start; i <= end; i++) {
 94 |         yield i;
 95 |     }
 96 | }
 97 | 
 98 | // Function that calls other functions
 99 | function orchestrator() {
100 |     const result1 = regularFunction(5, 3);
101 |     const result2 = functionExpression(4, 6);
102 |     const result3 = arrowFunction(1, 2, 3);
103 |     
104 |     return {
105 |         sum: result1,
106 |         product: result2,
107 |         total: result3
108 |     };
109 | }
110 | 
111 | // Export functions for module usage
112 | export { regularFunction, greetPerson, arrowFunction };
113 | export default orchestrator;
```

--------------------------------------------------------------------------------
/tests/test_tree_sitter/test_file.py:
--------------------------------------------------------------------------------

```python
 1 | import os
 2 | from pathlib import Path
 3 | from src.codegraphcontext.tools.languages.python import PythonTreeSitterParser
 4 | class MockParser:
 5 |     def parse(self, source_bytes):
 6 |         class MockTree:
 7 |             @property
 8 |             def root_node(self):
 9 |                 return None  # You can mock this deeper if needed
10 |         return MockTree()
11 | 
12 | class MockQuery:
13 |     def captures(self, node):
14 |         return []  # Simulate no matches for now
15 | 
16 | class MockLanguage:
17 |     def query(self, query_str):
18 |         return MockQuery()
19 | 
20 | class MockGenericParserWrapper:
21 |     def __init__(self):
22 |         self.language_name = "python"
23 |         self.language = MockLanguage()
24 |         self.parser = MockParser()
25 | 
26 | 
27 | def test_super_resolution():
28 |     # Simulated parsed output from two files
29 |     parsed = [
30 |         {
31 |             "type": "function_call",
32 |             "full_name": "super().greet",
33 |             "class_context": "B",
34 |             "name": "greet"
35 |         },
36 |         {
37 |             "type": "class",
38 |             "name": "B",
39 |             "bases": ["A"]
40 |         },
41 |         {
42 |             "type": "class",
43 |             "name": "A",
44 |             "bases": []
45 |         },
46 |         {
47 |             "type": "function",
48 |             "name": "greet",
49 |             "class_context": "A",
50 |             "file_path": "class_instantiation.py"
51 |         },
52 |         {
53 |             "type": "function",
54 |             "name": "greet",
55 |             "class_context": "Z",
56 |             "file_path": "complex_classes.py"
57 |         }
58 |     ]
59 | 
60 |     # Find the super().greet() call
61 |     target_call = next(
62 |         (item for item in parsed if item.get("type") == "function_call" and item.get("full_name") == "super().greet"),
63 |         None
64 |     )
65 | 
66 |     assert target_call is not None, "super().greet() call not found"
67 | 
68 |     # Simulated resolution logic
69 |     current_class = target_call.get("class_context")
70 |     method_name = target_call.get("name")
71 | 
72 |     class_map = {
73 |         cls["name"]: cls
74 |         for cls in parsed
75 |         if cls.get("type") == "class"
76 |     }
77 | 
78 |     resolved = None
79 |     if current_class and current_class in class_map:
80 |         bases = class_map[current_class].get("bases", [])
81 |         for base in bases:
82 |             base_class = class_map.get(base)
83 |             if base_class:
84 |                 for item in parsed:
85 |                     if (
86 |                         item.get("type") == "function"
87 |                         and item.get("name") == method_name
88 |                         and item.get("class_context") == base
89 |                     ):
90 |                         resolved = f"{item.get('file_path')}:{base}.{method_name}"
91 |                         break
92 |             if resolved:
93 |                 break
94 | 
95 |     assert resolved is not None, "Resolution failed: no matching method found in base classes"
96 |     assert not resolved.endswith("Z.greet"), f"Bug: super().greet() incorrectly resolved to {resolved}"
97 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_go/structs_methods.go:
--------------------------------------------------------------------------------

```go
  1 | // structs_methods.go - Demonstrates Go structs and methods
  2 | package main
  3 | 
  4 | import "fmt"
  5 | 
  6 | // Person represents a basic struct
  7 | type Person struct {
  8 | 	Name string
  9 | 	Age  int
 10 | }
 11 | 
 12 | // Employee extends Person concept with additional fields
 13 | type Employee struct {
 14 | 	Person
 15 | 	ID       int
 16 | 	Position string
 17 | 	Salary   float64
 18 | }
 19 | 
 20 | // AnonymousFieldStruct uses anonymous fields
 21 | type AnonymousFieldStruct struct {
 22 | 	string
 23 | 	int
 24 | 	bool
 25 | }
 26 | 
 27 | // PrivateFieldStruct demonstrates private fields
 28 | type PrivateFieldStruct struct {
 29 | 	PublicField  string
 30 | 	privateField int // unexported field
 31 | }
 32 | 
 33 | // NewPerson is a constructor function
 34 | func NewPerson(name string, age int) *Person {
 35 | 	return &Person{
 36 | 		Name: name,
 37 | 		Age:  age,
 38 | 	}
 39 | }
 40 | 
 41 | // Greet is a value receiver method
 42 | func (p Person) Greet() string {
 43 | 	return fmt.Sprintf("Hello, my name is %s", p.Name)
 44 | }
 45 | 
 46 | // HaveBirthday is a pointer receiver method (modifies struct)
 47 | func (p *Person) HaveBirthday() {
 48 | 	p.Age++
 49 | }
 50 | 
 51 | // IsAdult demonstrates method with return value
 52 | func (p Person) IsAdult() bool {
 53 | 	return p.Age >= 18
 54 | }
 55 | 
 56 | // NewEmployee creates a new employee
 57 | func NewEmployee(name string, age, id int, position string) *Employee {
 58 | 	return &Employee{
 59 | 		Person: Person{
 60 | 			Name: name,
 61 | 			Age:  age,
 62 | 		},
 63 | 		ID:       id,
 64 | 		Position: position,
 65 | 	}
 66 | }
 67 | 
 68 | // GetDetails is a method on embedded struct
 69 | func (e Employee) GetDetails() string {
 70 | 	return fmt.Sprintf("%s (%d) - %s [ID: %d]", e.Name, e.Age, e.Position, e.ID)
 71 | }
 72 | 
 73 | // Promote modifies employee position
 74 | func (e *Employee) Promote(newPosition string, newSalary float64) {
 75 | 	e.Position = newPosition
 76 | 	e.Salary = newSalary
 77 | }
 78 | 
 79 | // GivesRaise calculates new salary
 80 | func (e *Employee) GiveRaise(percentage float64) {
 81 | 	e.Salary = e.Salary * (1 + percentage/100)
 82 | }
 83 | 
 84 | // SetPrivateField demonstrates accessing private fields through methods
 85 | func (p *PrivateFieldStruct) SetPrivateField(val int) {
 86 | 	p.privateField = val
 87 | }
 88 | 
 89 | // GetPrivateField gets the private field value
 90 | func (p *PrivateFieldStruct) GetPrivateField() int {
 91 | 	return p.privateField
 92 | }
 93 | 
 94 | // MethodCallingMethod demonstrates internal method calls
 95 | func (p Person) FullIntroduction() string {
 96 | 	greeting := p.Greet()
 97 | 	ageStatus := "minor"
 98 | 	if p.IsAdult() {
 99 | 		ageStatus = "adult"
100 | 	}
101 | 	return fmt.Sprintf("%s and I am a %s", greeting, ageStatus)
102 | }
103 | 
104 | // CompareAge compares two persons
105 | func (p Person) CompareAge(other Person) string {
106 | 	if p.Age > other.Age {
107 | 		return fmt.Sprintf("%s is older than %s", p.Name, other.Name)
108 | 	} else if p.Age < other.Age {
109 | 		return fmt.Sprintf("%s is younger than %s", p.Name, other.Name)
110 | 	}
111 | 	return fmt.Sprintf("%s and %s are the same age", p.Name, other.Name)
112 | }
113 | 
114 | func demonstrateStructs() {
115 | 	person := NewPerson("Alice", 30)
116 | 	fmt.Println(person.Greet())
117 | 	person.HaveBirthday()
118 | 	
119 | 	employee := NewEmployee("Bob", 25, 1001, "Developer")
120 | 	employee.Promote("Senior Developer", 90000)
121 | 	fmt.Println(employee.GetDetails())
122 | }
123 | 
124 | 
```

--------------------------------------------------------------------------------
/website/package.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |   "name": "vite_react_shadcn_ts",
 3 |   "private": true,
 4 |   "version": "0.0.0",
 5 |   "type": "module",
 6 |   "scripts": {
 7 |     "dev": "vite",
 8 |     "build": "vite build",
 9 |     "build:dev": "vite build --mode development",
10 |     "lint": "eslint .",
11 |     "preview": "vite preview"
12 |   },
13 |   "dependencies": {
14 |     "@hookform/resolvers": "^3.10.0",
15 |     "@radix-ui/react-accordion": "^1.2.11",
16 |     "@radix-ui/react-alert-dialog": "^1.1.14",
17 |     "@radix-ui/react-aspect-ratio": "^1.1.7",
18 |     "@radix-ui/react-avatar": "^1.1.10",
19 |     "@radix-ui/react-checkbox": "^1.3.2",
20 |     "@radix-ui/react-collapsible": "^1.1.11",
21 |     "@radix-ui/react-context-menu": "^2.2.15",
22 |     "@radix-ui/react-dialog": "^1.1.14",
23 |     "@radix-ui/react-dropdown-menu": "^2.1.15",
24 |     "@radix-ui/react-hover-card": "^1.1.14",
25 |     "@radix-ui/react-label": "^2.1.7",
26 |     "@radix-ui/react-menubar": "^1.1.15",
27 |     "@radix-ui/react-navigation-menu": "^1.2.13",
28 |     "@radix-ui/react-popover": "^1.1.14",
29 |     "@radix-ui/react-progress": "^1.1.7",
30 |     "@radix-ui/react-radio-group": "^1.3.7",
31 |     "@radix-ui/react-scroll-area": "^1.2.9",
32 |     "@radix-ui/react-select": "^2.2.5",
33 |     "@radix-ui/react-separator": "^1.1.7",
34 |     "@radix-ui/react-slider": "^1.3.5",
35 |     "@radix-ui/react-slot": "^1.2.3",
36 |     "@radix-ui/react-switch": "^1.2.5",
37 |     "@radix-ui/react-tabs": "^1.1.12",
38 |     "@radix-ui/react-toast": "^1.2.14",
39 |     "@radix-ui/react-toggle": "^1.1.9",
40 |     "@radix-ui/react-toggle-group": "^1.1.10",
41 |     "@radix-ui/react-tooltip": "^1.2.7",
42 |     "@supabase/supabase-js": "^2.75.0",
43 |     "@tanstack/react-query": "^5.83.0",
44 |     "@types/aos": "^3.0.7",
45 |     "aos": "^2.3.4",
46 |     "class-variance-authority": "^0.7.1",
47 |     "clsx": "^2.1.1",
48 |     "cmdk": "^1.1.1",
49 |     "date-fns": "^3.6.0",
50 |     "embla-carousel-react": "^8.6.0",
51 |     "framer-motion": "^12.23.22",
52 |     "input-otp": "^1.4.2",
53 |     "lucide-react": "^0.462.0",
54 |     "next-themes": "^0.3.0",
55 |     "react": "^18.3.1",
56 |     "react-day-picker": "^8.10.1",
57 |     "react-dom": "^18.3.1",
58 |     "react-hook-form": "^7.61.1",
59 |     "react-icons": "^5.5.0",
60 |     "react-intersection-observer": "^9.16.0",
61 |     "react-resizable-panels": "^2.1.9",
62 |     "react-router-dom": "^6.30.1",
63 |     "recharts": "^2.15.4",
64 |     "sonner": "^1.7.4",
65 |     "tailwind-merge": "^2.6.0",
66 |     "tailwindcss-animate": "^1.0.7",
67 |     "vaul": "^0.9.9",
68 |     "zod": "^3.25.76"
69 |   },
70 |   "devDependencies": {
71 |     "@eslint/js": "^9.32.0",
72 |     "@tailwindcss/typography": "^0.5.16",
73 |     "@types/node": "^22.16.5",
74 |     "@types/react": "^18.3.23",
75 |     "@types/react-dom": "^18.3.7",
76 |     "@vitejs/plugin-react-swc": "^3.11.0",
77 |     "autoprefixer": "^10.4.21",
78 |     "eslint": "^9.32.0",
79 |     "eslint-plugin-react-hooks": "^5.2.0",
80 |     "eslint-plugin-react-refresh": "^0.4.20",
81 |     "globals": "^15.15.0",
82 |     "postcss": "^8.5.6",
83 |     "tailwindcss": "^3.4.17",
84 |     "typescript": "^5.8.3",
85 |     "typescript-eslint": "^8.38.0",
86 |     "vite": "^5.4.19"
87 |   }
88 | }
89 | 
```

--------------------------------------------------------------------------------
/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py:
--------------------------------------------------------------------------------

```python
 1 | class CppToolkit:
 2 |     """Handles Neo4j queries for C++ file graph."""
 3 |     def get_cypher_query(query: str) -> str:
 4 |         """
 5 |         Returns a Cypher query string based on the query type requested.
 6 | 
 7 |         Supported query types:
 8 |         - functions
 9 |         - classes
10 |         - imports
11 |         - structs
12 |         - enums
13 |         - unions
14 |         - macros
15 |         - variables
16 |         """
17 | 
18 | 
19 |         query = query.strip().lower()
20 | 
21 |         if query == "functions":
22 |             return """
23 |                 MATCH (f:Function)
24 |                 RETURN f.name AS name, f.file_path AS file_path, 
25 |                     f.line_number AS line_number, f.docstring AS docstring
26 |                 ORDER BY f.file_path, f.line_number
27 |             """
28 | 
29 |         elif query == "classes":
30 |             return """
31 |                 MATCH (c:Class)
32 |                 RETURN c.name AS name, c.file_path AS file_path, 
33 |                     c.line_number AS line_number, c.docstring AS docstring
34 |                 ORDER BY c.file_path, c.line_number
35 |             """
36 | 
37 |         elif query == "imports":
38 |             return """
39 |                 MATCH (f:File)-[i:IMPORTS]->(m:Module)
40 |                 RETURN f.name AS file_name, m.name AS module_name, 
41 |                     m.full_import_name AS full_import_name, m.alias AS alias
42 |                 ORDER BY f.name
43 |             """
44 | 
45 |         elif query == "structs":
46 |             return """
47 |                 MATCH (s:Struct)
48 |                 RETURN s.name AS name, s.file_path AS file_path, 
49 |                     s.line_number AS line_number, s.fields AS fields
50 |                 ORDER BY s.file_path, s.line_number
51 |             """
52 | 
53 |         elif query == "enums":
54 |             return """
55 |                 MATCH (e:Enum)
56 |                 RETURN e.name AS name, e.file_path AS file_path, 
57 |                     e.line_number AS line_number, e.values AS values
58 |                 ORDER BY e.file_path, e.line_number
59 |             """
60 | 
61 |         elif query == "unions":
62 |             return """
63 |                 MATCH (u:Union)
64 |                 RETURN u.name AS name, u.file_path AS file_path, 
65 |                     u.line_number AS line_number, u.members AS members
66 |                 ORDER BY u.file_path, u.line_number
67 |             """
68 | 
69 |         elif query == "macros":
70 |             return """
71 |                 MATCH (m:Macro)
72 |                 RETURN m.name AS name, m.file_path AS file_path, 
73 |                     m.line_number AS line_number, m.value AS value
74 |                 ORDER BY m.file_path, m.line_number
75 |             """
76 | 
77 |         elif query == "variables":
78 |             return """
79 |                 MATCH (v:Variable)
80 |                 RETURN v.name AS name, v.file_path AS file_path, 
81 |                     v.line_number AS line_number, v.value AS value, 
82 |                     v.context AS context
83 |                 ORDER BY v.file_path, v.line_number
84 |             """
85 | 
86 |         else:
87 |             raise ValueError(f"Unsupported query type: {query}")
88 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import { Drawer as DrawerPrimitive } from "vaul";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const Drawer = ({ shouldScaleBackground = true, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
 7 |   <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />
 8 | );
 9 | Drawer.displayName = "Drawer";
10 | 
11 | const DrawerTrigger = DrawerPrimitive.Trigger;
12 | 
13 | const DrawerPortal = DrawerPrimitive.Portal;
14 | 
15 | const DrawerClose = DrawerPrimitive.Close;
16 | 
17 | const DrawerOverlay = React.forwardRef<
18 |   React.ElementRef<typeof DrawerPrimitive.Overlay>,
19 |   React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
20 | >(({ className, ...props }, ref) => (
21 |   <DrawerPrimitive.Overlay ref={ref} className={cn("fixed inset-0 z-50 bg-black/80", className)} {...props} />
22 | ));
23 | DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
24 | 
25 | const DrawerContent = React.forwardRef<
26 |   React.ElementRef<typeof DrawerPrimitive.Content>,
27 |   React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
28 | >(({ className, children, ...props }, ref) => (
29 |   <DrawerPortal>
30 |     <DrawerOverlay />
31 |     <DrawerPrimitive.Content
32 |       ref={ref}
33 |       className={cn(
34 |         "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
35 |         className,
36 |       )}
37 |       {...props}
38 |     >
39 |       <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
40 |       {children}
41 |     </DrawerPrimitive.Content>
42 |   </DrawerPortal>
43 | ));
44 | DrawerContent.displayName = "DrawerContent";
45 | 
46 | const DrawerHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
47 |   <div className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)} {...props} />
48 | );
49 | DrawerHeader.displayName = "DrawerHeader";
50 | 
51 | const DrawerFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
52 |   <div className={cn("mt-auto flex flex-col gap-2 p-4", className)} {...props} />
53 | );
54 | DrawerFooter.displayName = "DrawerFooter";
55 | 
56 | const DrawerTitle = React.forwardRef<
57 |   React.ElementRef<typeof DrawerPrimitive.Title>,
58 |   React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
59 | >(({ className, ...props }, ref) => (
60 |   <DrawerPrimitive.Title
61 |     ref={ref}
62 |     className={cn("text-lg font-semibold leading-none tracking-tight", className)}
63 |     {...props}
64 |   />
65 | ));
66 | DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
67 | 
68 | const DrawerDescription = React.forwardRef<
69 |   React.ElementRef<typeof DrawerPrimitive.Description>,
70 |   React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
71 | >(({ className, ...props }, ref) => (
72 |   <DrawerPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />
73 | ));
74 | DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
75 | 
76 | export {
77 |   Drawer,
78 |   DrawerPortal,
79 |   DrawerOverlay,
80 |   DrawerTrigger,
81 |   DrawerClose,
82 |   DrawerContent,
83 |   DrawerHeader,
84 |   DrawerFooter,
85 |   DrawerTitle,
86 |   DrawerDescription,
87 | };
88 | 
```

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

```typescript
 1 | import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
 2 | import { GitBranch, Eye, Zap, Terminal } from "lucide-react";
 3 | 
 4 | const features = [
 5 |   {
 6 |     icon: GitBranch,
 7 |     title: "Code Indexing",
 8 |     description: "Analyzes code and builds a comprehensive knowledge graph of its components, relationships, and dependencies.",
 9 |     color: "graph-node-1"
10 |   },
11 |   {
12 |     icon: Eye,
13 |     title: "Relationship Analysis",
14 |     description: "Query for callers, callees, class hierarchies, and complex code relationships through natural language.",
15 |     color: "graph-node-2"
16 |   },
17 |   {
18 |     icon: Zap,
19 |     title: "Live Updates",
20 |     description: "Watches local files for changes and automatically updates the graph in real-time as you code.",
21 |     color: "graph-node-3"
22 |   },
23 |   {
24 |     icon: Terminal,
25 |     title: "Interactive Setup",
26 |     description: "User-friendly command-line wizard for easy setup with Neo4j, Docker, or hosted database configurations.",
27 |     color: "graph-node-1"
28 |   }
29 | ];
30 | 
31 | const FeaturesSection = () => {
32 |   return (
33 |     <section className="py-24 px-4">
34 |       <div className="container mx-auto max-w-6xl">
35 |         <div className="text-center mb-16" data-aos="fade-down">
36 |           <h2 className="text-4xl md:text-5xl font-bold mb-6 bg-gradient-to-r from-primary via-primary to-accent bg-clip-text text-transparent">
37 |             Powerful Features
38 |           </h2>
39 |           <p className="text-xl text-muted-foreground max-w-3xl mx-auto">
40 |             Transform your codebase into an intelligent knowledge graph that AI assistants can understand and navigate
41 |           </p>
42 |         </div>
43 |         
44 |         <div className="grid md:grid-cols-2 gap-8">
45 |           {features.map((feature, index) => (
46 |             <div key={index} data-aos="fade-up" data-aos-delay={index * 100}>
47 |               <Card 
48 |                 className="border-border/50 hover:border-primary/30 transition-smooth group hover:shadow-glow animate-float-up dark:bg-gradient-card dark:bg-card/50 dark:border-border/30 dark:hover:border-primary/40 bg-white/95 border-gray-200/50 hover:border-primary/50 shadow-sm h-full"
49 |                 style={{ animationDelay: `${index * 0.1}s` }}
50 |               >
51 |                 <CardHeader>
52 |                   <div className="flex items-center gap-4 mb-4">
53 |                     <div className={`p-3 rounded-xl bg-${feature.color}/10 border border-${feature.color}/20 group-hover:bg-${feature.color}/20 transition-smooth dark:bg-${feature.color}/20 dark:border-${feature.color}/30 bg-${feature.color}/5 border-${feature.color}/15`}>
54 |                       <feature.icon className={`h-6 w-6 text-${feature.color}`} />
55 |                     </div>
56 |                     <CardTitle className="text-xl font-semibold dark:text-foreground text-gray-900">{feature.title}</CardTitle>
57 |                   </div>
58 |                   <CardDescription className="text-base text-muted-foreground leading-relaxed dark:text-muted-foreground text-gray-600">
59 |                     {feature.description}
60 |                   </CardDescription>
61 |                 </CardHeader>
62 |               </Card>
63 |             </div>
64 |           ))}
65 |         </div>
66 |       </div>
67 |     </section>
68 |   );
69 | };
70 | 
71 | export default FeaturesSection;
72 | 
73 | 
```

--------------------------------------------------------------------------------
/website/public/placeholder.svg:
--------------------------------------------------------------------------------

```
1 | <svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1200" fill="none"><rect width="1200" height="1200" fill="#EAEAEA" rx="3"/><g opacity=".5"><g opacity=".5"><path fill="#FAFAFA" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/><path stroke="#C9C9C9" stroke-width="2.418" d="M600.709 736.5c-75.454 0-136.621-61.167-136.621-136.62 0-75.454 61.167-136.621 136.621-136.621 75.453 0 136.62 61.167 136.62 136.621 0 75.453-61.167 136.62-136.62 136.62Z"/></g><path stroke="url(#a)" stroke-width="2.418" d="M0-1.209h553.581" transform="scale(1 -1) rotate(45 1163.11 91.165)"/><path stroke="url(#b)" stroke-width="2.418" d="M404.846 598.671h391.726"/><path stroke="url(#c)" stroke-width="2.418" d="M599.5 795.742V404.017"/><path stroke="url(#d)" stroke-width="2.418" d="m795.717 796.597-391.441-391.44"/><path fill="#fff" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/><g clip-path="url(#e)"><path fill="#666" fill-rule="evenodd" d="M616.426 586.58h-31.434v16.176l3.553-3.554.531-.531h9.068l.074-.074 8.463-8.463h2.565l7.18 7.181V586.58Zm-15.715 14.654 3.698 3.699 1.283 1.282-2.565 2.565-1.282-1.283-5.2-5.199h-6.066l-5.514 5.514-.073.073v2.876a2.418 2.418 0 0 0 2.418 2.418h26.598a2.418 2.418 0 0 0 2.418-2.418v-8.317l-8.463-8.463-7.181 7.181-.071.072Zm-19.347 5.442v4.085a6.045 6.045 0 0 0 6.046 6.045h26.598a6.044 6.044 0 0 0 6.045-6.045v-7.108l1.356-1.355-1.282-1.283-.074-.073v-17.989h-38.689v23.43l-.146.146.146.147Z" clip-rule="evenodd"/></g><path stroke="#C9C9C9" stroke-width="2.418" d="M600.709 656.704c-31.384 0-56.825-25.441-56.825-56.824 0-31.384 25.441-56.825 56.825-56.825 31.383 0 56.824 25.441 56.824 56.825 0 31.383-25.441 56.824-56.824 56.824Z"/></g><defs><linearGradient id="a" x1="554.061" x2="-.48" y1=".083" y2=".087" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="b" x1="796.912" x2="404.507" y1="599.963" y2="599.965" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="c" x1="600.792" x2="600.794" y1="403.677" y2="796.082" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><linearGradient id="d" x1="404.85" x2="796.972" y1="403.903" y2="796.02" gradientUnits="userSpaceOnUse"><stop stop-color="#C9C9C9" stop-opacity="0"/><stop offset=".208" stop-color="#C9C9C9"/><stop offset=".792" stop-color="#C9C9C9"/><stop offset="1" stop-color="#C9C9C9" stop-opacity="0"/></linearGradient><clipPath id="e"><path fill="#fff" d="M581.364 580.535h38.689v38.689h-38.689z"/></clipPath></defs></svg>
```

--------------------------------------------------------------------------------
/docs/docs/architecture.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Architecture Documentation
 2 | 
 3 | This document provides a detailed overview of the architecture of the CodeGraphContext project.
 4 | 
 5 | ## High-Level Overview
 6 | 
 7 | The project is a client-server application designed to analyze and visualize codebases. It consists of:
 8 | 
 9 | *   **A Python backend:** This is the core of the application, responsible for parsing and analyzing code, building a graph representation of the codebase, and exposing this data through an API.
10 | *   **A web-based frontend:** A user interface for interacting with the backend, visualizing the code graph, and exploring the codebase.
11 | *   **A command-line interface (CLI):** For managing the backend and performing analysis from the terminal.
12 | 
13 | ## Backend Architecture
14 | 
15 | The backend is a Python application located in the `src/codegraphcontext` directory.
16 | 
17 | ### Core Components
18 | 
19 | The `src/codegraphcontext/core` directory contains the fundamental building blocks of the backend:
20 | 
21 | *   **Database:** A graph database is used to store the code graph. This allows for efficient querying of relationships between code elements (e.g., function calls, class inheritance).
22 | *   **Jobs:** Asynchronous jobs are used for long-running tasks like indexing a new codebase. This prevents the application from becoming unresponsive.
23 | *   **Watcher:** A file system watcher monitors the codebase for changes and triggers re-indexing, keeping the code graph up-to-date.
24 | 
25 | ### Tools
26 | 
27 | The `src/codegraphcontext/tools` directory contains the logic for code analysis:
28 | 
29 | *   **Graph Builder:** This component is responsible for parsing the code and building the graph representation that is stored in the database.
30 | *   **Code Finder:** Provides functionality to search for specific code elements within the indexed codebase.
31 | *   **Import Extractor:** This tool analyzes the import statements in the code to understand dependencies between modules.
32 | 
33 | ### Server
34 | 
35 | The `src/codegraphcontext/server.py` file implements the API server. It exposes the functionality of the backend to the frontend through a JSON-RPC API.
36 | 
37 | ### CLI
38 | 
39 | The `src/codegraphcontext/cli` directory contains the implementation of the command-line interface. It allows users to:
40 | 
41 | *   Start and stop the backend server.
42 | *   Index new projects.
43 | *   Run analysis tools from the command line.
44 | 
45 | ## Frontend Architecture
46 | 
47 | The frontend is a modern web application located in the `website/` directory.
48 | 
49 | *   **Framework:** It is built using React and TypeScript.
50 | *   **Build Tool:** Vite is used for fast development and building the application.
51 | *   **Component-Based:** The UI is organized into reusable components, located in `website/src/components`. This includes UI elements like buttons and dialogs, as well as higher-level components for different sections of the application.
52 | *   **Styling:** Tailwind CSS is used for styling the application.
53 | 
54 | ## Testing
55 | 
56 | The `tests/` directory contains the test suite for the project.
57 | 
58 | *   **Integration Tests:** `test_cgc_integration.py` contains tests that verify the interaction between different components of the backend.
59 | *   **Unit Tests:** Other files in this directory contain unit tests for specific modules and functions.
60 | *   **Sample Project:** The `tests/sample_project` directory contains a variety of Python files used as input for testing the code analysis tools.
61 | 
```

--------------------------------------------------------------------------------
/organizer/docs.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Architecture Documentation
 2 | 
 3 | This document provides a detailed overview of the architecture of the CodeGraphContext project.
 4 | 
 5 | ## High-Level Overview
 6 | 
 7 | The project is a client-server application designed to analyze and visualize codebases. It consists of:
 8 | 
 9 | *   **A Python backend:** This is the core of the application, responsible for parsing and analyzing code, building a graph representation of the codebase, and exposing this data through an API.
10 | *   **A web-based frontend:** A user interface for interacting with the backend, visualizing the code graph, and exploring the codebase.
11 | *   **A command-line interface (CLI):** For managing the backend and performing analysis from the terminal.
12 | 
13 | ## Backend Architecture
14 | 
15 | The backend is a Python application located in the `src/codegraphcontext` directory.
16 | 
17 | ### Core Components
18 | 
19 | The `src/codegraphcontext/core` directory contains the fundamental building blocks of the backend:
20 | 
21 | *   **Database:** A graph database is used to store the code graph. This allows for efficient querying of relationships between code elements (e.g., function calls, class inheritance).
22 | *   **Jobs:** Asynchronous jobs are used for long-running tasks like indexing a new codebase. This prevents the application from becoming unresponsive.
23 | *   **Watcher:** A file system watcher monitors the codebase for changes and triggers re-indexing, keeping the code graph up-to-date.
24 | 
25 | ### Tools
26 | 
27 | The `src/codegraphcontext/tools` directory contains the logic for code analysis:
28 | 
29 | *   **Graph Builder:** This component is responsible for parsing the code and building the graph representation that is stored in the database.
30 | *   **Code Finder:** Provides functionality to search for specific code elements within the indexed codebase.
31 | *   **Import Extractor:** This tool analyzes the import statements in the code to understand dependencies between modules.
32 | 
33 | ### Server
34 | 
35 | The `src/codegraphcontext/server.py` file implements the API server. It exposes the functionality of the backend to the frontend through a JSON-RPC API.
36 | 
37 | ### CLI
38 | 
39 | The `src/codegraphcontext/cli` directory contains the implementation of the command-line interface. It allows users to:
40 | 
41 | *   Start and stop the backend server.
42 | *   Index new projects.
43 | *   Run analysis tools from the command line.
44 | 
45 | ## Frontend Architecture
46 | 
47 | The frontend is a modern web application located in the `website/` directory.
48 | 
49 | *   **Framework:** It is built using React and TypeScript.
50 | *   **Build Tool:** Vite is used for fast development and building the application.
51 | *   **Component-Based:** The UI is organized into reusable components, located in `website/src/components`. This includes UI elements like buttons and dialogs, as well as higher-level components for different sections of the application.
52 | *   **Styling:** Tailwind CSS is used for styling the application.
53 | 
54 | ## Testing
55 | 
56 | The `tests/` directory contains the test suite for the project.
57 | 
58 | *   **Integration Tests:** `test_cgc_integration.py` contains tests that verify the interaction between different components of the backend.
59 | *   **Unit Tests:** Other files in this directory contain unit tests for specific modules and functions.
60 | *   **Sample Project:** The `tests/sample_project` directory contains a variety of Python files used as input for testing the code analysis tools.
61 | 
```

--------------------------------------------------------------------------------
/website/tailwind.config.ts:
--------------------------------------------------------------------------------

```typescript
  1 | import type { Config } from "tailwindcss";
  2 | 
  3 | export default {
  4 |   darkMode: ["class"],
  5 |   content: ["./pages/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}", "./app/**/*.{ts,tsx}", "./src/**/*.{ts,tsx}"],
  6 |   prefix: "",
  7 |   theme: {
  8 |     container: {
  9 |       center: true,
 10 |       padding: "2rem",
 11 |       screens: {
 12 |         "2xl": "1400px",
 13 |       },
 14 |     },
 15 |     extend: {
 16 |       colors: {
 17 |         border: "hsl(var(--border))",
 18 |         input: "hsl(var(--input))",
 19 |         ring: "hsl(var(--ring))",
 20 |         background: "hsl(var(--background))",
 21 |         foreground: "hsl(var(--foreground))",
 22 |         primary: {
 23 |           DEFAULT: "hsl(var(--primary))",
 24 |           foreground: "hsl(var(--primary-foreground))",
 25 |         },
 26 |         secondary: {
 27 |           DEFAULT: "hsl(var(--secondary))",
 28 |           foreground: "hsl(var(--secondary-foreground))",
 29 |         },
 30 |         destructive: {
 31 |           DEFAULT: "hsl(var(--destructive))",
 32 |           foreground: "hsl(var(--destructive-foreground))",
 33 |         },
 34 |         muted: {
 35 |           DEFAULT: "hsl(var(--muted))",
 36 |           foreground: "hsl(var(--muted-foreground))",
 37 |         },
 38 |         accent: {
 39 |           DEFAULT: "hsl(var(--accent))",
 40 |           foreground: "hsl(var(--accent-foreground))",
 41 |         },
 42 |         popover: {
 43 |           DEFAULT: "hsl(var(--popover))",
 44 |           foreground: "hsl(var(--popover-foreground))",
 45 |         },
 46 |         card: {
 47 |           DEFAULT: "hsl(var(--card))",
 48 |           foreground: "hsl(var(--card-foreground))",
 49 |         },
 50 |         sidebar: {
 51 |           DEFAULT: "hsl(var(--sidebar-background))",
 52 |           foreground: "hsl(var(--sidebar-foreground))",
 53 |           primary: "hsl(var(--sidebar-primary))",
 54 |           "primary-foreground": "hsl(var(--sidebar-primary-foreground))",
 55 |           accent: "hsl(var(--sidebar-accent))",
 56 |           "accent-foreground": "hsl(var(--sidebar-accent-foreground))",
 57 |           border: "hsl(var(--sidebar-border))",
 58 |           ring: "hsl(var(--sidebar-ring))",
 59 |         },
 60 |         // Graph-specific colors
 61 |         "graph-node-1": "hsl(var(--graph-node-1))",
 62 |         "graph-node-2": "hsl(var(--graph-node-2))",
 63 |         "graph-node-3": "hsl(var(--graph-node-3))",
 64 |         "graph-edge": "hsl(var(--graph-edge))",
 65 |       },
 66 |       backgroundImage: {
 67 |         "gradient-primary": "var(--gradient-primary)",
 68 |         "gradient-hero": "var(--gradient-hero)",
 69 |         "gradient-card": "var(--gradient-card)",
 70 |       },
 71 |       boxShadow: {
 72 |         "glow": "var(--shadow-glow)",
 73 |         "card": "var(--shadow-card)",
 74 |       },
 75 |       transitionTimingFunction: {
 76 |         "smooth": "var(--transition-smooth)",
 77 |         "bounce": "var(--transition-bounce)",
 78 |       },
 79 |       borderRadius: {
 80 |         lg: "var(--radius)",
 81 |         md: "calc(var(--radius) - 2px)",
 82 |         sm: "calc(var(--radius) - 4px)",
 83 |       },
 84 |       keyframes: {
 85 |         "accordion-down": {
 86 |           from: {
 87 |             height: "0",
 88 |           },
 89 |           to: {
 90 |             height: "var(--radix-accordion-content-height)",
 91 |           },
 92 |         },
 93 |         "accordion-up": {
 94 |           from: {
 95 |             height: "var(--radix-accordion-content-height)",
 96 |           },
 97 |           to: {
 98 |             height: "0",
 99 |           },
100 |         },
101 |       },
102 |       animation: {
103 |         "accordion-down": "accordion-down 0.2s ease-out",
104 |         "accordion-up": "accordion-up 0.2s ease-out",
105 |       },
106 |     },
107 |   },
108 |   plugins: [require("tailwindcss-animate")],
109 | } satisfies Config;
110 | 
```

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

```python
 1 | import re
 2 | import logging
 3 | #importing all the language toolkits
 4 | from ..tools.query_tool_languages.c_toolkit import CToolkit
 5 | from ..tools.query_tool_languages.cpp_toolkit import CppToolkit
 6 | from ..tools.query_tool_languages.go_toolkit import GoToolkit
 7 | from ..tools.query_tool_languages.java_toolkit import JavaToolkit
 8 | from ..tools.query_tool_languages.javascript_toolkit import JavascriptToolkit
 9 | from ..tools.query_tool_languages.python_toolkit import PythonToolkit
10 | from ..tools.query_tool_languages.ruby_toolkit import RubyToolkit
11 | from ..tools.query_tool_languages.rust_toolkit import RustToolkit
12 | from ..tools.query_tool_languages.typescript_toolkit import TypescriptToolkit
13 | 
14 | from ..core.database import DatabaseManager
15 | from ..utils.debug_log import debug_log
16 | 
17 | logger = logging.getLogger(__name__)
18 | 
19 | class Advanced_language_query:
20 |     """
21 |     Tool implementation for executing a read-only language specific Cypher query.
22 |     
23 |     Important: Includes a safety check to prevent any database modification
24 |     by disallowing keywords like CREATE, MERGE, DELETE, etc.
25 |     """
26 | 
27 |     TOOLKITS = {
28 |         "c": CToolkit,
29 |         "cpp": CppToolkit,
30 |         "go": GoToolkit,
31 |         "java": JavaToolkit,
32 |         "javascript": JavascriptToolkit,
33 |         "python": PythonToolkit,
34 |         "ruby": RubyToolkit,
35 |         "rust": RustToolkit,
36 |         "typescript": TypescriptToolkit
37 |     }
38 |     Supported_queries = {
39 |         "repository": "Repository",
40 |         "directory": "Directory",
41 |         "file": "File",
42 |         "module": "Module",
43 |         "function": "Function",
44 |         "class": "Class",
45 |         "struct": "Struct",
46 |         "enum": "Enum",
47 |         "union": "Union",
48 |         "macro": "Macro",
49 |         "variable": "Variable"
50 |     }
51 | 
52 | 
53 |     def __init__(self, db_manager: DatabaseManager):
54 |         self.db_manager = db_manager
55 | 
56 |     def advanced_language_query(self, language: str, query: str):
57 |         # Validating whether query is valid or not
58 |         query = query.strip().lower()
59 |         if query not in self.Supported_queries:
60 |             raise ValueError(
61 |                 f"Unsupported query type '{query}'"
62 |                 f"Supported: {', '.join(self.Supported_queries.keys())}"
63 |             )
64 |         label = self.Supported_queries[query]
65 | 
66 |         # Set toolkit for the specified language
67 |         language = language.lower()
68 | 
69 |         if language not in self.TOOLKITS:
70 |             raise ValueError(f"Unsupported language: {language}")
71 |         self.toolkit = self.TOOLKITS[language]()
72 | 
73 |         # Getting the language query
74 |         cypher_query = self.toolkit.get_cypher_query(label)
75 |         try:
76 |             debug_log(f"Executing Cypher query: {cypher_query}")
77 |             with self.db_manager.get_driver().session() as session:
78 |                 result = session.run(cypher_query)
79 |                 # Convert results to a list of dictionaries for clean JSON serialization
80 |                 records = [record.data() for record in result]
81 | 
82 |                 return {
83 |                     "success": True, 
84 |                     "language": language,
85 |                     "query": cypher_query,
86 |                     "results": records 
87 |                 }
88 |         except Exception as e:
89 |             debug_log(f"Error executing Cypher query: {str(e)}")
90 |             return {
91 |                 "error": "An unexpected error occurred while executing the query.",
92 |                 "details": str(e)
93 |             }
94 | 
95 | 
96 | 
97 | 
98 | 
```

--------------------------------------------------------------------------------
/docs/docs/use_cases.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Real World Use Cases
 2 | 
 3 | CodeGraphContext can be a powerful ally in your daily coding journey. Here are some real-world scenarios where it can significantly boost your productivity and understanding of a codebase:
 4 | 
 5 | 1.  **Onboarding New Developers:** A new team member can quickly get up to speed by asking questions like:
 6 |     -   "Where is the authentication logic handled?"
 7 |     -   "Show me the main entry point of the application."
 8 | 
 9 | 2.  **Impact Analysis:** Before making a change, assess the potential ripple effects:
10 |     -   "What other parts of the code will be affected if I change the `calculate_total` function?"
11 | 
12 | 3.  **Code Review:** Gain context on pull requests faster:
13 |     -   "Show me the callers of this new function."
14 |     -   "Does this change introduce any new dependencies?"
15 | 
16 | 4.  **Debugging:** Trace execution flows to pinpoint the source of a bug:
17 |     -   "Show me the call chain from `handle_request` to `process_payment`."
18 | 
19 | 5.  **Refactoring:** Identify and plan large-scale code changes:
20 |     -   "Find all instances of the deprecated `OldApiClass`."
21 |     -   "List all functions that use the `urllib` library so I can replace them with `requests`."
22 | 
23 | 6.  **Identifying Code Smells:** Proactively find areas that need improvement:
24 |     -   "Find the 10 most complex functions in the codebase."
25 |     -   "Show me functions with more than 5 arguments."
26 | 
27 | 7.  **Security Audits:** Search for potentially vulnerable code patterns:
28 |     -   "Find all functions that use the `eval` function."
29 |     -   "Show me where raw SQL queries are being executed."
30 | 
31 | 8.  **Automated Documentation:** Use the tool's understanding of the code to generate documentation. (This is what this agent is doing!)
32 | 
33 | 9.  **Dependency Management:** Understand how your project uses its dependencies:
34 |     -   "Which files import the `requests` library?"
35 |     -   "Are there any circular dependencies between modules?"
36 | 
37 | 10. **Cleaning Up Unused Code:** Keep your codebase lean and maintainable:
38 |     -   "Is there any dead or unused code in this project?"
39 | 
40 | 11. **Exploring a Large Codebase:** Navigate large, unfamiliar projects with ease:
41 |     -   "List all the classes in the `core` module."
42 |     -   "What are the top-level functions in the `utils` directory?"
43 | 
44 | 12. **Enforcing Coding Standards:** Check for adherence to team conventions:
45 |     -   "Find all functions that are not decorated with `@log_execution`."
46 |     -   "Show me all public methods that don't have a docstring."
47 | 
48 | 13. **Discovering API Usage:** Find examples of how to use internal or external APIs:
49 |     -   "Show me how other parts of the code use the `UserService`."
50 | 
51 | 14. **Improving Test Coverage:** Identify areas that may lack test coverage:
52 |     -   "Find all functions that are not called by any test files."
53 | 
54 | 15. **Visualizing Code Structure:** Get a bird's-eye view of your project's architecture:
55 |     -   "Generate a graph visualization of the `auth` module and its dependencies."
56 | 
57 | 16. **Learning a New Framework:** Understand how a new framework operates by exploring its source code.
58 | 
59 | 17. **Code Archeology:** Investigate legacy code to understand its history and purpose.
60 | 
61 | 18. **Planning a Migration:** Identify all points of contact when migrating a library or framework:
62 |     -   "Find all the places where the `old_payment_gateway` is used."
63 | 
64 | 19. **Knowledge Sharing:** Use the code graph as a centralized, always-up-to-date knowledge base for your team.
65 | 
66 | 20. **Automated Code Reviews:** Integrate CodeGraphContext into your CI/CD pipeline to automatically flag potential issues in pull requests.
67 | 
```

--------------------------------------------------------------------------------
/docs/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js:
--------------------------------------------------------------------------------

```javascript
1 | !function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&&0!=t||!i)throw"Bad Among initialisation: s:"+r+", substring_i: "+t+", result: "+i;this.s_size=r.length,this.s=this.toCharArray(r),this.substring_i=t,this.result=i,this.method=s},SnowballProgram:function(){var r;return{bra:0,ket:0,limit:0,cursor:0,limit_backward:0,setCurrent:function(t){r=t,this.cursor=0,this.limit=t.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},getCurrent:function(){var t=r;return r=null,t},in_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e>s||e<i)return this.cursor++,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e<i)return this.cursor--,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor+s)!=i.charCodeAt(s))return!1;return this.cursor+=t,!0},eq_s_b:function(t,i){if(this.cursor-this.limit_backward<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor-t+s)!=i.charCodeAt(s))return!1;return this.cursor-=t,!0},find_among:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=l;m<_.s_size;m++){if(n+l==u){f=-1;break}if(f=r.charCodeAt(n+l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=_.s_size-1-l;m>=0;m--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n-_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n-_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}});
```

--------------------------------------------------------------------------------
/src/codegraphcontext/cli/setup_macos.py:
--------------------------------------------------------------------------------

```python
 1 | # src/codegraphcontext/cli/setup_macos.py
 2 | import platform
 3 | import time
 4 | from pathlib import Path
 5 | 
 6 | def _has_brew(run_command, console) -> bool:
 7 |     return run_command(["which", "brew"], console, check=False) is not None
 8 | 
 9 | def _brew_install_neo4j(run_command, console) -> str:
10 |     if run_command(["brew", "install", "neo4j@5"], console, check=False):
11 |         return "neo4j@5"
12 |     if run_command(["brew", "install", "neo4j"], console, check=False):
13 |         return "neo4j"
14 |     return ""
15 | 
16 | def _brew_start(service: str, run_command, console) -> bool:
17 |     return run_command(["brew", "services", "start", service], console, check=False) is not None
18 | 
19 | def _set_initial_password(new_pw: str, run_command, console) -> bool:
20 |     cmd = [
21 |         "cypher-shell",
22 |         "-u", "neo4j",
23 |         "-p", "neo4j",
24 |         f"ALTER CURRENT USER SET PASSWORD FROM 'neo4j' TO '{new_pw}'",
25 |     ]
26 |     return run_command(cmd, console, check=False) is not None
27 | 
28 | def setup_macos_binary(console, prompt, run_command, _generate_mcp_json):
29 |     """Automates Neo4j install & config on macOS via Homebrew."""
30 |     os_name = platform.system()
31 |     console.print(f"Detected Operating System: [bold yellow]{os_name}[/bold yellow]")
32 | 
33 |     if os_name != "Darwin":
34 |         console.print("[yellow]This installer is for macOS only.[/yellow]")
35 |         return
36 | 
37 |     console.print("[bold]Starting automated Neo4j installation for macOS.[/bold]")
38 | 
39 |     if not prompt([{
40 |         "type": "confirm",
41 |         "message": "Proceed with Homebrew-based install of Neo4j?",
42 |         "name": "proceed",
43 |         "default": True
44 |     }]).get("proceed"):
45 |         return
46 | 
47 |     console.print("\n[bold]Step: Checking for Homebrew...[/bold]")
48 |     if not _has_brew(run_command, console):
49 |         console.print(
50 |             "[bold red]Homebrew not found.[/bold red] "
51 |             "Install from [bold blue]https://brew.sh[/bold blue] and re-run this setup."
52 |         )
53 |         return
54 | 
55 |     console.print("\n[bold]Step: Installing Neo4j via Homebrew...[/bold]")
56 |     service = _brew_install_neo4j(run_command, console)
57 |     if not service:
58 |         console.print("[bold red]Failed to install Neo4j via Homebrew.[/bold red]")
59 |         return
60 | 
61 |     console.print(f"\n[bold]Step: Starting Neo4j service ({service})...[/bold]")
62 |     if not _brew_start(service, run_command, console):
63 |         console.print("[bold red]Failed to start Neo4j with brew services.[/bold red]")
64 |         return
65 | 
66 |     while True:
67 |         answers = prompt([
68 |             {"type": "password", "message": "Enter a new password for Neo4j:", "name": "pw"},
69 |             {"type": "password", "message": "Confirm the new password:", "name": "pw2"},
70 |         ]) or {}
71 |         if not answers:
72 |             return
73 |         pw, pw2 = answers.get("pw"), answers.get("pw2")
74 |         if pw and pw == pw2:
75 |             new_password = pw
76 |             break
77 |         console.print("[red]Passwords do not match or are empty. Please try again.[/red]")
78 | 
79 |     console.print("\n[yellow]Waiting 10 seconds for Neo4j to finish starting...[/yellow]")
80 |     time.sleep(10)
81 | 
82 |     console.print("\n[bold]Step: Setting initial password with cypher-shell...[/bold]")
83 |     if not _set_initial_password(new_password, run_command, console):
84 |         console.print(
85 |             "[bold red]Failed to set the initial password.[/bold red]\n"
86 |             "Try manually:\n"
87 |             "  cypher-shell -u neo4j -p neo4j \"ALTER CURRENT USER SET PASSWORD FROM 'neo4j' TO '<your_pw>'\""
88 |         )
89 |         return
90 | 
91 |     creds = {"uri": "neo4j://localhost:7687", "username": "neo4j", "password": new_password}
92 |     _generate_mcp_json(creds)
93 | 
94 |     env_path = Path.home() / ".codegraphcontext" / ".env"
95 |     console.print(f"\n[bold green]All done![/bold green] Neo4j running. Credentials saved to: [bold]{env_path}[/bold]")
96 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as DialogPrimitive from "@radix-ui/react-dialog";
 3 | import { X } from "lucide-react";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | 
 7 | const Dialog = DialogPrimitive.Root;
 8 | 
 9 | const DialogTrigger = DialogPrimitive.Trigger;
10 | 
11 | const DialogPortal = DialogPrimitive.Portal;
12 | 
13 | const DialogClose = DialogPrimitive.Close;
14 | 
15 | const DialogOverlay = React.forwardRef<
16 |   React.ElementRef<typeof DialogPrimitive.Overlay>,
17 |   React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
18 | >(({ className, ...props }, ref) => (
19 |   <DialogPrimitive.Overlay
20 |     ref={ref}
21 |     className={cn(
22 |       "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
23 |       className,
24 |     )}
25 |     {...props}
26 |   />
27 | ));
28 | DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
29 | 
30 | const DialogContent = React.forwardRef<
31 |   React.ElementRef<typeof DialogPrimitive.Content>,
32 |   React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
33 | >(({ className, children, ...props }, ref) => (
34 |   <DialogPortal>
35 |     <DialogOverlay />
36 |     <DialogPrimitive.Content
37 |       ref={ref}
38 |       className={cn(
39 |         "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
40 |         className,
41 |       )}
42 |       {...props}
43 |     >
44 |       {children}
45 |       <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none">
46 |         <X className="h-4 w-4" />
47 |         <span className="sr-only">Close</span>
48 |       </DialogPrimitive.Close>
49 |     </DialogPrimitive.Content>
50 |   </DialogPortal>
51 | ));
52 | DialogContent.displayName = DialogPrimitive.Content.displayName;
53 | 
54 | const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
55 |   <div className={cn("flex flex-col space-y-1.5 text-center sm:text-left", className)} {...props} />
56 | );
57 | DialogHeader.displayName = "DialogHeader";
58 | 
59 | const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
60 |   <div className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} {...props} />
61 | );
62 | DialogFooter.displayName = "DialogFooter";
63 | 
64 | const DialogTitle = React.forwardRef<
65 |   React.ElementRef<typeof DialogPrimitive.Title>,
66 |   React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
67 | >(({ className, ...props }, ref) => (
68 |   <DialogPrimitive.Title
69 |     ref={ref}
70 |     className={cn("text-lg font-semibold leading-none tracking-tight", className)}
71 |     {...props}
72 |   />
73 | ));
74 | DialogTitle.displayName = DialogPrimitive.Title.displayName;
75 | 
76 | const DialogDescription = React.forwardRef<
77 |   React.ElementRef<typeof DialogPrimitive.Description>,
78 |   React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
79 | >(({ className, ...props }, ref) => (
80 |   <DialogPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />
81 | ));
82 | DialogDescription.displayName = DialogPrimitive.Description.displayName;
83 | 
84 | export {
85 |   Dialog,
86 |   DialogPortal,
87 |   DialogOverlay,
88 |   DialogClose,
89 |   DialogTrigger,
90 |   DialogContent,
91 |   DialogHeader,
92 |   DialogFooter,
93 |   DialogTitle,
94 |   DialogDescription,
95 | };
96 | 
```

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

```rust
  1 | // basic_functions.rs - Demonstrates basic Rust function patterns and ownership
  2 | use std::fmt;
  3 | 
  4 | /// Simple function with single return value
  5 | pub fn simple_function(x: i32) -> i32 {
  6 |     x * 2
  7 | }
  8 | 
  9 | /// Multiple return values using tuple
 10 | pub fn multiple_returns(a: i32, b: i32) -> (i32, i32, i32) {
 11 |     (a + b, a - b, a * b)
 12 | }
 13 | 
 14 | /// Function with Result return type for error handling
 15 | pub fn divide(a: i32, b: i32) -> Result<i32, String> {
 16 |     if b == 0 {
 17 |         Err("Division by zero".to_string())
 18 |     } else {
 19 |         Ok(a / b)
 20 |     }
 21 | }
 22 | 
 23 | /// Function with Option return type
 24 | pub fn find_first_even(numbers: &[i32]) -> Option<i32> {
 25 |     for &num in numbers {
 26 |         if num % 2 == 0 {
 27 |             return Some(num);
 28 |         }
 29 |     }
 30 |     None
 31 | }
 32 | 
 33 | /// Function demonstrating ownership transfer
 34 | pub fn take_ownership(s: String) -> usize {
 35 |     let len = s.len();
 36 |     println!("Taking ownership of: {}", s);
 37 |     len
 38 | }
 39 | 
 40 | /// Function borrowing immutably
 41 | pub fn borrow_read(s: &String) -> usize {
 42 |     s.len()
 43 | }
 44 | 
 45 | /// Function borrowing mutably
 46 | pub fn borrow_write(s: &mut String) {
 47 |     s.push_str(" - modified");
 48 | }
 49 | 
 50 | /// Function returning borrowed reference with lifetime
 51 | pub fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
 52 |     if x.len() > y.len() {
 53 |         x
 54 |     } else {
 55 |         y
 56 |     }
 57 | }
 58 | 
 59 | /// Generic function with trait bound
 60 | pub fn print_it<T: fmt::Display>(item: T) {
 61 |     println!("Item: {}", item);
 62 | }
 63 | 
 64 | /// Generic function with multiple trait bounds
 65 | pub fn compare_and_print<T: PartialOrd + fmt::Display>(a: T, b: T) {
 66 |     if a > b {
 67 |         println!("{} is greater than {}", a, b);
 68 |     } else {
 69 |         println!("{} is less than or equal to {}", a, b);
 70 |     }
 71 | }
 72 | 
 73 | /// Higher-order function taking closure
 74 | pub fn apply_twice<F>(f: F, x: i32) -> i32
 75 | where
 76 |     F: Fn(i32) -> i32,
 77 | {
 78 |     f(f(x))
 79 | }
 80 | 
 81 | /// Function returning closure
 82 | pub fn make_multiplier(factor: i32) -> impl Fn(i32) -> i32 {
 83 |     move |x| x * factor
 84 | }
 85 | 
 86 | /// Recursive function
 87 | pub fn factorial(n: u32) -> u32 {
 88 |     match n {
 89 |         0 | 1 => 1,
 90 |         _ => n * factorial(n - 1),
 91 |     }
 92 | }
 93 | 
 94 | /// Fibonacci using recursion
 95 | pub fn fibonacci(n: u32) -> u32 {
 96 |     match n {
 97 |         0 => 0,
 98 |         1 => 1,
 99 |         _ => fibonacci(n - 1) + fibonacci(n - 2),
100 |     }
101 | }
102 | 
103 | /// Function with slice parameter
104 | pub fn sum_slice(numbers: &[i32]) -> i32 {
105 |     numbers.iter().sum()
106 | }
107 | 
108 | /// Function with vector parameter (takes ownership)
109 | pub fn sort_vector(mut vec: Vec<i32>) -> Vec<i32> {
110 |     vec.sort();
111 |     vec
112 | }
113 | 
114 | /// Function demonstrating early return
115 | pub fn validate_age(age: i32) -> Result<i32, String> {
116 |     if age < 0 {
117 |         return Err("Age cannot be negative".to_string());
118 |     }
119 |     if age > 150 {
120 |         return Err("Age is unrealistic".to_string());
121 |     }
122 |     Ok(age)
123 | }
124 | 
125 | /// Function with default parameters using Option
126 | pub fn greet(name: &str, title: Option<&str>) -> String {
127 |     match title {
128 |         Some(t) => format!("Hello, {} {}", t, name),
129 |         None => format!("Hello, {}", name),
130 |     }
131 | }
132 | 
133 | /// Variadic-like function using slice
134 | pub fn sum_all(numbers: &[i32]) -> i32 {
135 |     numbers.iter().sum()
136 | }
137 | 
138 | /// Function with multiple lifetimes
139 | pub fn first_word<'a, 'b>(s1: &'a str, s2: &'b str) -> &'a str {
140 |     s1.split_whitespace().next().unwrap_or(s1)
141 | }
142 | 
143 | /// Associated function (like static method)
144 | pub fn from_string(s: String) -> Result<i32, std::num::ParseIntError> {
145 |     s.parse()
146 | }
147 | 
148 | #[cfg(test)]
149 | mod tests {
150 |     use super::*;
151 | 
152 |     #[test]
153 |     fn test_simple_function() {
154 |         assert_eq!(simple_function(5), 10);
155 |     }
156 | 
157 |     #[test]
158 |     fn test_multiple_returns() {
159 |         let (sum, diff, prod) = multiple_returns(10, 3);
160 |         assert_eq!(sum, 13);
161 |         assert_eq!(diff, 7);
162 |         assert_eq!(prod, 30);
163 |     }
164 | 
165 |     #[test]
166 |     fn test_divide() {
167 |         assert_eq!(divide(10, 2), Ok(5));
168 |         assert!(divide(10, 0).is_err());
169 |     }
170 | 
171 |     #[test]
172 |     fn test_factorial() {
173 |         assert_eq!(factorial(5), 120);
174 |     }
175 | }
176 | 
177 | 
```

--------------------------------------------------------------------------------
/website/src/hooks/use-toast.ts:
--------------------------------------------------------------------------------

```typescript
  1 | import * as React from "react";
  2 | 
  3 | import type { ToastActionElement, ToastProps } from "@/components/ui/toast";
  4 | 
  5 | const TOAST_LIMIT = 1;
  6 | const TOAST_REMOVE_DELAY = 1000000;
  7 | 
  8 | type ToasterToast = ToastProps & {
  9 |   id: string;
 10 |   title?: React.ReactNode;
 11 |   description?: React.ReactNode;
 12 |   action?: ToastActionElement;
 13 | };
 14 | 
 15 | const actionTypes = {
 16 |   ADD_TOAST: "ADD_TOAST",
 17 |   UPDATE_TOAST: "UPDATE_TOAST",
 18 |   DISMISS_TOAST: "DISMISS_TOAST",
 19 |   REMOVE_TOAST: "REMOVE_TOAST",
 20 | } as const;
 21 | 
 22 | let count = 0;
 23 | 
 24 | function genId() {
 25 |   count = (count + 1) % Number.MAX_SAFE_INTEGER;
 26 |   return count.toString();
 27 | }
 28 | 
 29 | type ActionType = typeof actionTypes;
 30 | 
 31 | type Action =
 32 |   | {
 33 |       type: ActionType["ADD_TOAST"];
 34 |       toast: ToasterToast;
 35 |     }
 36 |   | {
 37 |       type: ActionType["UPDATE_TOAST"];
 38 |       toast: Partial<ToasterToast>;
 39 |     }
 40 |   | {
 41 |       type: ActionType["DISMISS_TOAST"];
 42 |       toastId?: ToasterToast["id"];
 43 |     }
 44 |   | {
 45 |       type: ActionType["REMOVE_TOAST"];
 46 |       toastId?: ToasterToast["id"];
 47 |     };
 48 | 
 49 | interface State {
 50 |   toasts: ToasterToast[];
 51 | }
 52 | 
 53 | const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();
 54 | 
 55 | const addToRemoveQueue = (toastId: string) => {
 56 |   if (toastTimeouts.has(toastId)) {
 57 |     return;
 58 |   }
 59 | 
 60 |   const timeout = setTimeout(() => {
 61 |     toastTimeouts.delete(toastId);
 62 |     dispatch({
 63 |       type: "REMOVE_TOAST",
 64 |       toastId: toastId,
 65 |     });
 66 |   }, TOAST_REMOVE_DELAY);
 67 | 
 68 |   toastTimeouts.set(toastId, timeout);
 69 | };
 70 | 
 71 | export const reducer = (state: State, action: Action): State => {
 72 |   switch (action.type) {
 73 |     case "ADD_TOAST":
 74 |       return {
 75 |         ...state,
 76 |         toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
 77 |       };
 78 | 
 79 |     case "UPDATE_TOAST":
 80 |       return {
 81 |         ...state,
 82 |         toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)),
 83 |       };
 84 | 
 85 |     case "DISMISS_TOAST": {
 86 |       const { toastId } = action;
 87 | 
 88 |       // ! Side effects ! - This could be extracted into a dismissToast() action,
 89 |       // but I'll keep it here for simplicity
 90 |       if (toastId) {
 91 |         addToRemoveQueue(toastId);
 92 |       } else {
 93 |         state.toasts.forEach((toast) => {
 94 |           addToRemoveQueue(toast.id);
 95 |         });
 96 |       }
 97 | 
 98 |       return {
 99 |         ...state,
100 |         toasts: state.toasts.map((t) =>
101 |           t.id === toastId || toastId === undefined
102 |             ? {
103 |                 ...t,
104 |                 open: false,
105 |               }
106 |             : t,
107 |         ),
108 |       };
109 |     }
110 |     case "REMOVE_TOAST":
111 |       if (action.toastId === undefined) {
112 |         return {
113 |           ...state,
114 |           toasts: [],
115 |         };
116 |       }
117 |       return {
118 |         ...state,
119 |         toasts: state.toasts.filter((t) => t.id !== action.toastId),
120 |       };
121 |   }
122 | };
123 | 
124 | const listeners: Array<(state: State) => void> = [];
125 | 
126 | let memoryState: State = { toasts: [] };
127 | 
128 | function dispatch(action: Action) {
129 |   memoryState = reducer(memoryState, action);
130 |   listeners.forEach((listener) => {
131 |     listener(memoryState);
132 |   });
133 | }
134 | 
135 | type Toast = Omit<ToasterToast, "id">;
136 | 
137 | function toast({ ...props }: Toast) {
138 |   const id = genId();
139 | 
140 |   const update = (props: ToasterToast) =>
141 |     dispatch({
142 |       type: "UPDATE_TOAST",
143 |       toast: { ...props, id },
144 |     });
145 |   const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
146 | 
147 |   dispatch({
148 |     type: "ADD_TOAST",
149 |     toast: {
150 |       ...props,
151 |       id,
152 |       open: true,
153 |       onOpenChange: (open) => {
154 |         if (!open) dismiss();
155 |       },
156 |     },
157 |   });
158 | 
159 |   return {
160 |     id: id,
161 |     dismiss,
162 |     update,
163 |   };
164 | }
165 | 
166 | function useToast() {
167 |   const [state, setState] = React.useState<State>(memoryState);
168 | 
169 |   React.useEffect(() => {
170 |     listeners.push(setState);
171 |     return () => {
172 |       const index = listeners.indexOf(setState);
173 |       if (index > -1) {
174 |         listeners.splice(index, 1);
175 |       }
176 |     };
177 |   }, [state]);
178 | 
179 |   return {
180 |     ...state,
181 |     toast,
182 |     dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
183 |   };
184 | }
185 | 
186 | export { useToast, toast };
187 | 
```

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

```typescript
  1 | import * as React from "react";
  2 | import * as LabelPrimitive from "@radix-ui/react-label";
  3 | import { Slot } from "@radix-ui/react-slot";
  4 | import { Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext } from "react-hook-form";
  5 | 
  6 | import { cn } from "@/lib/utils";
  7 | import { Label } from "@/components/ui/label";
  8 | 
  9 | const Form = FormProvider;
 10 | 
 11 | type FormFieldContextValue<
 12 |   TFieldValues extends FieldValues = FieldValues,
 13 |   TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
 14 | > = {
 15 |   name: TName;
 16 | };
 17 | 
 18 | const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);
 19 | 
 20 | const FormField = <
 21 |   TFieldValues extends FieldValues = FieldValues,
 22 |   TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
 23 | >({
 24 |   ...props
 25 | }: ControllerProps<TFieldValues, TName>) => {
 26 |   return (
 27 |     <FormFieldContext.Provider value={{ name: props.name }}>
 28 |       <Controller {...props} />
 29 |     </FormFieldContext.Provider>
 30 |   );
 31 | };
 32 | 
 33 | const useFormField = () => {
 34 |   const fieldContext = React.useContext(FormFieldContext);
 35 |   const itemContext = React.useContext(FormItemContext);
 36 |   const { getFieldState, formState } = useFormContext();
 37 | 
 38 |   const fieldState = getFieldState(fieldContext.name, formState);
 39 | 
 40 |   if (!fieldContext) {
 41 |     throw new Error("useFormField should be used within <FormField>");
 42 |   }
 43 | 
 44 |   const { id } = itemContext;
 45 | 
 46 |   return {
 47 |     id,
 48 |     name: fieldContext.name,
 49 |     formItemId: `${id}-form-item`,
 50 |     formDescriptionId: `${id}-form-item-description`,
 51 |     formMessageId: `${id}-form-item-message`,
 52 |     ...fieldState,
 53 |   };
 54 | };
 55 | 
 56 | type FormItemContextValue = {
 57 |   id: string;
 58 | };
 59 | 
 60 | const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);
 61 | 
 62 | const FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
 63 |   ({ className, ...props }, ref) => {
 64 |     const id = React.useId();
 65 | 
 66 |     return (
 67 |       <FormItemContext.Provider value={{ id }}>
 68 |         <div ref={ref} className={cn("space-y-2", className)} {...props} />
 69 |       </FormItemContext.Provider>
 70 |     );
 71 |   },
 72 | );
 73 | FormItem.displayName = "FormItem";
 74 | 
 75 | const FormLabel = React.forwardRef<
 76 |   React.ElementRef<typeof LabelPrimitive.Root>,
 77 |   React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
 78 | >(({ className, ...props }, ref) => {
 79 |   const { error, formItemId } = useFormField();
 80 | 
 81 |   return <Label ref={ref} className={cn(error && "text-destructive", className)} htmlFor={formItemId} {...props} />;
 82 | });
 83 | FormLabel.displayName = "FormLabel";
 84 | 
 85 | const FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(
 86 |   ({ ...props }, ref) => {
 87 |     const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
 88 | 
 89 |     return (
 90 |       <Slot
 91 |         ref={ref}
 92 |         id={formItemId}
 93 |         aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}
 94 |         aria-invalid={!!error}
 95 |         {...props}
 96 |       />
 97 |     );
 98 |   },
 99 | );
100 | FormControl.displayName = "FormControl";
101 | 
102 | const FormDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
103 |   ({ className, ...props }, ref) => {
104 |     const { formDescriptionId } = useFormField();
105 | 
106 |     return <p ref={ref} id={formDescriptionId} className={cn("text-sm text-muted-foreground", className)} {...props} />;
107 |   },
108 | );
109 | FormDescription.displayName = "FormDescription";
110 | 
111 | const FormMessage = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
112 |   ({ className, children, ...props }, ref) => {
113 |     const { error, formMessageId } = useFormField();
114 |     const body = error ? String(error?.message) : children;
115 | 
116 |     if (!body) {
117 |       return null;
118 |     }
119 | 
120 |     return (
121 |       <p ref={ref} id={formMessageId} className={cn("text-sm font-medium text-destructive", className)} {...props}>
122 |         {body}
123 |       </p>
124 |     );
125 |   },
126 | );
127 | FormMessage.displayName = "FormMessage";
128 | 
129 | export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };
130 | 
```
Page 2/18FirstPrevNextLast