#
tokens: 49612/50000 191/367 files (page 1/18)
lines: on (toggle) GitHub
raw markdown copy reset
This is page 1 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/.example.env:
--------------------------------------------------------------------------------

```
1 | VITE_SUPABASE_ANON_KEY="your-anon-key"
2 | VITE_SUPABASE_URL="https://your-project.supabase.co"
```

--------------------------------------------------------------------------------
/website/.gitignore:
--------------------------------------------------------------------------------

```
 1 | # Logs
 2 | logs
 3 | *.log
 4 | npm-debug.log*
 5 | yarn-debug.log*
 6 | yarn-error.log*
 7 | pnpm-debug.log*
 8 | lerna-debug.log*
 9 | 
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 | 
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 | 
```

--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------

```
 1 | # Python
 2 | __pycache__/
 3 | *.pyc
 4 | *.pyo
 5 | *.pyd
 6 | .Python
 7 | env/
 8 | venv/
 9 | .venv/
10 | ./.env
11 | .venv311/
12 | venv311/
13 | docker-compose.yml
14 | 
15 | # PyPI
16 | dist/
17 | build/
18 | *.egg-info/
19 | 
20 | # IDEs and editors
21 | .vscode/
22 | .idea/
23 | *.swp
24 | *.swo
25 | 
26 | # Config
27 | .env
28 | *.db
29 | *.sqlite3
30 | 
31 | # Testing
32 | .pytest_cache/
33 | coverage.xml
34 | htmlcov/
35 | 
36 | # MCP
37 | mcp.json
38 | 
39 | # Docker
40 | docker-compose.yml 
41 | 
42 | # yaml file for amazon Q developer
43 | devfile.yaml 
44 | 
45 | # local scratch
46 | 
47 | javascript.py.bak
48 | src/codegraphcontext/cli/nl.py
49 | *.bak
50 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_misc/README.md:
--------------------------------------------------------------------------------

```markdown
1 | # Sample Misc Project
2 | 
3 | This is a sample project containing miscellaneous files for testing:
4 | - `index.html`: Basic HTML file
5 | - `styles.css`: Simple CSS styling for index.html
6 | - `tables.html`: A simple table to mock Hacktoberfest contributors.
7 | - `tables.css`: Corresponding CSS styling for tables.html
8 | - `README.md`: This file
9 | 
```

--------------------------------------------------------------------------------
/website/README.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Website
 2 | 
 3 | This directory contains the source code for the CodeGraphContext website.
 4 | 
 5 | ## Development
 6 | 
 7 | To run the website locally, follow these steps:
 8 | 
 9 | 1.  Navigate to this directory:
10 |     ```bash
11 |     cd website
12 |     ```
13 | 
14 | 2.  Install the dependencies:
15 |     ```bash
16 |     npm install
17 |     ```
18 | 
19 | 3.  Start the development server:
20 |     ```bash
21 |     npm run dev
22 |     ```
23 | 
24 | ## Build
25 | 
26 | To create a production build of the website, run:
27 | 
28 | ```bash
29 | npm run build
30 | ```
```

--------------------------------------------------------------------------------
/tests/sample_project_java/README.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Java sample project (for `tests/`)
 2 | 
 3 | A tiny, dependency-free Java project (~10 files) used to exercise CodeGraphContext’s indexer.  
 4 | It mirrors the Python sample by showcasing relationships: packages, interface→impl, abstract class,
 5 | enum, generics, exceptions, custom annotation, inner class, lambdas/streams, basic I/O, and a tiny thread.
 6 | 
 7 | ## Layout
 8 | tests/sample_project_java/
 9 | 
10 | ├─ README.md
11 | 
12 | └─ src/com/example/app/
13 | 
14 | ├─ Main.java
15 | 
16 | ├─ model/Role.java
17 | 
18 | ├─ model/User.java
19 | 
20 | ├─ service/GreetingService.java
21 | 
22 | ├─ service/AbstractGreeter.java
23 | 
24 | ├─ service/impl/GreetingServiceImpl.java
25 | 
26 | ├─ util/CollectionUtils.java
27 | 
28 | ├─ util/IOHelper.java
29 | 
30 | ├─ annotations/Logged.java
31 | 
32 | └─ misc/Outer.java
33 | 
34 | 
35 | ## Quick run (no build tool)
36 | From this folder:
37 | ```bash
38 | # compile
39 | find src -name "*.java" > sources.txt
40 | javac -d out @sources.txt
41 | 
42 | # run
43 | java -cp out com.example.app.Main
44 | 
45 | ```
46 | 
47 | 
48 | ## Expected Output
49 | Hello, Priya (ADMIN)
50 | sumSquares=55
51 | firstLine=# java sample project
52 | outer+inner
53 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/README.md:
--------------------------------------------------------------------------------

```markdown
 1 | # C++ Sample Project
 2 | 
 3 | This folder contains a set of C++ files demonstrating major aspects and nuances of C++ programming, inspired by the Python sample_project. Each file is self-contained and focuses on a specific feature or idiom.
 4 | 
 5 | ## Files
 6 | 
 7 | - `control_flow.cpp`: Demonstrates if/else, ternary, and for loop control flow.
 8 | - `classes.cpp`: Shows classes, inheritance, and polymorphism.
 9 | - `templates.cpp`: Covers function templates and specialization.
10 | - `exceptions.cpp`: Exception handling with try/catch blocks.
11 | - `raii_example.cpp`: Resource Acquisition Is Initialization (RAII) pattern.
12 | - `function_chains.cpp`: Function pointers, lambdas, and higher-order functions.
13 | - `namespaces.cpp`: Use of namespaces and the `using` directive.
14 | - `stl_usage.cpp`: STL containers and algorithms (vector, for_each, lambda).
15 | - `file_io.cpp`: Basic file input/output using fstream.
16 | - `edge_cases.cpp`: Edge cases such as empty files and comments only.
17 | 
18 | Each file is intended to be simple, focused, and suitable for code indexing, analysis, or as a reference for C++ language features.
19 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_php/README.md:
--------------------------------------------------------------------------------

```markdown
 1 | # PHP Sample Project
 2 | 
 3 | # PHP Sample Project
 4 | 
 5 | This folder contains a set of PHP files demonstrating major aspects/nuances of PHP programming, inspired by the Python sample_project
 6 | 
 7 | 
 8 | ## Project Structure
 9 | 
10 | sample_project_php/\
11 | ├── classes_objects.php\
12 | ├── database.php\
13 | ├── edgecases.php\
14 | ├── error_handling.php\
15 | ├── file_handling.php \
16 | ├── functions.php\
17 | ├── generators_iterators.php\
18 | ├── globals_superglobals.php\
19 | ├── inheritance.php\
20 | └── interfaces_traits.php
21 | 
22 | ### Features Covered
23 | 
24 | - **Functions & Callbacks**: Anonymous functions, closures, variadics  
25 | - **Object-Oriented PHP**: Classes, inheritance, abstract classes, interfaces, traits  
26 | - **Error Handling**: Custom exceptions, try/catch/finally  
27 | - **File I/O**: Reading and writing files, appending content  
28 | - **Database**: Connecting with PDO, creating tables, inserts, selects  
29 | - **Generators & Iterators**: Yield keyword, implementing Iterator interface  
30 | - **Edge Cases**: Type juggling, array key overwrites, null/empty comparisons  
31 | - **Superglobals**: Accessing $_GET, $_POST, and using $GLOBALS  
32 | 
33 | ### How to Run
34 | 
35 | Make sure you have PHP installed (>= 7.4 recommended) and a database if testing `database.php`.
36 | 
37 | Run individual files from the terminal:
38 | 
39 | ```bash
40 | php functions.php
41 | php classes_objects.php
42 | php inheritance.php
43 | ...etc
44 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/README.md:
--------------------------------------------------------------------------------

```markdown
 1 | # JavaScript Sample Project
 2 | 
 3 | This directory contains comprehensive JavaScript test files to demonstrate and test the enhanced JavaScript support in CodeGraphContext.
 4 | 
 5 | ## Files Overview
 6 | 
 7 | ### `functions.js`
 8 | Demonstrates various function definition patterns:
 9 | - Regular function declarations
10 | - Function expressions
11 | - Arrow functions (with multiple parameters, single parameter, no parameters)
12 | - Functions with default parameters
13 | - Functions with rest parameters
14 | - Functions with destructuring parameters
15 | - Async functions
16 | - Generator functions
17 | - Higher-order functions
18 | - IIFE (Immediately Invoked Function Expressions)
19 | 
20 | ### `classes.js`
21 | Demonstrates class definitions and inheritance:
22 | - Basic class declarations
23 | - Constructor methods
24 | - Instance methods
25 | - Static methods
26 | - Getter and setter methods
27 | - Class inheritance with `extends`
28 | - Method overriding
29 | - Private fields and methods (modern JavaScript)
30 | - Class expressions
31 | - Mixin patterns
32 | 
33 | ### `objects.js`
34 | Demonstrates object methods and prototype assignments:
35 | - Object literal methods (shorthand and traditional syntax)
36 | - Nested object methods
37 | - Prototype method assignments
38 | - Constructor functions with prototype methods
39 | - Module pattern with private/public methods
40 | - Factory functions that create objects with methods
41 | - Methods that call other methods
42 | - Callback and higher-order function patterns
43 | 
44 | ## Expected Function Detections
45 | 
46 | The enhanced JavaScript parser should detect and properly index:
47 | 
48 | 1. **Function Declarations**: `function functionName(params) { ... }`
49 | 2. **Function Expressions**: `const func = function(params) { ... }`
50 | 3. **Arrow Functions**: `const func = (params) => { ... }`
51 | 4. **Single Parameter Arrow**: `const func = param => { ... }`
52 | 5. **Method Definitions**: `methodName(params) { ... }` in classes and objects
53 | 6. **Static Methods**: `static methodName(params) { ... }`
54 | 7. **Prototype Methods**: `Constructor.prototype.method = function(params) { ... }`
55 | 8. **Getter/Setter Methods**: `get property() { ... }` and `set property(value) { ... }`
56 | 
57 | ## Testing Instructions
58 | 
59 | 1. Index this JavaScript sample project using CodeGraphContext
60 | 2. Verify that all function types are detected with correct:
61 |    - Function names
62 |    - Line numbers
63 |    - Parameter lists
64 |    - File paths
65 |    - JSDoc comments (where applicable)
66 | 
67 | ## Expected Neo4j Query Results
68 | 
69 | After indexing, you should be able to run queries like:
70 | 
71 | ```cypher
72 | // Find all JavaScript functions
73 | MATCH (f:Function) 
74 | WHERE f.lang = 'javascript'
75 | RETURN f.name, f.line_number, f.file_path, f.args
76 | 
77 | // Find all JavaScript classes
78 | MATCH (c:Class) 
79 | WHERE c.lang = 'javascript'
80 | RETURN c.name, c.line_number, c.file_path
81 | 
82 | // Find function call relationships
83 | MATCH (caller:Function)-[r:CALLS]->(callee:Function) 
84 | WHERE caller.lang = 'javascript'
85 | RETURN caller.name + " → " + callee.name as CallChain
86 | ```
```

--------------------------------------------------------------------------------
/tests/sample_project_go/README.md:
--------------------------------------------------------------------------------

```markdown
  1 | # Go Sample Project
  2 | 
  3 | This is a comprehensive Go sample project for testing code analysis and indexing tools. It covers major Go language features and patterns.
  4 | 
  5 | ## Files Overview
  6 | 
  7 | ### 1. `basic_functions.go`
  8 | - Basic function definitions
  9 | - Multiple return values
 10 | - Named returns
 11 | - Variadic functions
 12 | - Higher-order functions
 13 | - Closures
 14 | - Recursion
 15 | - Defer, panic, and recover
 16 | - Init functions
 17 | 
 18 | ### 2. `structs_methods.go`
 19 | - Struct definitions
 20 | - Value and pointer receivers
 21 | - Constructor functions
 22 | - Embedded structs
 23 | - Method chaining
 24 | - Private and public fields
 25 | 
 26 | ### 3. `interfaces.go`
 27 | - Interface definitions
 28 | - Interface implementations
 29 | - Interface embedding
 30 | - Type assertions
 31 | - Type switches
 32 | - Empty interfaces
 33 | - Polymorphism
 34 | 
 35 | ### 4. `goroutines_channels.go`
 36 | - Goroutines
 37 | - Channels (buffered and unbuffered)
 38 | - Select statements
 39 | - Worker pools
 40 | - Mutexes (sync.Mutex, sync.RWMutex)
 41 | - Wait groups
 42 | - Pipeline patterns
 43 | - Fan-out/Fan-in patterns
 44 | - Singleton with sync.Once
 45 | 
 46 | ### 5. `error_handling.go`
 47 | - Basic error returns
 48 | - Custom error types
 49 | - Error wrapping (Go 1.13+)
 50 | - Sentinel errors
 51 | - Error type assertions
 52 | - errors.Is and errors.As
 53 | - Validation errors
 54 | - Panic to error conversion
 55 | - Deferred error handling
 56 | 
 57 | ### 6. `generics.go`
 58 | - Generic functions
 59 | - Generic types (Stack, Queue, Cache)
 60 | - Type constraints
 61 | - Generic data structures
 62 | - Map/Filter/Reduce with generics
 63 | - Generic linked lists
 64 | 
 65 | ### 7. `embedded_composition.go`
 66 | - Struct embedding
 67 | - Method promotion
 68 | - Multiple embedding
 69 | - Interface embedding
 70 | - Composition over inheritance
 71 | - Name conflict resolution
 72 | 
 73 | ### 8. `advanced_types.go`
 74 | - Custom types
 75 | - Type aliases
 76 | - Enum patterns
 77 | - Maps and nested maps
 78 | - Slices and 2D slices
 79 | - Arrays
 80 | - Struct tags
 81 | - Anonymous structs
 82 | - Function types
 83 | - Channel types
 84 | - Sortable types (sort.Interface)
 85 | - Bit flags
 86 | 
 87 | ### 9. `packages_imports.go`
 88 | - Standard library imports
 89 | - Aliased imports
 90 | - Blank imports
 91 | - Package initialization (init)
 92 | - Multiple package usage
 93 | - Common stdlib packages: fmt, strings, math, time, os, io, net/http
 94 | 
 95 | ### 10. `util/helpers.go` (subpackage)
 96 | - Utility types and functions
 97 | - String utilities
 98 | - Math utilities
 99 | - Slice utilities
100 | - Validators
101 | - Logger implementation
102 | - Package-level helper functions
103 | 
104 | ## Features Covered
105 | 
106 | - ✅ Basic syntax and functions
107 | - ✅ Structs and methods
108 | - ✅ Interfaces and polymorphism
109 | - ✅ Concurrency (goroutines, channels, sync)
110 | - ✅ Error handling patterns
111 | - ✅ Generics (Go 1.18+)
112 | - ✅ Embedding and composition
113 | - ✅ Advanced types (maps, slices, custom types)
114 | - ✅ Package organization
115 | - ✅ Standard library usage
116 | - ✅ Common patterns and idioms
117 | 
118 | ## Building and Running
119 | 
120 | ```bash
121 | # Initialize module
122 | go mod init github.com/example/sample_project_go
123 | 
124 | # Download dependencies
125 | go mod tidy
126 | 
127 | # Run individual files
128 | go run basic_functions.go
129 | go run structs_methods.go
130 | # ... etc
131 | 
132 | # Build all
133 | go build ./...
134 | 
135 | # Run tests (if tests are added)
136 | go test ./...
137 | ```
138 | 
139 | ## Use Cases
140 | 
141 | This sample project is designed for:
142 | - Testing code analysis tools
143 | - Demonstrating Go best practices
144 | - Code indexing and graph database population
145 | - Understanding Go language features
146 | - Reference implementation for Go patterns
147 | 
148 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_rust/README.md:
--------------------------------------------------------------------------------

```markdown
  1 | # Rust Sample Project
  2 | 
  3 | A comprehensive Rust sample project for testing code analysis and indexing tools. This project covers major Rust language features and patterns.
  4 | 
  5 | ## Project Structure
  6 | 
  7 | ```
  8 | sample_project_rust/
  9 | ├── Cargo.toml
 10 | ├── README.md
 11 | └── src/
 12 |     ├── lib.rs                    # Main library file
 13 |     ├── basic_functions.rs        # Basic Rust patterns
 14 |     ├── structs_enums.rs          # Structs and enums
 15 |     ├── traits.rs                 # Traits and implementations
 16 |     ├── error_handling.rs         # Error handling patterns
 17 |     ├── lifetimes_references.rs   # Lifetimes and borrowing
 18 |     ├── generics.rs               # Generic types and functions
 19 |     ├── concurrency.rs            # Threading and sync
 20 |     ├── iterators_closures.rs     # Iterators and closures
 21 |     ├── smart_pointers.rs         # Smart pointers (Box, Rc, Arc)
 22 |     └── modules.rs                # Module organization
 23 | ```
 24 | 
 25 | ## Files Overview
 26 | 
 27 | ### 1. `basic_functions.rs`
 28 | - Function definitions and patterns
 29 | - Ownership and borrowing
 30 | - Multiple return values (tuples)
 31 | - Result and Option types
 32 | - Lifetimes in functions
 33 | - Generic functions with trait bounds
 34 | - Higher-order functions
 35 | - Closures and function returns
 36 | - Recursion
 37 | 
 38 | ### 2. `structs_enums.rs`
 39 | - Struct definitions (regular, tuple, unit)
 40 | - Methods (impl blocks)
 41 | - Associated functions (constructors)
 42 | - Embedded structs
 43 | - Enums with data
 44 | - Pattern matching
 45 | - Display trait implementations
 46 | 
 47 | ### 3. `traits.rs`
 48 | - Trait definitions
 49 | - Trait implementations
 50 | - Default implementations
 51 | - Associated types and constants
 52 | - Trait bounds and where clauses
 53 | - Trait objects (dyn Trait)
 54 | - Operator overloading
 55 | - Blanket implementations
 56 | 
 57 | ### 4. `error_handling.rs`
 58 | - Custom error types
 59 | - Result and Option handling
 60 | - Error propagation (? operator)
 61 | - Error conversion (From trait)
 62 | - Multiple error types
 63 | - Validation patterns
 64 | - Error combinators (map, and_then)
 65 | 
 66 | ### 5. `lifetimes_references.rs`
 67 | - Explicit lifetime annotations
 68 | - Lifetime elision rules
 69 | - Structs with lifetimes
 70 | - Multiple lifetime parameters
 71 | - Static lifetimes
 72 | - Higher-ranked trait bounds
 73 | - Lifetime bounds
 74 | 
 75 | ### 6. `generics.rs`
 76 | - Generic functions
 77 | - Generic structs and enums
 78 | - Trait bounds on generics
 79 | - Where clauses
 80 | - Associated types
 81 | - Generic collections (Stack, Queue, LinkedList)
 82 | - Const generics
 83 | - Generic closures
 84 | 
 85 | ### 7. `concurrency.rs`
 86 | - Thread spawning
 87 | - Arc and Mutex for shared state
 88 | - RwLock for read-heavy workloads
 89 | - Channels (mpsc)
 90 | - Thread pools
 91 | - Barriers and atomic operations
 92 | - sync::Once for initialization
 93 | - Scoped threads
 94 | 
 95 | ### 8. `iterators_closures.rs`
 96 | - Custom iterators
 97 | - Iterator adapters (map, filter, fold)
 98 | - Closure types (Fn, FnMut, FnOnce)
 99 | - Iterator chains
100 | - Lazy evaluation
101 | - Infinite iterators
102 | - Peekable iterators
103 | 
104 | ### 9. `smart_pointers.rs`
105 | - Box for heap allocation
106 | - Rc for reference counting
107 | - Arc for thread-safe counting
108 | - RefCell for interior mutability
109 | - Weak references
110 | - Cow (Clone on Write)
111 | - Custom smart pointers
112 | - Drop trait
113 | 
114 | ### 10. `modules.rs`
115 | - Module organization
116 | - Nested modules
117 | - Public/private visibility
118 | - Re-exports (pub use)
119 | - Module paths
120 | - Prelude pattern
121 | 
122 | ## Features Covered
123 | 
124 | - ✅ **Ownership & Borrowing**: Move semantics, references, lifetimes
125 | - ✅ **Type System**: Structs, enums, traits, generics
126 | - ✅ **Error Handling**: Result, Option, custom errors
127 | - ✅ **Concurrency**: Threads, Arc, Mutex, channels
128 | - ✅ **Functional Programming**: Iterators, closures, combinators
129 | - ✅ **Smart Pointers**: Box, Rc, Arc, RefCell, Weak
130 | - ✅ **Module System**: Visibility, re-exports, organization
131 | - ✅ **Pattern Matching**: Match expressions, if let
132 | - ✅ **Trait System**: Implementations, bounds, objects
133 | - ✅ **Advanced Features**: Lifetimes, const generics, HRTBs
134 | 
135 | ## Building and Testing
136 | 
137 | ```bash
138 | # Build the project
139 | cargo build
140 | 
141 | # Run tests
142 | cargo test
143 | 
144 | # Check without building
145 | cargo check
146 | 
147 | # Build documentation
148 | cargo doc --open
149 | 
150 | # Run clippy for lints
151 | cargo clippy
152 | ```
153 | 
154 | ## Use Cases
155 | 
156 | This sample project is designed for:
157 | - Testing Rust code analysis tools
158 | - Demonstrating Rust best practices
159 | - Code indexing and graph database population
160 | - Understanding Rust ownership model
161 | - Reference implementation for Rust patterns
162 | - Compiler and IDE testing
163 | 
164 | ## Rust Concepts Demonstrated
165 | 
166 | ### Ownership
167 | - Move semantics
168 | - Borrowing (immutable and mutable)
169 | - References and dereferencing
170 | - Lifetime annotations
171 | 
172 | ### Type System
173 | - Zero-cost abstractions
174 | - Type inference
175 | - Algebraic data types (enums)
176 | - Pattern matching exhaustiveness
177 | 
178 | ### Memory Safety
179 | - No null pointers (Option instead)
180 | - No data races (enforced by type system)
181 | - RAII (Resource Acquisition Is Initialization)
182 | - Automatic memory management
183 | 
184 | ### Concurrency
185 | - Fearless concurrency (no data races)
186 | - Message passing (channels)
187 | - Shared state (Arc + Mutex)
188 | - Thread safety guaranteed by type system
189 | 
190 | ## Integration with CodeGraphContext
191 | 
192 | This project can be used to test:
193 | - Function call resolution across modules
194 | - Trait implementation tracking
195 | - Lifetime relationship analysis
196 | - Generic type instantiation
197 | - Module dependency graphs
198 | - Concurrent code patterns
199 | - Smart pointer usage patterns
200 | 
201 | 
```

--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------

```markdown
  1 | # CodeGraphContext
  2 | 
  3 | <!-- ====== Project stats ====== -->
  4 | [![Stars](https://img.shields.io/github/stars/Shashankss1205/CodeGraphContext?logo=github)](https://github.com/Shashankss1205/CodeGraphContext/stargazers)
  5 | [![Forks](https://img.shields.io/github/forks/Shashankss1205/CodeGraphContext?logo=github)](https://github.com/Shashankss1205/CodeGraphContext/network/members)
  6 | [![Open Issues](https://img.shields.io/github/issues-raw/Shashankss1205/CodeGraphContext?logo=github)](https://github.com/Shashankss1205/CodeGraphContext/issues)
  7 | [![Open PRs](https://img.shields.io/github/issues-pr/Shashankss1205/CodeGraphContext?logo=github)](https://github.com/Shashankss1205/CodeGraphContext/pulls)
  8 | [![Closed PRs](https://img.shields.io/github/issues-pr-closed/Shashankss1205/CodeGraphContext?logo=github&color=lightgrey)](https://github.com/Shashankss1205/CodeGraphContext/pulls?q=is%3Apr+is%3Aclosed)
  9 | [![Contributors](https://img.shields.io/github/contributors/Shashankss1205/CodeGraphContext?logo=github)](https://github.com/Shashankss1205/CodeGraphContext/graphs/contributors)
 10 | [![Languages](https://img.shields.io/github/languages/count/Shashankss1205/CodeGraphContext?logo=github)](https://github.com/Shashankss1205/CodeGraphContext)
 11 | [![Build Status](https://github.com/Shashankss1205/CodeGraphContext/actions/workflows/test.yml/badge.svg)](https://github.com/Shashankss1205/CodeGraphContext/actions/workflows/test.yml)
 12 | [![Build Status](https://github.com/Shashankss1205/CodeGraphContext/actions/workflows/e2e-tests.yml/badge.svg)](https://github.com/Shashankss1205/CodeGraphContext/actions/workflows/e2e-tests.yml)
 13 | [![PyPI version](https://img.shields.io/pypi/v/codegraphcontext?)](https://pypi.org/project/codegraphcontext/)
 14 | [![PyPI downloads](https://img.shields.io/pypi/dm/codegraphcontext?)](https://pypi.org/project/codegraphcontext/)
 15 | [![License](https://img.shields.io/github/license/Shashankss1205/CodeGraphContext?)](LICENSE)
 16 | [![Website](https://img.shields.io/badge/website-up-brightgreen?)](http://codegraphcontext.vercel.app/)
 17 | [![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://shashankss1205.github.io/CodeGraphContext/)
 18 | [![YouTube](https://img.shields.io/badge/YouTube-Watch%20Demo-red?logo=youtube)](https://youtu.be/KYYSdxhg1xU)
 19 | [![Discord](https://img.shields.io/badge/Discord-Join%20Chat-7289da?logo=discord&logoColor=white)](https://discord.gg/dR4QY32uYQ)
 20 | 
 21 | 
 22 | 
 23 | An MCP server that indexes local code into a graph database to provide context to AI assistants.
 24 | 
 25 | ### Indexing a codebase
 26 | ![Indexing using an MCP client](https://github.com/Shashankss1205/CodeGraphContext/blob/main/images/Indexing.gif)
 27 | 
 28 | ### Using the MCP server
 29 | ![Using the MCP server](https://github.com/Shashankss1205/CodeGraphContext/blob/main/images/Usecase.gif)
 30 | 
 31 | ## Project Details
 32 | - **Version:** 0.1.17
 33 | - **Authors:** Shashank Shekhar Singh <[email protected]>
 34 | - **License:** MIT License (See [LICENSE](LICENSE) for details)
 35 | - **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
 36 | 
 37 | ## Star History
 38 | [![Star History Chart](https://api.star-history.com/svg?repos=Shashankss1205/CodeGraphContext&type=Date)](https://www.star-history.com/#Shashankss1205/CodeGraphContext&Date)
 39 | 
 40 | ## Features
 41 | 
 42 | -   **Code Indexing:** Analyzes code and builds a knowledge graph of its components.
 43 | -   **Relationship Analysis:** Query for callers, callees, class hierarchies, call chains and more.
 44 | -   **Live Updates:** Watches local files for changes and automatically updates the graph.
 45 | -   **Interactive Setup:** A user-friendly command-line wizard for easy setup.
 46 | 
 47 | ## Used By
 48 | 
 49 | CodeGraphContext is already being explored by developers and projects for:
 50 | 
 51 | - **Static code analysis in AI assistants**
 52 | - **Graph-based visualization of projects**
 53 | - **Dead code and complexity detection**
 54 | 
 55 | If you’re using CodeGraphContext in your project, feel free to open a PR and add it here! 🚀
 56 | 
 57 | ## Dependencies
 58 | 
 59 | - `neo4j>=5.15.0`
 60 | - `watchdog>=3.0.0`
 61 | - `requests>=2.31.0`
 62 | - `stdlibs>=2023.11.18`
 63 | - `typer[all]>=0.9.0`
 64 | - `rich>=13.7.0`
 65 | - `inquirerpy>=0.3.4`
 66 | - `python-dotenv>=1.0.0`
 67 | - `tree-sitter==0.20.4`
 68 | - `tree-sitter-languages==1.10.2`
 69 | - `pyyaml`
 70 | - `pytest`
 71 | - `nbformat`
 72 | - `nbconvert>=7.16.6`
 73 | - `pathspec>=0.12.1`
 74 | 
 75 | ## Getting Started
 76 | 
 77 | 1.  **Install:** `pip install codegraphcontext`
 78 | 2.  **Setup:** `cgc setup`
 79 |     This interactive command guides you through configuring your Neo4j database connection and automatically setting up your IDE.
 80 | 
 81 |     <details>
 82 |     <summary>⚙️ Troubleshooting: In case, command <code>cgc</code> not found</summary>
 83 | 
 84 |     If you encounter <i>"cgc: command not found"</i> after installation, run the PATH fix script:
 85 |     
 86 |     **Linux/Mac:**
 87 |     ```bash
 88 |     # Download the fix script
 89 |     curl -O https://raw.githubusercontent.com/Shashankss1205/CodeGraphContext/main/scripts/post_install_fix.sh
 90 |     
 91 |     # Make it executable
 92 |     chmod +x post_install_fix.sh
 93 |     
 94 |     # Run the script
 95 |     ./post_install_fix.sh
 96 |     
 97 |     # Restart your terminal or reload shell config
 98 |     source ~/.bashrc  # or ~/.zshrc for zsh users
 99 |     ```
100 |     
101 |     **Windows (PowerShell):**
102 |     ```powershell
103 |     # Download the fix script
104 |     curl -O https://raw.githubusercontent.com/Shashankss1205/CodeGraphContext/main/scripts/post_install_fix.sh
105 |     
106 |     # Run with bash (requires Git Bash or WSL)
107 |     bash post_install_fix.sh
108 |     
109 |     # Restart PowerShell or reload profile
110 |     . $PROFILE
111 |     ``` 
112 |     </details>
113 | 
114 |     
115 |     **Database Configuration:**
116 |     *   **Local Setup (Docker Recommended):** Helps you set up a local Neo4j instance using Docker. Requires Docker and Docker Compose to be installed.
117 |     *   **Local Setup (Linux Binary):** For Debian-based Linux systems (like Ubuntu), `cgc setup` can automate the installation of Neo4j. Requires `sudo` privileges.
118 |     *   **Hosted Setup:** Allows you to connect to an existing remote Neo4j database (e.g., Neo4j AuraDB).
119 | 
120 |     **IDE/CLI Configuration:**
121 |     After setting up your database, the wizard will ask to configure your development environment. It can automatically detect and configure the following:
122 |     *   VS Code
123 |     *   Cursor
124 |     *   Windsurf
125 |     *   Claude
126 |     *   Gemini CLI
127 |     *   ChatGPT Codex
128 |     *   Cline
129 |     *   RooCode
130 |     *   Amazon Q Developer
131 | 
132 |     Upon successful configuration, `cgc setup` will generate and place the necessary configuration files:
133 |     *   It creates an `mcp.json` file in your current directory for reference.
134 |     *   It stores your Neo4j credentials securely in `~/.codegraphcontext/.env`.
135 |     *   It updates the settings file of your chosen IDE/CLI (e.g., `.claude.json` or VS Code's `settings.json`).
136 | 
137 | 3.  **Start:** `cgc start`
138 | 
139 | ## Ignoring Files (`.cgcignore`)
140 | 
141 | 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`.
142 | 
143 | **Example `.cgcignore` file:**
144 | ```
145 | # Ignore build artifacts
146 | /build/
147 | /dist/
148 | 
149 | # Ignore dependencies
150 | /node_modules/
151 | /vendor/
152 | 
153 | # Ignore logs
154 | *.log
155 | ```
156 | 
157 | ## MCP Client Configuration
158 | 
159 | The `cgc setup` command attempts to automatically configure your IDE/CLI. If you choose not to use the automatic setup, or if your tool is not supported, you can configure it manually.
160 | 
161 | Add the following server configuration to your client's settings file (e.g., VS Code's `settings.json` or `.claude.json`):
162 | 
163 | ```json
164 | {
165 |   "mcpServers": {
166 |     "CodeGraphContext": {
167 |       "command": "cgc",
168 |       "args": [
169 |         "start"
170 |       ],
171 |       "env": {
172 |         "NEO4J_URI": "YOUR_NEO4J_URI",
173 |         "NEO4J_USERNAME": "YOUR_NEO4J_USERNAME",
174 |         "NEO4J_PASSWORD": "YOUR_NEO4J_PASSWORD"
175 |       },
176 |       "tools": {
177 |         "alwaysAllow": [
178 |           "add_code_to_graph",
179 |           "add_package_to_graph",
180 |           "check_job_status",
181 |           "list_jobs",
182 |           "find_code",
183 |           "analyze_code_relationships",
184 |           "watch_directory",
185 |           "find_dead_code",
186 |           "execute_cypher_query",
187 |           "calculate_cyclomatic_complexity",
188 |           "find_most_complex_functions",
189 |           "list_indexed_repositories",
190 |           "delete_repository",
191 |           "visualize_graph_query",
192 |           "list_watched_paths",
193 |           "unwatch_directory"
194 |         ],
195 |         "disabled": false
196 |       },
197 |       "disabled": false,
198 |       "alwaysAllow": []
199 |     }
200 |   }
201 | }
202 | ```
203 | 
204 | ## Natural Language Interaction Examples
205 | 
206 | Once the server is running, you can interact with it through your AI assistant using plain English. Here are some examples of what you can say:
207 | 
208 | ### Indexing and Watching Files
209 | 
210 | -   **To index a new project:**
211 |     -   "Please index the code in the `/path/to/my-project` directory."
212 |     OR
213 |     -   "Add the project at `~/dev/my-other-project` to the code graph."
214 | 
215 | 
216 | -   **To start watching a directory for live changes:**
217 |     -   "Watch the `/path/to/my-active-project` directory for changes."
218 |     OR
219 |     -   "Keep the code graph updated for the project I'm working on at `~/dev/main-app`."
220 | 
221 |     When you ask to watch a directory, the system performs two actions at once:
222 |     1.  It kicks off a full scan to index all the code in that directory. This process runs in the background, and you'll receive a `job_id` to track its progress.
223 |     2.  It begins watching the directory for any file changes to keep the graph updated in real-time.
224 | 
225 |     This means you can start by simply telling the system to watch a directory, and it will handle both the initial indexing and the continuous updates automatically.
226 | 
227 | ### Querying and Understanding Code
228 | 
229 | -   **Finding where code is defined:**
230 |     -   "Where is the `process_payment` function?"
231 |     -   "Find the `User` class for me."
232 |     -   "Show me any code related to 'database connection'."
233 | 
234 | -   **Analyzing relationships and impact:**
235 |     -   "What other functions call the `get_user_by_id` function?"
236 |     -   "If I change the `calculate_tax` function, what other parts of the code will be affected?"
237 |     -   "Show me the inheritance hierarchy for the `BaseController` class."
238 |     -   "What methods does the `Order` class have?"
239 | 
240 | -   **Exploring dependencies:**
241 |     -   "Which files import the `requests` library?"
242 |     -   "Find all implementations of the `render` method."
243 | 
244 | -   **Advanced Call Chain and Dependency Tracking (Spanning Hundreds of Files):**
245 |     The CodeGraphContext excels at tracing complex execution flows and dependencies across vast codebases. Leveraging the power of graph databases, it can identify direct and indirect callers and callees, even when a function is called through multiple layers of abstraction or across numerous files. This is invaluable for:
246 |     -   **Impact Analysis:** Understand the full ripple effect of a change to a core function.
247 |     -   **Debugging:** Trace the path of execution from an entry point to a specific bug.
248 |     -   **Code Comprehension:** Grasp how different parts of a large system interact.
249 | 
250 |     -   "Show me the full call chain from the `main` function to `process_data`."
251 |     -   "Find all functions that directly or indirectly call `validate_input`."
252 |     -   "What are all the functions that `initialize_system` eventually calls?"
253 |     -   "Trace the dependencies of the `DatabaseManager` module."
254 | 
255 | -   **Code Quality and Maintenance:**
256 |     -   "Is there any dead or unused code in this project?"
257 |     -   "Calculate the cyclomatic complexity of the `process_data` function in `src/utils.py`."
258 |     -   "Find the 5 most complex functions in the codebase."
259 | 
260 | -   **Repository Management:**
261 |     -   "List all currently indexed repositories."
262 |     -   "Delete the indexed repository at `/path/to/old-project`."
263 | 
264 | ## Contributing
265 | 
266 | Contributions are welcome! 🎉  
267 | Please see our [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
268 | If you have ideas for new features, integrations, or improvements, open an [issue](https://github.com/Shashankss1205/CodeGraphContext/issues) or submit a Pull Request.
269 | 
270 | Join discussions and help shape the future of CodeGraphContext.
271 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_typescript/README.md:
--------------------------------------------------------------------------------

```markdown
  1 | # TypeScript Sample Project
  2 | 
  3 | A comprehensive TypeScript sample project for testing code analysis and indexing tools. This project covers major TypeScript language features, patterns, and best practices across approximately 10 files.
  4 | 
  5 | ## Project Overview
  6 | 
  7 | This sample project is designed to demonstrate and test TypeScript's capabilities for:
  8 | - Code analysis tools
  9 | - Code indexing systems
 10 | - Graph database population
 11 | - Understanding TypeScript language features
 12 | - Reference implementation for TypeScript patterns
 13 | 
 14 | ## Files Overview
 15 | 
 16 | ### 1. `src/types-interfaces.ts`
 17 | Demonstrates TypeScript's core type system including:
 18 | - ✅ **Primitive Types**: string, number, boolean, null, undefined, symbol, bigint
 19 | - ✅ **Array and Tuple Types**: typed arrays, named tuples, readonly arrays
 20 | - ✅ **Object Types**: inline object types, optional properties
 21 | - ✅ **Interface Definitions**: basic interfaces, inheritance, index signatures
 22 | - ✅ **Type Aliases**: union types, intersection types, generic aliases
 23 | - ✅ **Union Types**: discriminated unions, type guards, exhaustive checks
 24 | - ✅ **Intersection Types**: combining types, complex compositions
 25 | - ✅ **Conditional Types**: type-level conditionals, infer keyword
 26 | - ✅ **Template Literal Types**: string manipulation at type level
 27 | - ✅ **Utility Types**: Pick, Omit, Partial, Required, etc.
 28 | 
 29 | ### 2. `src/classes-inheritance.ts`
 30 | Covers object-oriented programming features:
 31 | - ✅ **Basic Classes**: constructors, properties, methods
 32 | - ✅ **Access Modifiers**: public, private, protected, readonly
 33 | - ✅ **Static Members**: static properties and methods
 34 | - ✅ **Inheritance**: extends keyword, super calls, method overriding
 35 | - ✅ **Abstract Classes**: abstract methods and properties
 36 | - ✅ **Interface Implementation**: implementing multiple interfaces
 37 | - ✅ **Generic Classes**: class-level generics, constraints
 38 | - ✅ **Design Patterns**: Singleton, Factory, Mixin patterns
 39 | - ✅ **Getters and Setters**: property accessors
 40 | - ✅ **Method Overloads**: multiple function signatures
 41 | 
 42 | ### 3. `src/functions-generics.ts`
 43 | Explores function types and generic programming:
 44 | - ✅ **Function Types**: basic functions, arrow functions, optional parameters
 45 | - ✅ **Function Overloads**: multiple signatures for same function
 46 | - ✅ **Generic Functions**: type parameters, constraints, inference
 47 | - ✅ **Higher-Order Functions**: functions returning functions
 48 | - ✅ **Utility Functions**: memoization, debouncing, throttling
 49 | - ✅ **Generic Constraints**: extends keyword, keyof operator
 50 | - ✅ **Generic Data Structures**: Stack, Queue, PriorityQueue
 51 | - ✅ **Function Composition**: pipe, compose patterns
 52 | - ✅ **Currying**: partial application, function currying
 53 | 
 54 | ### 4. `src/async-promises.ts`
 55 | Demonstrates asynchronous programming patterns:
 56 | - ✅ **Promises**: creating, chaining, error handling
 57 | - ✅ **Async/Await**: modern async syntax, error handling
 58 | - ✅ **Promise Combinators**: Promise.all, Promise.race, custom combinators
 59 | - ✅ **Async Iterators**: async generators, for-await-of
 60 | - ✅ **Observable Patterns**: EventEmitter, subscription management
 61 | - ✅ **Concurrency Control**: Promise pools, semaphores, rate limiting
 62 | - ✅ **Async Cache**: TTL-based caching, async operations
 63 | - ✅ **Error Handling**: retry patterns, timeout handling
 64 | - ✅ **Stream Processing**: batch processing, async pipelines
 65 | 
 66 | ### 5. `src/decorators-metadata.ts`
 67 | Showcases TypeScript decorator system:
 68 | - ✅ **Class Decorators**: @Entity, @Injectable, @Component
 69 | - ✅ **Method Decorators**: @Log, @Cache, @Validate, @Retry
 70 | - ✅ **Property Decorators**: @Column, @Required, @SerializableProperty
 71 | - ✅ **Parameter Decorators**: @Inject, @ValidateParam
 72 | - ✅ **Metadata Reflection**: using reflect-metadata
 73 | - ✅ **Decorator Factories**: parameterized decorators
 74 | - ✅ **Custom Decorators**: role-based access, validation
 75 | - ✅ **Metadata Readers**: utility classes for metadata access
 76 | 
 77 | ### 6. `src/modules-namespaces.ts`
 78 | Covers module system and organization:
 79 | - ✅ **Basic Exports**: named exports, default exports, re-exports
 80 | - ✅ **Namespace Declarations**: nested namespaces, namespace merging
 81 | - ✅ **Module Augmentation**: extending existing types globally
 82 | - ✅ **Ambient Declarations**: declaring external libraries
 83 | - ✅ **Dynamic Imports**: code splitting, conditional loading
 84 | - ✅ **Module Factories**: configurable modules, dependency injection
 85 | - ✅ **Barrel Exports**: index files, re-export patterns
 86 | - ✅ **Triple-Slash Directives**: type references, library references
 87 | 
 88 | ### 7. `src/advanced-types.ts`
 89 | Advanced type system features:
 90 | - ✅ **Mapped Types**: transforming object types, key transformation
 91 | - ✅ **Conditional Types**: type-level logic, distributive conditionals
 92 | - ✅ **Template Literal Types**: string manipulation, path building
 93 | - ✅ **Recursive Types**: deeply nested type operations
 94 | - ✅ **Branded Types**: nominal typing patterns, type safety
 95 | - ✅ **Tuple Utilities**: head, tail, reverse operations
 96 | - ✅ **String Manipulation**: uppercase, lowercase, split, join
 97 | - ✅ **Type Predicates**: union detection, type guards
 98 | - ✅ **Higher-Kinded Types**: functor simulation, HKT patterns
 99 | 
100 | ### 8. `src/error-validation.ts`
101 | Error handling and validation patterns:
102 | - ✅ **Custom Error Classes**: structured error hierarchies
103 | - ✅ **Result Pattern**: functional error handling
104 | - ✅ **Type Guards**: runtime type checking, assertion functions
105 | - ✅ **Validation Schemas**: rule-based validation, transformers
106 | - ✅ **Error Boundaries**: centralized error handling
107 | - ✅ **Safe Parsing**: result-based parsing functions
108 | - ✅ **Assertion Functions**: type-narrowing assertions
109 | - ✅ **Try-Catch Utilities**: functional try-catch patterns
110 | 
111 | ### 9. `src/utilities-helpers.ts`
112 | Common utility functions and type helpers:
113 | - ✅ **String Utilities**: case conversion, truncation, normalization
114 | - ✅ **Array Utilities**: chunking, grouping, shuffling, sampling
115 | - ✅ **Object Utilities**: deep cloning, merging, property access
116 | - ✅ **Function Utilities**: debouncing, throttling, memoization
117 | - ✅ **Date Utilities**: formatting, arithmetic, comparisons
118 | - ✅ **Number Utilities**: clamping, rounding, formatting
119 | - ✅ **Validation Helpers**: email, URL, UUID, password validation
120 | - ✅ **Color Utilities**: hex/RGB conversion, color manipulation
121 | - ✅ **Performance Utilities**: timing, batching, measurement
122 | 
123 | ### 10. `src/index.ts` (Entry Point)
124 | Main entry point that imports and demonstrates usage of all modules.
125 | 
126 | ## Project Structure
127 | 
128 | ```
129 | sample_project_typescript/
130 | ├── package.json                 # Dependencies and scripts
131 | ├── tsconfig.json               # TypeScript configuration
132 | ├── README.md                   # This documentation
133 | └── src/
134 |     ├── index.ts               # Main entry point
135 |     ├── types-interfaces.ts    # Core type system
136 |     ├── classes-inheritance.ts # OOP features
137 |     ├── functions-generics.ts  # Functions and generics
138 |     ├── async-promises.ts      # Async programming
139 |     ├── decorators-metadata.ts # Decorators system
140 |     ├── modules-namespaces.ts  # Module organization
141 |     ├── advanced-types.ts      # Advanced type features
142 |     ├── error-validation.ts    # Error handling
143 |     └── utilities-helpers.ts   # Common utilities
144 | ```
145 | 
146 | ## Installation and Setup
147 | 
148 | ### Prerequisites
149 | - Node.js (v16 or higher)
150 | - npm or yarn package manager
151 | 
152 | ### Installation
153 | ```bash
154 | # Install dependencies
155 | npm install
156 | 
157 | # Or with yarn
158 | yarn install
159 | ```
160 | 
161 | ### Available Scripts
162 | 
163 | ```bash
164 | # Compile TypeScript
165 | npm run build
166 | 
167 | # Compile and watch for changes
168 | npm run build:watch
169 | 
170 | # Run compiled JavaScript
171 | npm start
172 | 
173 | # Run with ts-node (development)
174 | npm run dev
175 | 
176 | # Run tests
177 | npm test
178 | 
179 | # Run tests in watch mode
180 | npm run test:watch
181 | 
182 | # Lint code
183 | npm run lint
184 | 
185 | # Fix lint issues
186 | npm run lint:fix
187 | 
188 | # Clean build artifacts
189 | npm run clean
190 | ```
191 | 
192 | ## TypeScript Configuration
193 | 
194 | The project uses strict TypeScript settings for maximum type safety:
195 | 
196 | ```json
197 | {
198 |   "compilerOptions": {
199 |     "target": "ES2020",
200 |     "module": "commonjs",
201 |     "strict": true,
202 |     "experimentalDecorators": true,
203 |     "emitDecoratorMetadata": true,
204 |     "exactOptionalPropertyTypes": true,
205 |     "noUncheckedIndexedAccess": true,
206 |     // ... other strict settings
207 |   }
208 | }
209 | ```
210 | 
211 | ## Key Features Demonstrated
212 | 
213 | ### Type Safety
214 | - Strict null checks
215 | - Exact optional properties
216 | - No unchecked indexed access
217 | - Comprehensive type annotations
218 | 
219 | ### Modern TypeScript
220 | - Latest ES features (ES2020 target)
221 | - Experimental decorators
222 | - Advanced type manipulations
223 | - Template literal types
224 | 
225 | ### Best Practices
226 | - Proper error handling patterns
227 | - Functional programming concepts
228 | - Design pattern implementations
229 | - Performance optimization techniques
230 | 
231 | ### Real-World Patterns
232 | - Dependency injection
233 | - Validation frameworks
234 | - Async operation management
235 | - Utility library patterns
236 | 
237 | ## Usage Examples
238 | 
239 | ### Basic Type Usage
240 | ```typescript
241 | import { User, createUser } from './types-interfaces';
242 | 
243 | const user: User = {
244 |   id: 1,
245 |   name: "John Doe",
246 |   email: "[email protected]",
247 |   createdAt: new Date(),
248 |   preferences: {
249 |     theme: "dark",
250 |     notifications: true,
251 |     language: "en"
252 |   }
253 | };
254 | ```
255 | 
256 | ### Class Inheritance
257 | ```typescript
258 | import { Employee, Person } from './classes-inheritance';
259 | 
260 | const employee = new Employee("Jane Smith", 28, 456, "Engineering", 75000);
261 | console.log(employee.introduce()); // Uses overridden method
262 | employee.celebrateBirthday(); // Accesses protected members
263 | ```
264 | 
265 | ### Async Operations
266 | ```typescript
267 | import { PromisePool, AsyncCache } from './async-promises';
268 | 
269 | const pool = new PromisePool(3);
270 | const cache = new AsyncCache(60000);
271 | 
272 | // Use promise pool for concurrent operations
273 | userIds.forEach(id => {
274 |   pool.add(() => fetchUserData(id));
275 | });
276 | 
277 | const results = await pool.execute();
278 | ```
279 | 
280 | ### Advanced Types
281 | ```typescript
282 | import { DeepPartial, Paths, Get } from './advanced-types';
283 | 
284 | type UserUpdate = DeepPartial<User>;
285 | type UserPaths = Paths<User>; // "name" | "email" | "preferences.theme" | etc.
286 | 
287 | function getValue<T, K extends Paths<T>>(obj: T, path: K): Get<T, K> {
288 |   // Type-safe nested property access
289 | }
290 | ```
291 | 
292 | ### Error Handling
293 | ```typescript
294 | import { Result, Ok, Err, validateUser } from './error-validation';
295 | 
296 | const result = validateUser(userData);
297 | 
298 | if (result.success) {
299 |   // result.data is properly typed
300 |   console.log(result.data.name);
301 | } else {
302 |   // result.error contains validation errors
303 |   console.error(result.error);
304 | }
305 | ```
306 | 
307 | ## Testing with Code Analysis Tools
308 | 
309 | This project is specifically designed to test various code analysis scenarios:
310 | 
311 | ### Dependency Analysis
312 | - Import/export relationships
313 | - Module dependencies
314 | - Circular dependency detection
315 | 
316 | ### Type Analysis
317 | - Type inference testing
318 | - Generic resolution
319 | - Complex type relationships
320 | 
321 | ### Pattern Recognition
322 | - Design pattern detection
323 | - Common TypeScript idioms
324 | - Best practice validation
325 | 
326 | ### Complexity Metrics
327 | - Cyclomatic complexity
328 | - Type complexity
329 | - Inheritance hierarchies
330 | 
331 | ## Integration with Graph Databases
332 | 
333 | The project structure supports graph database population for:
334 | 
335 | ### Node Types
336 | - **Files**: Source files, test files, configuration files
337 | - **Classes**: Regular classes, abstract classes, interfaces
338 | - **Functions**: Methods, static methods, constructors
339 | - **Types**: Interfaces, type aliases, enums
340 | - **Variables**: Properties, parameters, local variables
341 | 
342 | ### Relationship Types
343 | - **IMPORTS**: File import relationships
344 | - **EXTENDS**: Class/interface inheritance
345 | - **IMPLEMENTS**: Interface implementation
346 | - **CALLS**: Function call relationships
347 | - **USES**: Type usage relationships
348 | - **CONTAINS**: Containment relationships
349 | 
350 | ### Properties
351 | - **Language Features**: decorators, generics, async/await
352 | - **Access Modifiers**: public, private, protected
353 | - **Type Information**: parameter types, return types
354 | - **Metadata**: JSDoc comments, decorator metadata
355 | 
356 | ## Contributing
357 | 
358 | When adding new TypeScript features or patterns:
359 | 
360 | 1. Create focused examples in the appropriate file
361 | 2. Include comprehensive type annotations
362 | 3. Add JSDoc comments for documentation
363 | 4. Update this README with new features
364 | 5. Ensure examples are realistic and practical
365 | 
366 | ## Language Features Coverage
367 | 
368 | | Feature Category | Coverage | File Location |
369 | |-----------------|----------|---------------|
370 | | Basic Types | ✅ Complete | `types-interfaces.ts` |
371 | | Classes & OOP | ✅ Complete | `classes-inheritance.ts` |
372 | | Functions & Generics | ✅ Complete | `functions-generics.ts` |
373 | | Async Programming | ✅ Complete | `async-promises.ts` |
374 | | Decorators | ✅ Complete | `decorators-metadata.ts` |
375 | | Modules & Namespaces | ✅ Complete | `modules-namespaces.ts` |
376 | | Advanced Types | ✅ Complete | `advanced-types.ts` |
377 | | Error Handling | ✅ Complete | `error-validation.ts` |
378 | | Utilities | ✅ Complete | `utilities-helpers.ts` |
379 | 
380 | ## Use Cases
381 | 
382 | This sample project is ideal for:
383 | 
384 | ### Development Tools
385 | - **IDEs**: Testing IntelliSense, refactoring, navigation
386 | - **Linters**: ESLint rule validation, custom rule testing
387 | - **Formatters**: Prettier configuration testing
388 | 
389 | ### Code Analysis
390 | - **Static Analysis**: Type checking, unused code detection
391 | - **Dependency Analysis**: Import graph construction
392 | - **Complexity Analysis**: Metrics calculation
393 | 
394 | ### Learning & Training
395 | - **TypeScript Education**: Comprehensive feature examples
396 | - **Best Practices**: Real-world pattern demonstration
397 | - **Code Reviews**: Reference implementation examples
398 | 
399 | ### Testing & QA
400 | - **Type System Testing**: Edge case coverage
401 | - **Tool Validation**: Ensuring tools handle complex TypeScript
402 | - **Performance Testing**: Large-scale TypeScript compilation
403 | 
404 | ## Versioning
405 | 
406 | This project follows semantic versioning:
407 | - **Major**: Breaking changes to file structure or major feature additions
408 | - **Minor**: New TypeScript features, enhanced examples
409 | - **Patch**: Bug fixes, documentation improvements, minor updates
410 | 
411 | Current version: **1.0.0**
412 | 
413 | ## License
414 | 
415 | MIT License - feel free to use this project for testing, education, or as a reference implementation.
416 | 
417 | ---
418 | 
419 | *This TypeScript sample project provides comprehensive coverage of modern TypeScript features and patterns, making it an ideal testing ground for code analysis tools, educational purposes, and development tool validation.*
```

--------------------------------------------------------------------------------
/docs/docs/license.md:
--------------------------------------------------------------------------------

```markdown
 1 | # License
 2 | 
 3 | CodeGraphContext is licensed under the MIT License.
 4 | 
 5 | ```
 6 | MIT License
 7 | 
 8 | Copyright (c) 2025
 9 | 
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 | 
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 | 
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | SOFTWARE.
27 | ```
28 | 
```

--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Contributing to CodeGraphContext
 2 | 
 3 | We welcome contributions! Please follow these steps:
 4 | 
 5 | ## General Guidelines
 6 | 
 7 | *   Ensure your code adheres to the existing style and conventions of the project.
 8 | *   Write clear, concise, and well-documented code.
 9 | *   All new features or bug fixes should be accompanied by appropriate tests.
10 | *   Keep your pull requests focused on a single feature or bug fix.
11 | 
12 | ## Setting up Your Development Environment
13 | 
14 | 1.  Fork the repository.
15 | 2.  Set up your development environment: `pip install -e ".[dev]"`
16 | 3.  Create a new branch for your feature or bugfix (e.g., `git checkout -b feature/my-new-feature`).
17 | 
18 | ## Debugging
19 | 
20 | To enable debug mode for detailed logging, locate the `debug_mode` variable in `src/codegraphcontext/tools/graph_builder.py` and set its value to `1`.
21 | 
22 | ```python
23 | # src/codegraphcontext/tools/graph_builder.py
24 | debug_mode = 1
25 | ```
26 | 
27 | ## Running Tests
28 | 
29 | Tests are located in the `tests/` directory and are run using `pytest`.
30 | 
31 | 1.  Navigate to the root of the `CodeGraphContext` directory.
32 | 2.  Run all tests using the command: `pytest`
33 | 3.  To run specific tests, you can provide the path to the test file, for example: `pytest tests/test_tools.py`
34 | 4.  **Skipping Re-indexing:** To speed up test runs, especially during development, you can set the `CGC_SKIP_REINDEX` environment variable to `true`. This will prevent the test suite from re-indexing the sample project if it's already indexed.
35 |     ```bash
36 |     CGC_SKIP_REINDEX=true pytest
37 |     ```
38 | 
39 | ## Submitting Changes
40 | 
41 | 1.  Write your code and add corresponding tests in the `tests/` directory.
42 | 2.  Ensure all tests pass and your code lints without errors.
43 | 3.  Commit your changes with a descriptive commit message.
44 | 4.  Submit a pull request to the `main` branch.
45 | 
46 | 
47 | <!-- "Failed to check job status: 'JobManager' object has no attribute 'JobStatus'" -->
```

--------------------------------------------------------------------------------
/docs/docs/contributing.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Contributing to CodeGraphContext
 2 | 
 3 | We welcome contributions! Please follow these steps:
 4 | 
 5 | ## General Guidelines
 6 | 
 7 | *   Ensure your code adheres to the existing style and conventions of the project.
 8 | *   Write clear, concise, and well-documented code.
 9 | *   All new features or bug fixes should be accompanied by appropriate tests.
10 | *   Keep your pull requests focused on a single feature or bug fix.
11 | 
12 | ## Setting up Your Development Environment
13 | 
14 | 1.  Fork the repository.
15 | 2.  Set up your development environment: `pip install -e ".[dev]"`
16 | 3.  Create a new branch for your feature or bugfix (e.g., `git checkout -b feature/my-new-feature`).
17 | 
18 | ## Debugging
19 | 
20 | To enable debug mode for detailed logging, locate the `debug_mode` variable in `src/codegraphcontext/tools/graph_builder.py` and set its value to `1`.
21 | 
22 | ```python
23 | # src/codegraphcontext/tools/graph_builder.py
24 | debug_mode = 1
25 | ```
26 | 
27 | ## Running Tests
28 | 
29 | Tests are located in the `tests/` directory and are run using `pytest`.
30 | 
31 | 1.  Navigate to the root of the `CodeGraphContext` directory.
32 | 2.  Run all tests using the command: `pytest`
33 | 3.  To run specific tests, you can provide the path to the test file, for example: `pytest tests/test_tools.py`
34 | 4.  **Skipping Re-indexing:** To speed up test runs, especially during development, you can set the `CGC_SKIP_REINDEX` environment variable to `true`. This will prevent the test suite from re-indexing the sample project if it's already indexed.
35 |     ```bash
36 |     CGC_SKIP_REINDEX=true pytest
37 |     ```
38 | 
39 | ## Submitting Changes
40 | 
41 | 1.  Write your code and add corresponding tests in the `tests/` directory.
42 | 2.  Ensure all tests pass and your code lints without errors.
43 | 3.  Commit your changes with a descriptive commit message.
44 | 4.  Submit a pull request to the `main` branch.
45 | 
46 | 
47 | <!-- "Failed to check job status: 'JobManager' object has no attribute 'JobStatus'" -->
48 | 
```

--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------

```markdown
 1 | # 🛡️ Security Policy
 2 | 
 3 | ## 📌 Supported Versions
 4 | 
 5 | We aim to keep `CodeGraphContext` up to date and secure. Please see below for the versions we currently support with security updates.
 6 | 
 7 | | Version | Supported          |
 8 | |---------|--------------------|
 9 | | Latest  | ✅ Yes              |
10 | | Older   | ❌ No               |
11 | 
12 | ---
13 | 
14 | ## 📬 Reporting a Vulnerability
15 | 
16 | If you discover a security vulnerability, **please do not open an issue** on GitHub.
17 | 
18 | Instead, follow these steps:
19 | 
20 | 1. **Email the maintainer directly**
21 | 2. Include the following details:
22 |    - Description of the vulnerability
23 |    - Steps to reproduce (if possible)
24 |    - Potential impact
25 |    - Any mitigation or workaround suggestions
26 | 
27 | ⌛ We aim to respond to security reports **within 72 hours**.
28 | 
29 | ---
30 | 
31 | ## 🚫 Responsible Disclosure Guidelines
32 | 
33 | We ask that you:
34 | - Do not publicly disclose the issue until it has been resolved.
35 | - Avoid testing vulnerabilities in a way that could disrupt services.
36 | - Act in good faith and with respect for user data and privacy.
37 | 
38 | ---
39 | 
40 | ## 📃 Disclosure Policy
41 | 
42 | - We follow a **coordinated disclosure** approach.
43 | - We appreciate responsible reporting and will publicly disclose the issue only **after a fix has been released**.
44 | 
45 | --- 
46 | 
47 | ## ✅ Security Best Practices
48 | 
49 | While using this project, we recommend you:
50 | 
51 | - Always run software in a secure and isolated environment.
52 | - Keep your dependencies up to date.
53 | - Avoid sharing sensitive API keys or credentials in `.env` or other public files.
54 | 
55 | ---
56 | 
57 | ## 🙏 Acknowledgments
58 | 
59 | We value the contributions from the community and encourage responsible disclosure to help keep `CodeGraphContext` safe and secure for all users.
60 | 
61 | ---
62 | 
63 | ## 🔒 Resources
64 | 
65 | - [GitHub Security Advisories](https://docs.github.com/en/code-security/security-advisories)
66 | - [OpenSSF Best Practices](https://bestpractices.dev/)
67 | - [OWASP Top 10](https://owasp.org/www-project-top-ten/)
68 | 
```

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

```python
1 | 
```

--------------------------------------------------------------------------------
/tests/__init__.py:
--------------------------------------------------------------------------------

```python
1 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_php/error_handling.php:
--------------------------------------------------------------------------------

```php
1 | 
```

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

```python
1 | 
```

--------------------------------------------------------------------------------
/tests/test_tree_sitter/__init__.py:
--------------------------------------------------------------------------------

```python
1 | 
```

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

```python
1 | """Only a docstring."""
2 | 
```

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

```python
1 | # comment only
2 | # nothing here
3 | 
```

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

```python
1 | def broken_func(
2 |     return 1
3 | 
```

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

```javascript
1 | module.exports=require("./lunr.ja");
```

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

```python
1 | # src/codegraphcontext/cli/__init__.py
```

--------------------------------------------------------------------------------
/website/src/vite-env.d.ts:
--------------------------------------------------------------------------------

```typescript
1 | /// <reference types="vite/client" />
2 | 
```

--------------------------------------------------------------------------------
/src/codegraphcontext/core/__init__.py:
--------------------------------------------------------------------------------

```python
1 | # src/codegraphcontext/core/__init__.py
```

--------------------------------------------------------------------------------
/tests/sample_project/module_c/__init__.py:
--------------------------------------------------------------------------------

```python
1 | __all__ = ['submodule1', 'submodule2']
2 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_ruby/module_example.rb:
--------------------------------------------------------------------------------

```ruby
1 | module MathTools
2 |   def square(x)
3 |     x * x
4 |   end
5 | end
6 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/namespace_pkg/ns_module.py:
--------------------------------------------------------------------------------

```python
1 | def ns_func():
2 |     return 'I am in a namespace package'
3 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/function_chain.h:
--------------------------------------------------------------------------------

```
1 | // function_chain.h
2 | #pragma once
3 | 
4 | void functionChainDemo();
5 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/circular1.py:
--------------------------------------------------------------------------------

```python
1 | from circular2 import func2
2 | 
3 | def func1():
4 |     return func2()
5 | 
```

--------------------------------------------------------------------------------
/tests/test_tree_sitter/complex_classes.py:
--------------------------------------------------------------------------------

```python
1 | class Z:
2 |     def greet(self):
3 |         return "Z's complex greeting"
4 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/circular2.py:
--------------------------------------------------------------------------------

```python
1 | from circular1 import func1
2 | 
3 | def func2():
4 |     return 'ok_from_circular2'
5 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_java/src/com/example/app/model/Role.java:
--------------------------------------------------------------------------------

```java
1 | package com.example.app.model;
2 | 
3 | public enum Role { ADMIN, EDITOR, VIEWER }
4 | 
```

--------------------------------------------------------------------------------
/src/codegraphcontext/__init__.py:
--------------------------------------------------------------------------------

```python
1 | # src/codegraphcontext/__init__.py
2 | # This makes 'codegraphcontext' a package.
```

--------------------------------------------------------------------------------
/website/postcss.config.js:
--------------------------------------------------------------------------------

```javascript
1 | export default {
2 |   plugins: {
3 |     tailwindcss: {},
4 |     autoprefixer: {},
5 |   },
6 | };
7 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/use-toast.ts:
--------------------------------------------------------------------------------

```typescript
1 | import { useToast, toast } from "@/hooks/use-toast";
2 | 
3 | export { useToast, toast };
4 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/module_c/submodule1.py:
--------------------------------------------------------------------------------

```python
1 | from module_b import helper
2 | 
3 | def call_helper_twice(x):
4 |     return helper(x) + helper(x + 1)
5 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_c/src/math/vec.c:
--------------------------------------------------------------------------------

```cpp
1 | #include "math/vec.h"
2 | Vec3 vec_add(Vec3 a, Vec3 b) { return (Vec3){a.x+b.x, a.y+b.y, a.z+b.z}; }
3 | 
```

--------------------------------------------------------------------------------
/src/codegraphcontext/__main__.py:
--------------------------------------------------------------------------------

```python
1 | # src/codegraphcontext/__main__.py
2 | from .cli.main import app
3 | 
4 | if __name__ == "__main__":
5 |     app()
6 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/main.cpp:
--------------------------------------------------------------------------------

```cpp
1 | #include <iostream>
2 | 
3 | int main() {
4 |     std::cout << "C++ Sample Project Running!\n";
5 |     return 0;
6 | }
7 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/module_c/submodule2.py:
--------------------------------------------------------------------------------

```python
1 | from module_c.submodule1 import call_helper_twice
2 | 
3 | def wrapper(x):
4 |     return call_helper_twice(x) * 2
5 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_c/include/math/vec.h:
--------------------------------------------------------------------------------

```
1 | #ifndef VEC_H
2 | #define VEC_H
3 | typedef struct { float x, y, z; } Vec3;
4 | Vec3 vec_add(Vec3 a, Vec3 b);
5 | #endif
6 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_c/src/util.c:
--------------------------------------------------------------------------------

```cpp
1 | #include "util.h"
2 | 
3 | int g_counter = 0; // definition
4 | 
5 | int max_int(int a, int b) { return a > b ? a : b; }
6 | 
```

--------------------------------------------------------------------------------
/website/vercel.json:
--------------------------------------------------------------------------------

```json
1 | {
2 |   "rewrites": [
3 |     {
4 |       "source": "/api/pypi/:path*",
5 |       "destination": "/api/pypi"
6 |     }
7 |   ]
8 | }
9 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_ruby/class_example.rb:
--------------------------------------------------------------------------------

```ruby
 1 | class Greeter
 2 |   def initialize(name)
 3 |     @name = name
 4 |   end
 5 | 
 6 |   def greet
 7 |     "Hello, #{@name}!"
 8 |   end
 9 | end
10 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/edge_cases.cpp:
--------------------------------------------------------------------------------

```cpp
1 | // Demonstrates edge cases: empty, comments only, etc.
2 | // This file intentionally left mostly blank.
3 | // ...
4 | 
```

--------------------------------------------------------------------------------
/docs/site/sitemap.xml:
--------------------------------------------------------------------------------

```
1 | <?xml version="1.0" encoding="UTF-8"?>
2 | <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3 | </urlset>
```

--------------------------------------------------------------------------------
/tests/sample_project/import_reexports.py:
--------------------------------------------------------------------------------

```python
1 | def core_function(): return 'core'
2 | 
3 | def reexport(): return core_function()
4 | 
5 | import math as m
6 | val = m.sqrt(16)
7 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/events.js:
--------------------------------------------------------------------------------

```javascript
1 | // Event listeners (run in browser)
2 | 
3 | document.addEventListener("click", () => {
4 |   alert("You clicked the page!");
5 | });
```

--------------------------------------------------------------------------------
/tests/sample_project_ruby/error_handling.rb:
--------------------------------------------------------------------------------

```ruby
1 | begin
2 |   num = 10 / 0
3 | rescue ZeroDivisionError => e
4 |   puts "Error: #{e.message}"
5 | ensure
6 |   puts "Execution finished"
7 | end
8 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_c/include/config.h:
--------------------------------------------------------------------------------

```
1 | #ifndef CONFIG_H
2 | #define CONFIG_H
3 | 
4 | #define APP_NAME "CgcSample"
5 | #define APP_VERSION "0.1.0"
6 | 
7 | #define ENABLE_STATS 1
8 | #endif
9 | 
```

--------------------------------------------------------------------------------
/tests/test_tree_sitter/class_instantiation.py:
--------------------------------------------------------------------------------

```python
1 | class A:
2 |     def greet(self):
3 |         return "A's greeting"
4 | 
5 | class B(A):
6 |     def greet(self):
7 |         return super().greet()
8 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_ruby/file_io.rb:
--------------------------------------------------------------------------------

```ruby
1 | File.open("example.txt", "w") { |f| f.puts "Hello Ruby File!" }
2 | 
3 | content = File.read("example.txt")
4 | puts "File says: #{content}"
5 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_java/src/com/example/app/service/GreetingService.java:
--------------------------------------------------------------------------------

```java
1 | package com.example.app.service;
2 | 
3 | import com.example.app.model.User;
4 | 
5 | public interface GreetingService {
6 |     String greet(User user);
7 | }
8 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_c/include/module.h:
--------------------------------------------------------------------------------

```
1 | #ifndef MODULE_H
2 | #define MODULE_H
3 | typedef enum { MODE_A=0, MODE_B=1 } Mode;
4 | void module_init(Mode m);
5 | int module_compute(int base);
6 | #endif
7 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_ruby/mixins_example.rb:
--------------------------------------------------------------------------------

```ruby
 1 | module Flyable
 2 |   def fly
 3 |     "#{@name} is flying!"
 4 |   end
 5 | end
 6 | 
 7 | class Bird
 8 |   include Flyable
 9 | 
10 |   def initialize(name)
11 |     @name = name
12 |   end
13 | end
14 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/aspect-ratio.tsx:
--------------------------------------------------------------------------------

```typescript
1 | import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
2 | 
3 | const AspectRatio = AspectRatioPrimitive.Root;
4 | 
5 | export { AspectRatio };
6 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_ruby/enumerables.rb:
--------------------------------------------------------------------------------

```ruby
1 | numbers = [1, 2, 3, 4, 5]
2 | squares = numbers.map { |n| n * n }
3 | evens = numbers.select(&:even?)
4 | 
5 | puts "Squares: #{squares}"
6 | puts "Evens: #{evens}"
7 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/errorHandling.js:
--------------------------------------------------------------------------------

```javascript
1 | // Try/catch error handling
2 | 
3 | try {
4 |   throw new Error("Something went wrong!");
5 | } catch (error) {
6 |   console.error("Caught error:", error.message);
7 | }
```

--------------------------------------------------------------------------------
/tests/sample_project/async_features.py:
--------------------------------------------------------------------------------

```python
 1 | import asyncio
 2 | 
 3 | async def fetch_data(x):
 4 |     await asyncio.sleep(0)
 5 |     return x * 2
 6 | 
 7 | async def main():
 8 |     result = await fetch_data(10)
 9 |     return result
10 | 
```

--------------------------------------------------------------------------------
/website/public/robots.txt:
--------------------------------------------------------------------------------

```
 1 | User-agent: Googlebot
 2 | Allow: /
 3 | 
 4 | User-agent: Bingbot
 5 | Allow: /
 6 | 
 7 | User-agent: Twitterbot
 8 | Allow: /
 9 | 
10 | User-agent: facebookexternalhit
11 | Allow: /
12 | 
13 | User-agent: *
14 | Allow: /
15 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/advanced_imports.py:
--------------------------------------------------------------------------------

```python
 1 | def outer_import():
 2 |     import math
 3 |     return math.sqrt(25)
 4 | 
 5 | if True:
 6 |     import random
 7 | else:
 8 |     import sys
 9 | 
10 | def use_random():
11 |     return random.randint(1, 10)
12 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_c/include/platform.h:
--------------------------------------------------------------------------------

```
 1 | #ifndef PLATFORM_H
 2 | #define PLATFORM_H
 3 | 
 4 | #if defined(_WIN32) || defined(_WIN64)
 5 |   #define CGC_PLATFORM_WINDOWS 1
 6 | #else
 7 |   #define CGC_PLATFORM_POSIX 1
 8 | #endif
 9 | 
10 | #endif
11 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_java/src/com/example/app/annotations/Logged.java:
--------------------------------------------------------------------------------

```java
1 | package com.example.app.annotations;
2 | 
3 | import java.lang.annotation.*;
4 | 
5 | @Retention(RetentionPolicy.RUNTIME)
6 | @Target({ElementType.METHOD})
7 | public @interface Logged {}
8 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_rust/Cargo.toml:
--------------------------------------------------------------------------------

```toml
 1 | [package]
 2 | name = "sample_project_rust"
 3 | version = "0.1.0"
 4 | edition = "2021"
 5 | 
 6 | [dependencies]
 7 | 
 8 | [dev-dependencies]
 9 | 
10 | [lib]
11 | name = "sample_project_rust"
12 | path = "src/lib.rs"
13 | 
14 | 
```

--------------------------------------------------------------------------------
/website/src/lib/utils.ts:
--------------------------------------------------------------------------------

```typescript
1 | import { clsx, type ClassValue } from "clsx";
2 | import { twMerge } from "tailwind-merge";
3 | 
4 | export function cn(...inputs: ClassValue[]) {
5 |   return twMerge(clsx(inputs));
6 | }
7 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/module_b.py:
--------------------------------------------------------------------------------

```python
 1 | value = 42
 2 | 
 3 | def helper(x):
 4 |     return x + 1
 5 | 
 6 | def process_data(data):
 7 |     return sum(data)
 8 | 
 9 | def factorial(n):
10 |     if n <= 1:
11 |         return 1
12 |     return n * factorial(n - 1)
13 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_ruby/inheritance_example.rb:
--------------------------------------------------------------------------------

```ruby
 1 | class Animal
 2 |   def initialize(name)
 3 |     @name = name
 4 |   end
 5 | 
 6 |   def speak
 7 |     "#{@name} makes a sound."
 8 |   end
 9 | end
10 | 
11 | class Dog < Animal
12 |   def speak
13 |     "#{@name} barks!"
14 |   end
15 | end
16 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/pattern_matching.py:
--------------------------------------------------------------------------------

```python
1 | def matcher(x):
2 |     match x:
3 |         case 0: return 'zero'
4 |         case 1 | 2: return 'one or two'
5 |         case str() as s: return f'string: {s}'
6 |         case _: return 'other'
7 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/namespaces.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | // Demonstrates namespaces and using directive
 2 | #include <iostream>
 3 | 
 4 | namespace foo {
 5 |     void bar() { std::cout << "foo::bar\n"; }
 6 | }
 7 | 
 8 | void namespaceDemo() {
 9 |     using namespace foo;
10 |     bar();
11 | }
12 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/variables.js:
--------------------------------------------------------------------------------

```javascript
1 | // Demonstrating variable declarations in JavaScript
2 | 
3 | var a = 10;       // function-scoped
4 | let b = 20;       // block-scoped
5 | const c = 30;     // block-scoped and constant
6 | 
7 | console.log(a, b, c);
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/promises.js:
--------------------------------------------------------------------------------

```javascript
 1 | // Promise chaining
 2 | 
 3 | const fetchData = () => {
 4 |   return new Promise((resolve) => {
 5 |     setTimeout(() => resolve("Data loaded"), 1000);
 6 |   });
 7 | };
 8 | 
 9 | fetchData().then(data => {
10 |   console.log(data);
11 | });
```

--------------------------------------------------------------------------------
/tests/sample_project_ruby/tests/test_sample.rb:
--------------------------------------------------------------------------------

```ruby
 1 | require 'minitest/autorun'
 2 | require_relative '../class_example'
 3 | 
 4 | class TestGreeter < Minitest::Test
 5 |   def test_greet
 6 |     g = Greeter.new("World")
 7 |     assert_equal "Hello, World!", g.greet
 8 |   end
 9 | end
10 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/context_managers.py:
--------------------------------------------------------------------------------

```python
 1 | class FileOpener:
 2 |     def __enter__(self):
 3 |         return 'opened'
 4 |     def __exit__(self, exc_type, exc_val, exc_tb):
 5 |         return False
 6 | 
 7 | def use_file():
 8 |     with FileOpener() as f:
 9 |         return f
10 | 
```

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

```python
1 | class CToolkit:
2 |     """Template placeholder for future implementation."""
3 | 
4 |     def get_cypher_query(query: str) -> str:
5 |         raise NotImplementedError("AdvancedLanguageQuery is not implemented yet.")
```

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

```python
1 | class GoToolkit:
2 |     """Template placeholder for future implementation."""
3 | 
4 |     def get_cypher_query(query: str) -> str:
5 |         raise NotImplementedError("AdvancedLanguageQuery is not implemented yet.")
```

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

```python
1 | class JavaToolkit:
2 |     """Template placeholder for future implementation."""
3 | 
4 |     def get_cypher_query(query: str) -> str:
5 |         raise NotImplementedError("AdvancedLanguageQuery is not implemented yet.")
```

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

```python
1 | class RubyToolkit:
2 |     """Template placeholder for future implementation."""
3 | 
4 |     def get_cypher_query(query: str) -> str:
5 |         raise NotImplementedError("AdvancedLanguageQuery is not implemented yet.")
```

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

```python
1 | class RustToolkit:
2 |     """Template placeholder for future implementation."""
3 | 
4 |     def get_cypher_query(query: str) -> str:
5 |         raise NotImplementedError("AdvancedLanguageQuery is not implemented yet.")
```

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

```python
1 | class PythonToolkit:
2 |     """Template placeholder for future implementation."""
3 | 
4 |     def get_cypher_query(query: str) -> str:
5 |         raise NotImplementedError("AdvancedLanguageQuery is not implemented yet.")
```

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

```python
1 | class JavascriptToolkit:
2 |     """Template placeholder for future implementation."""
3 | 
4 |     def get_cypher_query(query: str) -> str:
5 |         raise NotImplementedError("AdvancedLanguageQuery is not implemented yet.")
```

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

```python
1 | class TypescriptToolkit:
2 |     """Template placeholder for future implementation."""
3 | 
4 |     def get_cypher_query(query: str) -> str:
5 |         raise NotImplementedError("AdvancedLanguageQuery is not implemented yet.")
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/asyncAwait.js:
--------------------------------------------------------------------------------

```javascript
 1 | // Async/await syntax
 2 | 
 3 | const getData = async () => {
 4 |   const result = await fetchData();
 5 |   console.log("Async result:", result);
 6 | };
 7 | 
 8 | getData();
 9 | 
10 | async function fetchData() {
11 |   return "Fetched with async/await";
12 | }
```

--------------------------------------------------------------------------------
/tests/sample_project_php/edgecases.php:
--------------------------------------------------------------------------------

```php
 1 | <?php
 2 | var_dump("0" == 0);
 3 | var_dump("0" === 0);
 4 | 
 5 | $arr = [1 => "one", "1" => "uno"];
 6 | print_r($arr);
 7 | 
 8 | var_dump(null == "");
 9 | var_dump(null === "");
10 | 
11 | $a = true + false;
12 | $b = "5 apples" + 2;
13 | 
14 | echo $a . "\n";
15 | echo $b . "\n";
16 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/dom.js:
--------------------------------------------------------------------------------

```javascript
1 | // Basic DOM manipulation (run in browser)
2 | 
3 | document.body.style.backgroundColor = "lightblue";
4 | 
5 | const heading = document.createElement("h1");
6 | heading.textContent = "Hello from JavaScript!";
7 | document.body.appendChild(heading);
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/fetchAPI.js:
--------------------------------------------------------------------------------

```javascript
1 | // Fetch API (run in browser or Node with fetch support)
2 | 
3 | fetch("https://jsonplaceholder.typicode.com/posts/1")
4 |   .then(response => response.json())
5 |   .then(data => console.log(data))
6 |   .catch(err => console.error("Error:", err));
```

--------------------------------------------------------------------------------
/tests/sample_project/typing_examples.py:
--------------------------------------------------------------------------------

```python
 1 | from typing import List, Dict, Union
 2 | 
 3 | def typed_func(a: int, b: str) -> List[str]:
 4 |     return [b] * a
 5 | 
 6 | def union_func(x: Union[int, str]) -> str:
 7 |     return str(x)
 8 | 
 9 | def dict_func(d: Dict[str, int]) -> int:
10 |     return sum(d.values())
11 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/fixtures/js/accessors.js:
--------------------------------------------------------------------------------

```javascript
 1 | class Demo {
 2 |   get value() { return this._v }
 3 |   set value(x) { this._v = x }
 4 |   static ping() { return "pong" }
 5 | }
 6 | const obj = {
 7 |   get foo() { return 1 },
 8 |   set foo(v) { this._f = v },
 9 |   bar() { return 2 } // regular method (no type)
10 | }
11 | 
```

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

```typescript
1 | import { cn } from "@/lib/utils";
2 | 
3 | function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
4 |   return <div className={cn("animate-pulse rounded-md bg-muted", className)} {...props} />;
5 | }
6 | 
7 | export { Skeleton };
8 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/arrays.js:
--------------------------------------------------------------------------------

```javascript
1 | // Array methods: map, filter, reduce
2 | 
3 | const nums = [1, 2, 3, 4, 5];
4 | 
5 | const doubled = nums.map(n => n * 2);
6 | const evens = nums.filter(n => n % 2 === 0);
7 | const sum = nums.reduce((acc, n) => acc + n, 0);
8 | 
9 | console.log(doubled, evens, sum);
```

--------------------------------------------------------------------------------
/tests/sample_project/datatypes.py:
--------------------------------------------------------------------------------

```python
 1 | from dataclasses import dataclass
 2 | import enum
 3 | from collections import namedtuple
 4 | 
 5 | @dataclass
 6 | class Point:
 7 |     x: int
 8 |     y: int
 9 | 
10 | class Color(enum.Enum):
11 |     RED = 1
12 |     GREEN = 2
13 |     BLUE = 3
14 | 
15 | Person = namedtuple('Person', ['name', 'age'])
16 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_java/src/com/example/app/service/AbstractGreeter.java:
--------------------------------------------------------------------------------

```java
 1 | package com.example.app.service;
 2 | 
 3 | import com.example.app.annotations.Logged;
 4 | import com.example.app.model.User;
 5 | 
 6 | public abstract class AbstractGreeter {
 7 |     @Logged
 8 |     protected String base(User u) {
 9 |         return "Hello, " + u.getName();
10 |     }
11 | }
12 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/stl_usage.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | // Demonstrates STL containers and algorithms
 2 | #include <iostream>
 3 | #include <vector>
 4 | #include <algorithm>
 5 | 
 6 | void stlDemo() {
 7 |     std::vector<int> v = {1, 2, 3};
 8 |     std::for_each(v.begin(), v.end(), [](int x){ std::cout << x << ' '; });
 9 |     std::cout << std::endl;
10 | }
11 | 
```

--------------------------------------------------------------------------------
/website/src/main.tsx:
--------------------------------------------------------------------------------

```typescript
 1 | import React from "react";
 2 | import { createRoot } from "react-dom/client";
 3 | import App from "./App.tsx";
 4 | import "./index.css";
 5 | 
 6 | import "aos/dist/aos.css";
 7 | 
 8 | createRoot(document.getElementById("root")!).render(
 9 |   <React.StrictMode>
10 |     <App />
11 |   </React.StrictMode>
12 | );
13 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/function_chain.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | // Demonstrates function pointers and lambdas
 2 | #include <iostream>
 3 | #include <functional>
 4 | 
 5 | void callTwice(const std::function<void()>& f) {
 6 |     f(); f();
 7 | }
 8 | 
 9 | void functionChainDemo() {
10 |     auto lambda = [](){ std::cout << "Hello from lambda\n"; };
11 |     callTwice(lambda);
12 | }
13 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/module_a.py:
--------------------------------------------------------------------------------

```python
 1 | import math
 2 | import module_b as mb
 3 | from module_b import process_data
 4 | 
 5 | def foo(x):
 6 |     return mb.helper(x) + mb.value + process_data([x])
 7 | 
 8 | def bar():
 9 |     return math.sqrt(16)
10 | 
11 | nested = lambda x: x * 2
12 | 
13 | def outer():
14 |     def inner(y):
15 |         return y + 1
16 |     return inner(5)
17 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/advanced_functions.py:
--------------------------------------------------------------------------------

```python
 1 | def with_defaults(a, b=5, c='hello'):
 2 |     return f"{a}-{b}-{c}"
 3 | 
 4 | def with_args_kwargs(*args, **kwargs):
 5 |     return args, kwargs
 6 | 
 7 | def higher_order(func, data):
 8 |     return [func(x) for x in data]
 9 | 
10 | def return_function(x):
11 |     def inner(y):
12 |         return x + y
13 |     return inner
14 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/advanced_calls.py:
--------------------------------------------------------------------------------

```python
 1 | def square(x): return x * x
 2 | 
 3 | def calls():
 4 |     data = [1, 2, 3]
 5 |     result1 = [square(x) for x in data]
 6 |     result2 = list(map(square, data))
 7 |     obj = Dummy()
 8 |     result3 = getattr(obj, 'method')(5)
 9 |     return result1, result2, result3
10 | 
11 | class Dummy:
12 |     def method(self, x): return x + 10
13 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_php/file_handling.php:
--------------------------------------------------------------------------------

```php
 1 | <?php
 2 | $file = "shashank.txt";
 3 | 
 4 | try {
 5 |     file_put_contents($file, "Hello Shashank\n");
 6 |     file_put_contents($file, "Welcome to PHP\n", FILE_APPEND);
 7 |     $data = file_get_contents($file);
 8 |     echo $data;
 9 |     unlink($file);
10 | } catch (Exception $e) {
11 |     echo "File error: " . $e->getMessage();
12 | }
```

--------------------------------------------------------------------------------
/tests/sample_project_ruby/metaprogramming.rb:
--------------------------------------------------------------------------------

```ruby
 1 | class DynamicGreeter
 2 |   [:hello, :goodbye].each do |method|
 3 |     define_method(method) do |name|
 4 |       "#{method.capitalize}, #{name}!"
 5 |     end
 6 |   end
 7 | 
 8 |   def method_missing(name, *args)
 9 |     "Method #{name} not defined"
10 |   end
11 | end
12 | 
13 | dg = DynamicGreeter.new
14 | puts dg.hello("Name")
15 | puts dg.foobar("X")
16 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_c/src/module.c:
--------------------------------------------------------------------------------

```cpp
 1 | #include "module.h"
 2 | #include "util.h"
 3 | 
 4 | static int s_secret = 42; // file-local static
 5 | 
 6 | void module_init(Mode m) {
 7 |     (void)m;
 8 |     s_secret = 42;
 9 | }
10 | 
11 | int module_compute(int base) {
12 | #if ENABLE_STATS
13 |     g_counter++;
14 | #endif
15 |     return clamp(base + s_secret, 0, 1000); // uses inline from util.h
16 | }
17 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/callbacks_decorators.py:
--------------------------------------------------------------------------------

```python
 1 | def executor(func, val):
 2 |     return func(val)
 3 | 
 4 | def square(x): return x * x
 5 | res = executor(square, 5)
 6 | 
 7 | def log_decorator(fn):
 8 |     def wrapper(*args, **kwargs):
 9 |         return fn(*args, **kwargs)
10 |     return wrapper
11 | 
12 | @log_decorator
13 | def hello(name): return f'Hello {name}'
14 | 
15 | msg = hello('Shashank')
16 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/comprehensions_generators.py:
--------------------------------------------------------------------------------

```python
 1 | def double(x): return x * 2
 2 | nums = [double(i) for i in range(5)]
 3 | gen = (double(i) for i in range(5))
 4 | values = list(gen)
 5 | words = ['apple', 'banana', 'pear']
 6 | sorted_words = sorted(words, key=len)
 7 | with open('temp.txt', 'w') as f:
 8 |     f.write('hello')
 9 | with open('temp.txt', 'r') as f:
10 |     data = f.read()
11 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_php/functions.php:
--------------------------------------------------------------------------------

```php
 1 | <?php
 2 | function greet($name, $age = 20) {
 3 |     return "Hello {$name}, you are {$age} years old";
 4 | }
 5 | 
 6 | function sumNumbers(...$nums) {
 7 |     return array_sum($nums);
 8 | }
 9 | 
10 | $double = function($n) {
11 |     return $n * 2;
12 | };
13 | 
14 | echo greet("Shashank", 21) . "\n";
15 | echo sumNumbers(1,2,3,4) . "\n";
16 | echo $double(5) . "\n";
17 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_java/src/com/example/app/model/User.java:
--------------------------------------------------------------------------------

```java
 1 | package com.example.app.model;
 2 | 
 3 | public class User {
 4 |     private final String name;
 5 |     private final Role role;
 6 | 
 7 |     public User(String name, Role role) {
 8 |         this.name = name;
 9 |         this.role = role;
10 |     }
11 |     public String getName() { return name; }
12 |     public Role getRole() { return role; }
13 | }
14 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_misc/styles.css:
--------------------------------------------------------------------------------

```css
 1 | body {
 2 |   font-family: Arial, sans-serif;
 3 |   background: #f9f9f9;
 4 |   color: #222;
 5 |   margin: 0;
 6 |   padding: 2rem;
 7 | }
 8 | h1 {
 9 |   color: #007acc;
10 | }
11 | button {
12 |   background: #007acc;
13 |   color: #fff;
14 |   border: none;
15 |   padding: 0.5rem 1rem;
16 |   border-radius: 4px;
17 |   cursor: pointer;
18 | }
19 | button:hover {
20 |   background: #005fa3;
21 | }
22 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/mapping_calls.py:
--------------------------------------------------------------------------------

```python
 1 | class Dispatcher:
 2 |     def __init__(self):
 3 |         self._map = {'start': self.start, 'stop': self.stop}
 4 | 
 5 |     def start(self): return 'started'
 6 |     def stop(self): return 'stopped'
 7 | 
 8 |     def call(self, cmd):
 9 |         return self._map[cmd]()
10 | 
11 | def use_dispatcher(cmd):
12 |     d = Dispatcher()
13 |     return d.call(cmd)
14 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_ruby/main.rb:
--------------------------------------------------------------------------------

```ruby
 1 | require_relative 'class_example'
 2 | require_relative 'inheritance_example'
 3 | require_relative 'module_example'
 4 | require_relative 'mixins_example'
 5 | 
 6 | puts "=== Ruby Sample Project ==="
 7 | 
 8 | greeter = Greeter.new("Name")
 9 | puts greeter.greet
10 | 
11 | dog = Dog.new("Rex")
12 | puts dog.speak
13 | 
14 | include MathTools
15 | puts "Square of 4: #{square(4)}"
16 | 
```

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

```typescript
 1 | import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
 2 | 
 3 | const Collapsible = CollapsiblePrimitive.Root;
 4 | 
 5 | const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
 6 | 
 7 | const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
 8 | 
 9 | export { Collapsible, CollapsibleTrigger, CollapsibleContent };
10 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/function_chains.py:
--------------------------------------------------------------------------------

```python
 1 | def f1(x): return x + 1
 2 | def f2(x): return x * 2
 3 | def f3(x): return x - 3
 4 | 
 5 | result = f1(f2(f3(10)))
 6 | 
 7 | text = '  Hello World  '
 8 | cleaned = text.strip().lower().replace('hello', 'hi')
 9 | 
10 | def make_adder(n):
11 |     def adder(x):
12 |         return x + n
13 |     return adder
14 | 
15 | adder5 = make_adder(5)
16 | result2 = adder5(10)
17 | result3 = make_adder(2)(8)
18 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_c/include/util.h:
--------------------------------------------------------------------------------

```
 1 | #ifndef UTIL_H
 2 | #define UTIL_H
 3 | 
 4 | #include <stddef.h>
 5 | 
 6 | extern int g_counter;          // extern variable
 7 | typedef struct { int x, y; } Point;
 8 | typedef int (*cmp_fn)(int, int); // function pointer typedef
 9 | 
10 | int max_int(int a, int b);
11 | static inline int clamp(int v, int lo, int hi) { return v < lo ? lo : (v > hi ? hi : v); }
12 | 
13 | #endif
14 | 
```

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

```typescript
 1 | "use client"
 2 | 
 3 | import * as React from "react"
 4 | import { ThemeProvider as NextThemesProvider } from "next-themes"
 5 | import { type ThemeProviderProps } from "next-themes/dist/types"
 6 | 
 7 | export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
 8 |   return <NextThemesProvider {...props}>{children}</NextThemesProvider>
 9 | }
10 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/file_io.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | // Demonstrates file I/O in C++
 2 | #include <iostream>
 3 | #include <fstream>
 4 | #include "function_chain.h"
 5 | 
 6 | 
 7 | void fileIODemo() {
 8 |     std::ofstream out("out.txt");
 9 |     out << "Hello, file!" << std::endl;
10 |     out.close();
11 |     functionChainDemo();
12 |     std::ifstream in("out.txt");
13 |     std::string line;
14 |     std::cout << line << std::endl;
15 | }
16 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/raii_example.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | // Demonstrates RAII (Resource Acquisition Is Initialization)
 2 | #include <iostream>
 3 | 
 4 | class File {
 5 | public:
 6 |     File(const char* name) { std::cout << "Opening " << name << std::endl; }
 7 |     ~File() { std::cout << "Closing file" << std::endl; }
 8 | };
 9 | 
10 | void raiiDemo() {
11 |     File f("test.txt");
12 |     std::cout << "Using file..." << std::endl;
13 | }
14 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_java/src/com/example/app/util/CollectionUtils.java:
--------------------------------------------------------------------------------

```java
 1 | package com.example.app.util;
 2 | 
 3 | import java.util.Collection;
 4 | 
 5 | public final class CollectionUtils {
 6 |     private CollectionUtils() {}
 7 | 
 8 |     public static <T extends Number> int sumOfSquares(Collection<T> nums) {
 9 |         return nums.stream().mapToInt(n -> {
10 |             int v = n.intValue();
11 |             return v * v;
12 |         }).sum();
13 |     }
14 | }
15 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_php/Inheritance.php:
--------------------------------------------------------------------------------

```php
 1 | <?php
 2 | abstract class Animal {
 3 |     abstract public function sound();
 4 | }
 5 | 
 6 | class Dog extends Animal {
 7 |     public function sound() {
 8 |         return "Woof!";
 9 |     }
10 | }
11 | 
12 | class Cat extends Animal {
13 |     public function sound() {
14 |         return "Meow!";
15 |     }
16 | }
17 | 
18 | $dog = new Dog();
19 | $cat = new Cat();
20 | 
21 | echo $dog->sound() . "\n";
22 | echo $cat->sound() . "\n";
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/exporter.js:
--------------------------------------------------------------------------------

```javascript
 1 | export function exportedFunction() {
 2 |     return "This is an exported function.";
 3 | }
 4 | 
 5 | export class ExportedClass {
 6 |     constructor() {
 7 |         this.name = "ExportedClass";
 8 |     }
 9 | }
10 | 
11 | export default function defaultExportedFunction() {
12 |     return "This is a default exported function.";
13 | }
14 | 
15 | export const exportedVariable = "This is an exported variable.";
16 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_misc/index.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>Sample Misc Project</title>
 7 |   <link rel="stylesheet" href="styles.css">
 8 | </head>
 9 | <body>
10 |   <h1>Hello, World!</h1>
11 |   <p id="message">This is a sample HTML file for the sample misc test.</p>
12 | </body>
13 | </html>
14 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_php/classes_objects.php:
--------------------------------------------------------------------------------

```php
 1 | <?php
 2 | class Person {
 3 |     public $name;
 4 |     public $age;
 5 |     
 6 |     function __construct($name, $age) {
 7 |         $this->name = $name;
 8 |         $this->age = $age;
 9 |     }
10 |     
11 |     function introduce() {
12 |         return "Hi, I'm {$this->name} and I'm {$this->age} years old";
13 |     }
14 | }
15 | 
16 | $shashank = new Person("Shashank", 22);
17 | echo $shashank->introduce() . "\n";
```

--------------------------------------------------------------------------------
/tests/sample_project/generators.py:
--------------------------------------------------------------------------------

```python
 1 | def gen_numbers(n):
 2 |     for i in range(n):
 3 |         yield i
 4 | 
 5 | async def agen_numbers(n):
 6 |     for i in range(n):
 7 |         yield i
 8 | 
 9 | async def async_with_example():
10 |     async with AsyncCM() as val:
11 |         return val
12 | 
13 | class AsyncCM:
14 |     async def __aenter__(self): return 'async_entered'
15 |     async def __aexit__(self, exc_type, exc_val, exc_tb): return False
16 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/cli_and_dunder.py:
--------------------------------------------------------------------------------

```python
 1 | import argparse
 2 | import advanced_functions
 3 | 
 4 | def run(argv=None):
 5 |     parser = argparse.ArgumentParser(prog='cli_and_dunder')
 6 |     parser.add_argument('--a', type=int, default=1)
 7 |     parser.add_argument('--b', type=int, default=2)
 8 |     ns = parser.parse_args(argv)
 9 |     print(advanced_functions.with_defaults(ns.a, ns.b))
10 | 
11 | if __name__ == '__main__':
12 |     run()
13 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/templates.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | // Demonstrates templates and specialization
 2 | #include <iostream>
 3 | 
 4 | template<typename T>
 5 | T add(T a, T b) { return a + b; }
 6 | 
 7 | template<>
 8 | std::string add(std::string a, std::string b) { return a + " (specialized) " + b; }
 9 | 
10 | void templateDemo() {
11 |     std::cout << add(2, 3) << std::endl;
12 |     std::cout << add(std::string("foo"), std::string("bar")) << std::endl;
13 | }
14 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_php/globals_superglobals.php:
--------------------------------------------------------------------------------

```php
 1 | <?php
 2 | // simulating for learning purposes
 3 | $_GET['name'] = "Shashank";
 4 | $_POST['age'] = 22;
 5 | 
 6 | // always validate user input
 7 | $name = htmlspecialchars($_GET['name']);
 8 | $age = filter_var($_POST['age'], FILTER_VALIDATE_INT);
 9 | 
10 | echo $name . "\n";
11 | echo $age . "\n";
12 | 
13 | $GLOBALS['x'] = 10;
14 | 
15 | function addFive(): void {
16 |     $GLOBALS['x'] += 5;
17 | }
18 | 
19 | addFive();
20 | echo $GLOBALS['x'] . "\n";
```

--------------------------------------------------------------------------------
/website/tsconfig.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |   "files": [],
 3 |   "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }],
 4 |   "compilerOptions": {
 5 |     "baseUrl": ".",
 6 |     "paths": {
 7 |       "@/*": ["./src/*"]
 8 |     },
 9 |     "noImplicitAny": false,
10 |     "noUnusedParameters": false,
11 |     "skipLibCheck": true,
12 |     "allowJs": true,
13 |     "noUnusedLocals": false,
14 |     "strictNullChecks": false
15 |   }
16 | }
17 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_java/src/com/example/app/service/impl/GreetingServiceImpl.java:
--------------------------------------------------------------------------------

```java
 1 | package com.example.app.service.impl;
 2 | 
 3 | import com.example.app.model.User;
 4 | import com.example.app.service.AbstractGreeter;
 5 | import com.example.app.service.GreetingService;
 6 | 
 7 | public class GreetingServiceImpl extends AbstractGreeter implements GreetingService {
 8 |     @Override
 9 |     public String greet(User user) {
10 |         return base(user) + " (" + user.getRole() + ")";
11 |     }
12 | }
13 | 
```

--------------------------------------------------------------------------------
/website/api/pypi.ts:
--------------------------------------------------------------------------------

```typescript
 1 | // api/pypi.ts
 2 | 
 3 | export default async function handler(req: any, res: any) {
 4 |   const path = req.url?.replace("/api/pypi", "") || "";
 5 | 
 6 |   try {
 7 |     const response = await fetch(`https://pypistats.org/api${path}`);
 8 |     const data = await response.json();
 9 |     res.status(200).json(data);
10 |   } catch (err) {
11 |     res.status(500).json({ error: "Failed to fetch PyPI stats" });
12 |   }
13 | }
14 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/classes.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | // Demonstrates classes, inheritance, and polymorphism
 2 | #include <iostream>
 3 | 
 4 | class Animal {
 5 | public:
 6 |     virtual void speak() const { std::cout << "Animal sound\n"; }
 7 |     virtual ~Animal() = default;
 8 | };
 9 | 
10 | class Dog : public Animal {
11 | public:
12 |     void speak() const override { std::cout << "Woof!\n"; }
13 | };
14 | 
15 | void classDemo() {
16 |     Animal* a = new Dog();
17 |     a->speak();
18 |     delete a;
19 | }
20 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/class_instantiation.py:
--------------------------------------------------------------------------------

```python
 1 | class A:
 2 |     def greet(self): return 'Hello from A'
 3 | 
 4 | class B(A):
 5 |     def greet(self): return super().greet() + ' + B'
 6 | 
 7 | obj = A()
 8 | msg1 = obj.greet()
 9 | obj2 = B()
10 | msg2 = obj2.greet() 
11 | 
12 | class Fluent:
13 |     def step1(self): return self
14 |     def step2(self): return self
15 |     def step3(self): return self
16 | 
17 | f = Fluent().step1().step2().step3()
18 | 
19 | obj2.dynamic = lambda x: x * 2
20 | val = obj2.dynamic(10)
21 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/control_flow.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | // Demonstrates control flow constructs in C++
 2 | #include <iostream>
 3 | 
 4 | void controlFlow(int x) {
 5 |     if (x > 0) std::cout << "positive\n";
 6 |     else if (x == 0) std::cout << "zero\n";
 7 |     else std::cout << "negative\n";
 8 | 
 9 |     std::cout << ((x > 0) ? "pos" : "non-pos") << std::endl;
10 | 
11 |     for (int i = 0; i < 3; ++i) std::cout << i << ' ';
12 |     std::cout << std::endl;
13 | }
14 | 
15 | // ...existing code...
16 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/exceptions.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | // Demonstrates exception handling in C++
 2 | #include <iostream>
 3 | #include <stdexcept>
 4 | 
 5 | void exceptionDemo(int x) {
 6 |     try {
 7 |         if (x == 0) throw std::invalid_argument("zero");
 8 |         std::cout << 10 / x << std::endl;
 9 |     } catch (const std::invalid_argument& e) {
10 |         std::cout << e.what() << std::endl;
11 |     } catch (...) {
12 |         std::cout << "Unknown error" << std::endl;
13 |     }
14 | }
15 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/dynamic_imports.py:
--------------------------------------------------------------------------------

```python
 1 | import importlib
 2 | 
 3 | def import_optional():
 4 |     try:
 5 |         import ujson as json
 6 |     except ImportError:
 7 |         import json
 8 |     return json.dumps({'a': 1})
 9 | 
10 | def import_by___import__(name):
11 |     mod = __import__(name)
12 |     return getattr(mod, 'platform', None)
13 | 
14 | def importlib_runtime(name, attr=None):
15 |     mod = importlib.import_module(name)
16 |     if attr:
17 |         return getattr(mod, attr)
18 |     return mod
19 | 
```

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

```python
 1 | def connect_to_service():
 2 |     password = "supersecret123"
 3 |     api_key = "AKIAIOSFODNN7EXAMPLE"
 4 |     secret_token = "ghp_16charactertoken"
 5 |     # Simulate usage
 6 |     print("Connecting with password:", password)
 7 |     print("Using API key:", api_key)
 8 |     print("Token:", secret_token)
 9 |     return True
10 | 
11 | def harmless_function():
12 |     value = 42
13 |     print("This function does not use secrets.")
14 |     return value
```

--------------------------------------------------------------------------------
/tests/sample_project_java/sources.txt:
--------------------------------------------------------------------------------

```
 1 | src/com/example/app/misc/Outer.java
 2 | src/com/example/app/util/IOHelper.java
 3 | src/com/example/app/util/CollectionUtils.java
 4 | src/com/example/app/annotations/Logged.java
 5 | src/com/example/app/Main.java
 6 | src/com/example/app/model/User.java
 7 | src/com/example/app/model/Role.java
 8 | src/com/example/app/service/impl/GreetingServiceImpl.java
 9 | src/com/example/app/service/AbstractGreeter.java
10 | src/com/example/app/service/GreetingService.java
11 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_javascript/importer.js:
--------------------------------------------------------------------------------

```javascript
 1 | import defaultExport, { exportedFunction, ExportedClass, exportedVariable as myVar } from './exporter.js';
 2 | import * as exporter from './exporter.js';
 3 | const { exportedFunction: destructuredFunc } = exporter;
 4 | 
 5 | console.log(defaultExport());
 6 | console.log(exportedFunction());
 7 | const instance = new ExportedClass();
 8 | console.log(instance.name);
 9 | console.log(myVar);
10 | console.log(exporter.exportedVariable);
11 | console.log(destructuredFunc());
12 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_java/src/com/example/app/misc/Outer.java:
--------------------------------------------------------------------------------

```java
 1 | package com.example.app.misc;
 2 | 
 3 | public class Outer {
 4 |     private final String name;
 5 |     public Outer(String name) { this.name = name; }
 6 | 
 7 |     public class Inner {
 8 |         private final String name;
 9 |         public Inner(String name) { this.name = name; }
10 |         public String combine() {
11 |             Thread t = new Thread(() -> { /* no-op */ });
12 |             t.start();
13 |             return Outer.this.name + "+" + this.name;
14 |         }
15 |     }
16 | }
17 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_php/interface_traits.php:
--------------------------------------------------------------------------------

```php
 1 | <?php
 2 | interface Greeter {
 3 |     public function greet();
 4 | }
 5 | 
 6 | trait Logger {
 7 |     public function log($msg) {
 8 |         echo "[LOG] $msg\n";
 9 |     }
10 | }
11 | 
12 | class Human implements Greeter {
13 |     use Logger;
14 |     public $name;
15 |     
16 |     public function __construct($name) {
17 |         $this->name = $name;
18 |     }
19 |     
20 |     public function greet() {
21 |         return "Hello, I am {$this->name}";
22 |     }
23 | }
24 | 
25 | $shashank = new Human("Shashank");
26 | echo $shashank->greet() . "\n";
27 | $shashank->log("Greeting done");
```

--------------------------------------------------------------------------------
/tests/sample_project/complex_classes.py:
--------------------------------------------------------------------------------

```python
 1 | class Base:
 2 |     def greet(self):
 3 |         return "hello"
 4 | 
 5 | class Child(Base):
 6 |     def greet(self):
 7 |         return super().greet() + " world"
 8 | 
 9 |     @staticmethod
10 |     def static_method(x):
11 |         return x * 2
12 | 
13 |     @classmethod
14 |     def class_method(cls, y):
15 |         return cls().greet(cls()) + str(y)
16 | 
17 | def decorator(func):
18 |     def wrapper(*args, **kwargs):
19 |         return "decorated: " + str(func(*args, **kwargs))
20 |     return wrapper
21 | 
22 | @decorator
23 | def decorated_function(x):
24 |     return x + 10
25 | 
```

--------------------------------------------------------------------------------
/docs/mkdocs.yml:
--------------------------------------------------------------------------------

```yaml
 1 | site_name: CodeGraphContext
 2 | theme:
 3 |   name: material
 4 | nav:
 5 |   - Home: index.md
 6 |   - Installation: installation.md
 7 |   - Use Cases: use_cases.md
 8 |   - Architecture: architecture.md
 9 |   - CLI Reference: cli.md
10 |   - Server: server.md
11 |   - Core Concepts: core.md
12 |   - Tools: tools.md
13 |   - Cookbook: cookbook.md
14 |   - Contributing:
15 |     - Overview: contributing.md
16 |     - Adding New Languages: contributing_languages.md
17 |   - Troubleshooting: troubleshooting.md
18 |   - Future Work: future_work.md
19 |   - License: license.md
```

--------------------------------------------------------------------------------
/tests/sample_project/advanced_classes.py:
--------------------------------------------------------------------------------

```python
 1 | from abc import ABC, abstractmethod
 2 | 
 3 | class A:
 4 |     def foo(self): return 'A'
 5 | 
 6 | class B:
 7 |     def foo(self): return 'B'
 8 | 
 9 | class C(A, B):
10 |     def bar(self): return 'C'
11 | 
12 | class AbstractThing(ABC):
13 |     @abstractmethod
14 |     def do(self): pass
15 | 
16 | class ConcreteThing(AbstractThing):
17 |     def do(self): return 'done'
18 | 
19 | class Meta(type):
20 |     def __new__(mcls, name, bases, dct):
21 |         dct['created_by_meta'] = True
22 |         return super().__new__(mcls, name, bases, dct)
23 | 
24 | class WithMeta(metaclass=Meta):
25 |     pass
26 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_java/src/com/example/app/util/IOHelper.java:
--------------------------------------------------------------------------------

```java
 1 | package com.example.app.util;
 2 | 
 3 | import java.io.BufferedReader;
 4 | import java.io.FileReader;
 5 | import java.io.IOException;
 6 | 
 7 | public final class IOHelper {
 8 |     private IOHelper() {}
 9 | 
10 |     public static String readFirstLine(String path) {
11 |         try (BufferedReader br = new BufferedReader(new FileReader(path))) {
12 |             String line = br.readLine();
13 |             return line == null ? "" : line;
14 |         } catch (IOException e) {
15 |             throw new RuntimeException("unable to read: " + path, e);
16 |         }
17 |     }
18 | }
19 | 
```

--------------------------------------------------------------------------------
/website/components.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |   "$schema": "https://ui.shadcn.com/schema.json",
 3 |   "style": "default",
 4 |   "rsc": false,
 5 |   "tsx": true,
 6 |   "tailwind": {
 7 |     "config": "tailwind.config.ts",
 8 |     "css": "src/index.css",
 9 |     "baseColor": "slate",
10 |     "cssVariables": true,
11 |     "prefix": ""
12 |   },
13 |   "iconLibrary": "lucide",
14 |   "aliases": {
15 |     "components": "@/components",
16 |     "utils": "@/lib/utils",
17 |     "ui": "@/components/ui",
18 |     "lib": "@/lib",
19 |     "hooks": "@/hooks"
20 |   },
21 |   "registries": {
22 |     "@magicui": "https://magicui.design/r/{name}.json"
23 |   }
24 | }
25 | 
```

--------------------------------------------------------------------------------
/docs/docs/future_work.md:
--------------------------------------------------------------------------------

```markdown
1 | # Ongoing Concerns and Future Work
2 | 
3 | This page outlines some of the current limitations of CodeGraphContext and areas for future development.
4 | 
5 | ## Semantic Search
6 | 
7 | The tool is smart enough to find and analyze a function through millions of code files, but the tool is not yet smart enough to understand that a user searching for “calculate_sum” is also intending to look at the “calculate_addition” function. This level of semantic similarity needs to be researched, developed, tested and eventually implemented by our tool.
8 | 
```

--------------------------------------------------------------------------------
/website/tsconfig.node.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |   "compilerOptions": {
 3 |     "target": "ES2022",
 4 |     "lib": ["ES2015"],
 5 |     "forceConsistentCasingInFileNames": true,
 6 |     "module": "ESNext",
 7 |     "skipLibCheck": true,
 8 | 
 9 |     /* Bundler mode */
10 |     "moduleResolution": "bundler",
11 |     "allowImportingTsExtensions": true,
12 |     "isolatedModules": true,
13 |     "moduleDetection": "force",
14 |     "noEmit": true,
15 | 
16 |     /* Linting */
17 |     "strict": true,
18 |     "noUnusedLocals": false,
19 |     "noUnusedParameters": false,
20 |     "noFallthroughCasesInSwitch": true
21 |   },
22 |   "include": ["vite.config.ts"]
23 | }
24 | 
```

--------------------------------------------------------------------------------
/website/vite.config.ts:
--------------------------------------------------------------------------------

```typescript
 1 | import { defineConfig } from "vite";
 2 | import react from "@vitejs/plugin-react-swc";
 3 | import path from "path";
 4 | 
 5 | // https://vitejs.dev/config/
 6 | export default defineConfig(({ mode }) => ({
 7 |   server: {
 8 |     host: "::",
 9 |     port: 8080,
10 |     proxy: {
11 |       "/api/pypi": {
12 |         target: "https://pypistats.org",
13 |         changeOrigin: true,
14 |         rewrite: (path) => path.replace(/^\/api\/pypi/, "/api"),
15 |       },
16 |     },
17 |   },
18 |   plugins: [react()].filter(Boolean),
19 |   resolve: {
20 |     alias: {
21 |       "@": path.resolve(__dirname, "./src"),
22 |     },
23 |   },
24 | }));
25 | 
```

--------------------------------------------------------------------------------
/.github/workflows/e2e-tests.yml:
--------------------------------------------------------------------------------

```yaml
 1 | name: End-to-end Tests
 2 | 
 3 | on:
 4 |   push:
 5 |     branches: [ main ]
 6 |   pull_request:
 7 |     branches: [ main ]
 8 | 
 9 | jobs:
10 |   test:
11 |     runs-on: ubuntu-latest
12 | 
13 |     steps:
14 |     - name: Check out code
15 |       uses: actions/checkout@v3
16 | 
17 |     - name: Set up Python
18 |       uses: actions/setup-python@v4
19 |       with:
20 |         python-version: '3.10'
21 | 
22 |     - name: Install dependencies
23 |       run: |
24 |         python -m pip install --upgrade pip
25 |         pip install -e .
26 |         pip install pytest
27 | 
28 |     - name: Run end-to-end tests
29 |       run: |
30 |         pytest -s tests/test_end_to_end.py
31 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/enum_struct_union.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | enum Color {
 2 |     RED = 0,
 3 |     GREEN = 1,
 4 |     BLUE = 2
 5 | };
 6 | 
 7 | enum class Direction {
 8 |     NORTH = 0,
 9 |     EAST = 1,
10 |     SOUTH = 2,
11 |     WEST = 3
12 | };
13 | 
14 | struct MyStruct {
15 |     int x = 5;
16 |     float y = 3.14f;
17 | 
18 |     void doSomething();
19 | };
20 | 
21 | void MyStruct::doSomething() {
22 |     x += 1;
23 |     y *= 2.0f;
24 | }
25 | 
26 | union MyUnion {
27 |     int intValue;
28 |     float floatValue;
29 | };
30 | 
31 | int main() {
32 |     // enum
33 |     Color color = RED;
34 |     Direction dir = Direction::NORTH;
35 | 
36 |     // struct
37 |     MyStruct s;
38 |     s.doSomething();
39 | 
40 | 
41 |     // union
42 |     MyUnion u;
43 |     u.intValue = 42;
44 | 
45 |     return 0;
46 | }
47 | 
```

--------------------------------------------------------------------------------
/website/src/hooks/use-mobile.tsx:
--------------------------------------------------------------------------------

```typescript
 1 | import * as React from "react";
 2 | 
 3 | const MOBILE_BREAKPOINT = 768;
 4 | 
 5 | export function useIsMobile() {
 6 |   const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined);
 7 | 
 8 |   React.useEffect(() => {
 9 |     const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
10 |     const onChange = () => {
11 |       setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
12 |     };
13 |     mql.addEventListener("change", onChange);
14 |     setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
15 |     return () => mql.removeEventListener("change", onChange);
16 |   }, []);
17 | 
18 |   return !!isMobile;
19 | }
20 | 
```

--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------

```yaml
 1 | name: Build Test
 2 | 
 3 | on:
 4 |   push:
 5 |     branches:
 6 |       - main
 7 |   pull_request:
 8 |   schedule:
 9 |     - cron: "30 18 * * *"
10 |   workflow_dispatch:  
11 | 
12 | jobs:
13 |   build:
14 |     runs-on: ubuntu-latest
15 | 
16 |     steps:
17 |       - name: Checkout repository
18 |         uses: actions/checkout@v4
19 | 
20 |       - name: Set up Python
21 |         uses: actions/setup-python@v5
22 |         with:
23 |           python-version: "3.11"
24 | 
25 |       - name: Install dependencies
26 |         run: |
27 |           python -m pip install --upgrade pip
28 |           pip install build
29 |           pip install .[dev]
30 | 
31 |       - name: Build package
32 |         run: python -m build
33 | 
```

--------------------------------------------------------------------------------
/website/src/App.css:
--------------------------------------------------------------------------------

```css
 1 | #root {
 2 |   max-width: 1280px;
 3 |   margin: 0 auto;
 4 |   padding: 2rem;
 5 |   text-align: center;
 6 | }
 7 | 
 8 | .logo {
 9 |   height: 6em;
10 |   padding: 1.5em;
11 |   will-change: filter;
12 |   transition: filter 300ms;
13 | }
14 | .logo:hover {
15 |   filter: drop-shadow(0 0 2em #646cffaa);
16 | }
17 | .logo.react:hover {
18 |   filter: drop-shadow(0 0 2em #61dafbaa);
19 | }
20 | 
21 | @keyframes logo-spin {
22 |   from {
23 |     transform: rotate(0deg);
24 |   }
25 |   to {
26 |     transform: rotate(360deg);
27 |   }
28 | }
29 | 
30 | @media (prefers-reduced-motion: no-preference) {
31 |   a:nth-of-type(2) .logo {
32 |     animation: logo-spin infinite 20s linear;
33 |   }
34 | }
35 | 
36 | .card {
37 |   padding: 2em;
38 | }
39 | 
40 | .read-the-docs {
41 |   color: #888;
42 | }
43 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_php/database.php:
--------------------------------------------------------------------------------

```php
 1 | <?php
 2 | $dsn = "mysql:host=localhost;dbname=testdb";
 3 | $user = "root";
 4 | $pass = "";
 5 | 
 6 | try {
 7 |     $pdo = new PDO($dsn, $user, $pass);
 8 |     $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 9 |     
10 |     $pdo->exec("CREATE TABLE IF NOT EXISTS users(id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50))");
11 |     
12 |     $stmt = $pdo->prepare("INSERT INTO users(name) VALUES(:name)");
13 |     $stmt->execute(['name' => 'Shashank']);
14 |     
15 |     $result = $pdo->query("SELECT * FROM users");
16 |     foreach($result as $row) {
17 |         echo $row['name'] . "\n";
18 |     }
19 | } catch(PDOException $e) {
20 |     echo "DB Error: " . $e->getMessage() . "\n";
21 | }
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/class_features.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | #include <string>
 2 | 
 3 | // Tests for access specifiers
 4 | class AccessSpecifierTests {
 5 | public:
 6 |     AccessSpecifierTests() : publicData(10), protectedValue(20), privateData("default") {}
 7 | 
 8 |     void publicMethod() {/* ... */}
 9 | 
10 | protected:
11 |     int protectedValue;
12 |     void protectedMethod() {/* ... */}
13 | 
14 | private:
15 |     std::string privateData;
16 |     void privateMethod() {/* ... */}
17 | 
18 | public:
19 |     int publicData;
20 | };
21 | 
22 | // Tests for constructors and destructors
23 | class ConstructorDestructorTests {
24 | public:
25 |     ConstructorDestructorTests() : exampleData(100) {}
26 |     ~ConstructorDestructorTests() {/* ... */}
27 | 
28 |     void exampleMethod() {/* ... */}
29 | 
30 | private:
31 |     int exampleData;
32 | };
33 | 
34 | 
```

--------------------------------------------------------------------------------
/website/tsconfig.app.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |   "compilerOptions": {
 3 |     "target": "ES2020",
 4 |     "useDefineForClassFields": true,
 5 |     "lib": ["ES2020", "DOM", "DOM.Iterable"],
 6 |     "module": "ESNext",
 7 |     "skipLibCheck": true,
 8 | 
 9 |     /* Bundler mode */
10 |     "moduleResolution": "bundler",
11 |     "allowImportingTsExtensions": true,
12 |     "isolatedModules": true,
13 |     "moduleDetection": "force",
14 |     "noEmit": true,
15 |     "jsx": "react-jsx",
16 | 
17 |     /* Linting */
18 |     "strict": false,
19 |     "noUnusedLocals": false,
20 |     "noUnusedParameters": false,
21 |     "noImplicitAny": false,
22 |     "noFallthroughCasesInSwitch": false,
23 | 
24 |     "baseUrl": ".",
25 |     "paths": {
26 |       "@/*": ["./src/*"]
27 |     }
28 |   },
29 |   "include": ["src", "api"]
30 | }
31 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as LabelPrimitive from "@radix-ui/react-label";
 3 | import { cva, type VariantProps } from "class-variance-authority";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | 
 7 | const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
 8 | 
 9 | const Label = React.forwardRef<
10 |   React.ElementRef<typeof LabelPrimitive.Root>,
11 |   React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>
12 | >(({ className, ...props }, ref) => (
13 |   <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />
14 | ));
15 | Label.displayName = LabelPrimitive.Root.displayName;
16 | 
17 | export { Label };
18 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as SeparatorPrimitive from "@radix-ui/react-separator";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const Separator = React.forwardRef<
 7 |   React.ElementRef<typeof SeparatorPrimitive.Root>,
 8 |   React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
 9 | >(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => (
10 |   <SeparatorPrimitive.Root
11 |     ref={ref}
12 |     decorative={decorative}
13 |     orientation={orientation}
14 |     className={cn("shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className)}
15 |     {...props}
16 |   />
17 | ));
18 | Separator.displayName = SeparatorPrimitive.Root.displayName;
19 | 
20 | export { Separator };
21 | 
```

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

```typescript
 1 | import { useLocation } from "react-router-dom";
 2 | import { useEffect } from "react";
 3 | 
 4 | const NotFound = () => {
 5 |   const location = useLocation();
 6 | 
 7 |   useEffect(() => {
 8 |     console.error("404 Error: User attempted to access non-existent route:", location.pathname);
 9 |   }, [location.pathname]);
10 | 
11 |   return (
12 |     <div className="flex min-h-screen items-center justify-center bg-gray-100">
13 |       <div className="text-center">
14 |         <h1 className="mb-4 text-4xl font-bold">404</h1>
15 |         <p className="mb-4 text-xl text-gray-600">Oops! Page not found</p>
16 |         <a href="/" className="text-blue-500 underline hover:text-blue-700">
17 |           Return to Home
18 |         </a>
19 |       </div>
20 |     </div>
21 |   );
22 | };
23 | 
24 | export default NotFound;
25 | 
```

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

```typescript
 1 | import { useToast } from "@/hooks/use-toast";
 2 | import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport } from "@/components/ui/toast";
 3 | 
 4 | export function Toaster() {
 5 |   const { toasts } = useToast();
 6 | 
 7 |   return (
 8 |     <ToastProvider>
 9 |       {toasts.map(function ({ id, title, description, action, ...props }) {
10 |         return (
11 |           <Toast key={id} {...props}>
12 |             <div className="grid gap-1">
13 |               {title && <ToastTitle>{title}</ToastTitle>}
14 |               {description && <ToastDescription>{description}</ToastDescription>}
15 |             </div>
16 |             {action}
17 |             <ToastClose />
18 |           </Toast>
19 |         );
20 |       })}
21 |       <ToastViewport />
22 |     </ToastProvider>
23 |   );
24 | }
25 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_php/generators_iterators.php:
--------------------------------------------------------------------------------

```php
 1 | <?php
 2 | function numbers(int $n): Generator {
 3 |     for($i = 0; $i < $n; $i++) {
 4 |         yield $i;
 5 |     }
 6 | }
 7 | 
 8 | foreach(numbers(5) as $num) {
 9 |     echo $num . "\n";
10 | }
11 | 
12 | class MyIterator implements Iterator {
13 |     private array $items = ["apple", "banana", "cherry"];
14 |     private int $pos = 0;
15 |     
16 |     public function current(): mixed { 
17 |         return $this->items[$this->pos]; 
18 |     }
19 |     public function key(): int { 
20 |         return $this->pos; 
21 |     }
22 |     public function next(): void { 
23 |         $this->pos++; 
24 |     }
25 |     public function rewind(): void { 
26 |         $this->pos = 0; 
27 |     }
28 |     public function valid(): bool { 
29 |         return isset($this->items[$this->pos]); 
30 |     }
31 | }
32 | 
33 | $it = new MyIterator();
34 | foreach($it as $v) {
35 |     echo $v . "\n";
36 | }
```

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

```typescript
 1 | import * as React from "react";
 2 | 
 3 | import { cn } from "@/lib/utils";
 4 | 
 5 | export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
 6 | 
 7 | const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(({ className, ...props }, ref) => {
 8 |   return (
 9 |     <textarea
10 |       className={cn(
11 |         "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
12 |         className,
13 |       )}
14 |       ref={ref}
15 |       {...props}
16 |     />
17 |   );
18 | });
19 | Textarea.displayName = "Textarea";
20 | 
21 | export { Textarea };
22 | 
```

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

```javascript
1 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.vi=function(){this.pipeline.reset(),this.pipeline.add(e.vi.stopWordFilter,e.vi.trimmer)},e.vi.wordCharacters="[A-Za-ẓ̀͐́͑̉̃̓ÂâÊêÔôĂ-ăĐ-đƠ-ơƯ-ư]",e.vi.trimmer=e.trimmerSupport.generateTrimmer(e.vi.wordCharacters),e.Pipeline.registerFunction(e.vi.trimmer,"trimmer-vi"),e.vi.stopWordFilter=e.generateStopWordFilter("là cái nhưng mà".split(" "))}});
```

--------------------------------------------------------------------------------
/tests/sample_project_c/src/main.c:
--------------------------------------------------------------------------------

```cpp
 1 | #include <stdio.h>
 2 | #include "config.h"
 3 | #include "platform.h"
 4 | #include "util.h"
 5 | #include "math/vec.h"
 6 | #include "module.h"
 7 | 
 8 | static int cmp_desc(int a, int b) { return b - a; } // matches cmp_fn typedef shape
 9 | 
10 | int main(void) {
11 |     module_init(MODE_A);
12 | 
13 |     Point p = { .x = 3, .y = 4 };
14 |     Vec3 v = {1,2,3}, w = {4,5,6};
15 |     Vec3 sum = vec_add(v, w);
16 | 
17 |     int m = max_int(p.x, p.y);
18 |     int r = module_compute(m);
19 | 
20 | #ifdef CGC_PLATFORM_WINDOWS
21 |     printf("%s %s (win) r=%d sum=(%.0f,%.0f,%.0f)\n", APP_NAME, APP_VERSION, r, sum.x, sum.y, sum.z);
22 | #else
23 |     printf("%s %s (posix) r=%d sum=(%.0f,%.0f,%.0f)\n", APP_NAME, APP_VERSION, r, sum.x, sum.y, sum.z);
24 | #endif
25 | 
26 |     // use function pointer typedef
27 |     cmp_fn f = cmp_desc;
28 |     return f(r, g_counter) < 0 ? 0 : 1;
29 | }
30 | 
```

--------------------------------------------------------------------------------
/website/eslint.config.js:
--------------------------------------------------------------------------------

```javascript
 1 | import js from "@eslint/js";
 2 | import globals from "globals";
 3 | import reactHooks from "eslint-plugin-react-hooks";
 4 | import reactRefresh from "eslint-plugin-react-refresh";
 5 | import tseslint from "typescript-eslint";
 6 | 
 7 | export default tseslint.config(
 8 |   { ignores: ["dist"] },
 9 |   {
10 |     extends: [js.configs.recommended, ...tseslint.configs.recommended],
11 |     files: ["**/*.{ts,tsx}"],
12 |     languageOptions: {
13 |       ecmaVersion: 2020,
14 |       globals: globals.browser,
15 |     },
16 |     plugins: {
17 |       "react-hooks": reactHooks,
18 |       "react-refresh": reactRefresh,
19 |     },
20 |     rules: {
21 |       ...reactHooks.configs.recommended.rules,
22 |       "react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
23 |       "@typescript-eslint/no-unused-vars": "off",
24 |     },
25 |   },
26 | );
27 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as ProgressPrimitive from "@radix-ui/react-progress";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const Progress = React.forwardRef<
 7 |   React.ElementRef<typeof ProgressPrimitive.Root>,
 8 |   React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
 9 | >(({ className, value, ...props }, ref) => (
10 |   <ProgressPrimitive.Root
11 |     ref={ref}
12 |     className={cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className)}
13 |     {...props}
14 |   >
15 |     <ProgressPrimitive.Indicator
16 |       className="h-full w-full flex-1 bg-primary transition-all"
17 |       style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
18 |     />
19 |   </ProgressPrimitive.Root>
20 | ));
21 | Progress.displayName = ProgressPrimitive.Root.displayName;
22 | 
23 | export { Progress };
24 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | 
 3 | import { cn } from "@/lib/utils";
 4 | 
 5 | const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
 6 |   ({ className, type, ...props }, ref) => {
 7 |     return (
 8 |       <input
 9 |         type={type}
10 |         className={cn(
11 |           "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12 |           className,
13 |         )}
14 |         ref={ref}
15 |         {...props}
16 |       />
17 |     );
18 |   },
19 | );
20 | Input.displayName = "Input";
21 | 
22 | export { Input };
23 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/advanced_classes2.py:
--------------------------------------------------------------------------------

```python
 1 | from dataclasses import dataclass
 2 | from enum import Enum
 3 | 
 4 | class Base: pass
 5 | class Mid(Base): pass
 6 | class Final(Mid): pass
 7 | 
 8 | class Mixin1:
 9 |     def m1(self): return 'm1'
10 | class Mixin2:
11 |     def m2(self): return 'm2'
12 | 
13 | class Combined(Mixin1, Mixin2, Base):
14 |     def both(self): return self.m1() + self.m2()
15 | 
16 | c = Combined()
17 | res = c.both()
18 | 
19 | @dataclass
20 | class Point:
21 |     x: int
22 |     y: int
23 |     def magnitude(self): return (self.x ** 2 + self.y ** 2) ** 0.5
24 | 
25 | p = Point(3,4)
26 | dist = p.magnitude()
27 | 
28 | class Color(Enum):
29 |     RED = 1
30 |     BLUE = 2
31 |     def is_primary(self): return self in {Color.RED, Color.BLUE}
32 | 
33 | flag = Color.RED.is_primary()
34 | 
35 | def handle(val):
36 |     match val:
37 |         case Point(x, y):
38 |             return f'Point with magnitude {val.magnitude()}'
39 |         case _:
40 |             return 'Unknown'
41 | msg = handle(p)
42 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/control_flow.py:
--------------------------------------------------------------------------------

```python
 1 | import os
 2 | 
 3 | def choose_path(x):
 4 |     if x > 0: return 'positive'
 5 |     elif x == 0: return 'zero'
 6 |     else: return 'negative'
 7 | 
 8 | def ternary(x):
 9 |     return 'pos' if x > 0 else 'non-pos'
10 | 
11 | def try_except_finally(x):
12 |     try:
13 |         if x == 0:
14 |             raise ValueError('zero')
15 |         return 10 / x
16 |     except ValueError as e:
17 |         return str(e)
18 |     except Exception:
19 |         return None
20 |     finally:
21 |         _ = 'cleaned'
22 | 
23 | def conditional_inner_import(use_numpy=False):
24 |     if use_numpy:
25 |         import numpy as np
26 |         return np.array([1, 2, 3])
27 |     else:
28 |         return [1, 2, 3]
29 | 
30 | def env_based_import():
31 |     if os.getenv('USE_UJSON') == '1':
32 |         try:
33 |             import ujson as json
34 |         except Exception:
35 |             import json
36 |     else:
37 |         import json
38 |     return json.dumps({'a': 1})
39 | 
```

--------------------------------------------------------------------------------
/tests/sample_project/dynamic_dispatch.py:
--------------------------------------------------------------------------------

```python
 1 | from functools import partial
 2 | import operator
 3 | import importlib
 4 | 
 5 | def add(a, b): return a + b
 6 | def sub(a, b): return a - b
 7 | def mul(a, b): return a * b
 8 | 
 9 | DISPATCH = {'add': add, 'sub': sub, 'mul': mul}
10 | 
11 | def dispatch_by_key(name, a, b):
12 |     return DISPATCH[name](a, b)
13 | 
14 | def dispatch_by_string(name, *args, **kwargs):
15 |     fn = globals().get(name)
16 |     if callable(fn):
17 |         return fn(*args, **kwargs)
18 |     raise KeyError(name)
19 | 
20 | def partial_example():
21 |     add5 = partial(add, 5)
22 |     return add5(10)
23 | 
24 | class C:
25 |     def method(self, x): return x + 3
26 | 
27 | def methodcaller_example(x):
28 |     c = C()
29 |     mc = operator.methodcaller('method', x)
30 |     return mc(c)
31 | 
32 | def dynamic_import_call(mod_name, fn_name, *args, **kwargs):
33 |     mod = importlib.import_module(mod_name)
34 |     fn = getattr(mod, fn_name)
35 |     return fn(*args, **kwargs)
36 | 
```

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

```javascript
1 | !function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){e.multiLanguage=function(){for(var t=Array.prototype.slice.call(arguments),i=t.join("-"),r="",n=[],s=[],p=0;p<t.length;++p)"en"==t[p]?(r+="\\w",n.unshift(e.stopWordFilter),n.push(e.stemmer),s.push(e.stemmer)):(r+=e[t[p]].wordCharacters,e[t[p]].stopWordFilter&&n.unshift(e[t[p]].stopWordFilter),e[t[p]].stemmer&&(n.push(e[t[p]].stemmer),s.push(e[t[p]].stemmer)));var o=e.trimmerSupport.generateTrimmer(r);return e.Pipeline.registerFunction(o,"lunr-multi-trimmer-"+i),n.unshift(o),function(){this.pipeline.reset(),this.pipeline.add.apply(this.pipeline,n),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add.apply(this.searchPipeline,s))}}}});
```

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

```typescript
 1 | import { useTheme } from "next-themes";
 2 | import { Toaster as Sonner, toast } from "sonner";
 3 | 
 4 | type ToasterProps = React.ComponentProps<typeof Sonner>;
 5 | 
 6 | const Toaster = ({ ...props }: ToasterProps) => {
 7 |   const { theme = "system" } = useTheme();
 8 | 
 9 |   return (
10 |     <Sonner
11 |       theme={theme as ToasterProps["theme"]}
12 |       className="toaster group"
13 |       toastOptions={{
14 |         classNames: {
15 |           toast:
16 |             "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
17 |           description: "group-[.toast]:text-muted-foreground",
18 |           actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
19 |           cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
20 |         },
21 |       }}
22 |       {...props}
23 |     />
24 |   );
25 | };
26 | 
27 | export { Toaster, toast };
28 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_misc/tables.css:
--------------------------------------------------------------------------------

```css
 1 | body {
 2 |     font-family: Arial, sans-serif;
 3 |     max-width: 1000px;
 4 |     margin: 0 auto;
 5 |     padding: 20px;
 6 | }
 7 | 
 8 | h1 {
 9 |     color: #2c3e50;
10 |     text-align: center;
11 | }
12 | 
13 | table {
14 |     width: 100%;
15 |     border-collapse: collapse;
16 |     margin: 20px 0;
17 |     background: white;
18 |     box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
19 | }
20 | 
21 | caption {
22 |     font-size: 1.2em;
23 |     font-weight: bold;
24 |     margin-bottom: 10px;
25 |     color: #34495e;
26 | }
27 | 
28 | th, td {
29 |     padding: 12px;
30 |     text-align: left;
31 |     border: 1px solid #ddd;
32 | }
33 | 
34 | th {
35 |     background-color: #3498db;
36 |     color: white;
37 |     font-weight: bold;
38 | }
39 | 
40 | thead th {
41 |     background-color: #2980b9;
42 | }
43 | 
44 | tfoot th, tfoot td {
45 |     background-color: #f8f9fa;
46 |     font-weight: bold;
47 | }
48 | 
49 | tbody tr:nth-child(even) {
50 |     background-color: #f2f2f2;
51 | }
52 | 
53 | tbody tr:hover {
54 |     background-color: #e9f5ff;
55 | }
56 | 
57 | @media screen and (max-width: 600px) {
58 |     table {
59 |         display: block;
60 |         overflow-x: auto;
61 |     }
62 | }
```

--------------------------------------------------------------------------------
/tests/sample_project_typescript/tsconfig.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |   "compilerOptions": {
 3 |     "target": "ES2020",
 4 |     "lib": ["ES2020", "DOM"],
 5 |     "module": "commonjs",
 6 |     "moduleResolution": "node",
 7 |     "outDir": "./dist",
 8 |     "rootDir": "./src",
 9 |     "strict": true,
10 |     "esModuleInterop": true,
11 |     "skipLibCheck": true,
12 |     "forceConsistentCasingInFileNames": true,
13 |     "resolveJsonModule": true,
14 |     "declaration": true,
15 |     "declarationMap": true,
16 |     "sourceMap": true,
17 |     "experimentalDecorators": true,
18 |     "emitDecoratorMetadata": true,
19 |     "strictPropertyInitialization": true,
20 |     "noImplicitReturns": true,
21 |     "noFallthroughCasesInSwitch": true,
22 |     "noUncheckedIndexedAccess": true,
23 |     "exactOptionalPropertyTypes": true,
24 |     "noImplicitOverride": true,
25 |     "allowUnusedLabels": false,
26 |     "allowUnreachableCode": false,
27 |     "noPropertyAccessFromIndexSignature": true
28 |   },
29 |   "include": [
30 |     "src/**/*"
31 |   ],
32 |   "exclude": [
33 |     "node_modules",
34 |     "dist",
35 |     "**/*.test.ts",
36 |     "**/*.spec.ts"
37 |   ]
38 | }
```

--------------------------------------------------------------------------------
/src/codegraphcontext/utils/debug_log.py:
--------------------------------------------------------------------------------

```python
 1 | import os
 2 | from datetime import datetime
 3 | import logging
 4 | logger = logging.getLogger(__name__)
 5 | 
 6 | # Toggle this to True to enable debug logging
 7 | debug_mode = False  # Set to True for dev/test, False for production
 8 | log_mode = False  # Set to True to enable user login logging
 9 | 
10 | def debug_log(message):
11 |     """Write debug message to a file if debug_mode is enabled"""
12 |     if not debug_mode:
13 |         return
14 |     debug_file = os.path.expanduser("~/mcp_debug.log")
15 |     timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
16 |     with open(debug_file, "a") as f:
17 |         f.write(f"[{timestamp}] {message}\n")
18 |         f.flush()
19 | 
20 | def info_logger(msg):
21 |     if log_mode:
22 |         return logger.info(msg)
23 |     else:
24 |         return
25 | 
26 | def error_logger(msg):
27 |     if log_mode:
28 |         return logger.error(msg)
29 |     else:
30 |         return
31 |     
32 | def warning_logger(msg):
33 |     if log_mode:
34 |         return logger.warning(msg)
35 |     else:
36 |         return
37 |     
38 | def debug_logger(msg):
39 |     return logger.debug(msg)
40 | 
```

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

```javascript
1 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.th=function(){this.pipeline.reset(),this.pipeline.add(e.th.trimmer),r?this.tokenizer=e.th.tokenizer:(e.tokenizer&&(e.tokenizer=e.th.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.th.tokenizer))},e.th.wordCharacters="[฀-๿]",e.th.trimmer=e.trimmerSupport.generateTrimmer(e.th.wordCharacters),e.Pipeline.registerFunction(e.th.trimmer,"trimmer-th");var t=e.wordcut;t.init(),e.th.tokenizer=function(i){if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t):t});var n=i.toString().replace(/^\s+/,"");return t.cut(n).split("|")}}});
```

--------------------------------------------------------------------------------
/tests/sample_project_typescript/package.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |   "name": "sample_project_typescript",
 3 |   "version": "1.0.0",
 4 |   "description": "Comprehensive TypeScript sample project for testing code analysis and indexing tools",
 5 |   "main": "dist/index.js",
 6 |   "scripts": {
 7 |     "build": "tsc",
 8 |     "build:watch": "tsc --watch",
 9 |     "start": "node dist/index.js",
10 |     "dev": "ts-node src/index.ts",
11 |     "test": "jest",
12 |     "test:watch": "jest --watch",
13 |     "lint": "eslint src/**/*.ts",
14 |     "lint:fix": "eslint src/**/*.ts --fix",
15 |     "clean": "rimraf dist"
16 |   },
17 |   "keywords": [
18 |     "typescript",
19 |     "sample",
20 |     "code-analysis",
21 |     "indexing",
22 |     "testing"
23 |   ],
24 |   "author": "Sample Project",
25 |   "license": "MIT",
26 |   "devDependencies": {
27 |     "@types/node": "^20.0.0",
28 |     "@typescript-eslint/eslint-plugin": "^6.0.0",
29 |     "@typescript-eslint/parser": "^6.0.0",
30 |     "eslint": "^8.0.0",
31 |     "jest": "^29.0.0",
32 |     "@types/jest": "^29.0.0",
33 |     "ts-jest": "^29.0.0",
34 |     "ts-node": "^10.0.0",
35 |     "typescript": "^5.0.0",
36 |     "rimraf": "^5.0.0"
37 |   },
38 |   "dependencies": {
39 |     "reflect-metadata": "^0.1.13"
40 |   }
41 | }
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
 3 | import { Check } from "lucide-react";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | 
 7 | const Checkbox = React.forwardRef<
 8 |   React.ElementRef<typeof CheckboxPrimitive.Root>,
 9 |   React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
10 | >(({ className, ...props }, ref) => (
11 |   <CheckboxPrimitive.Root
12 |     ref={ref}
13 |     className={cn(
14 |       "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
15 |       className,
16 |     )}
17 |     {...props}
18 |   >
19 |     <CheckboxPrimitive.Indicator className={cn("flex items-center justify-center text-current")}>
20 |       <Check className="h-4 w-4" />
21 |     </CheckboxPrimitive.Indicator>
22 |   </CheckboxPrimitive.Root>
23 | ));
24 | Checkbox.displayName = CheckboxPrimitive.Root.displayName;
25 | 
26 | export { Checkbox };
27 | 
```

--------------------------------------------------------------------------------
/.github/workflows/update-contributors.yml:
--------------------------------------------------------------------------------

```yaml
 1 | name: Update Contributors
 2 | 
 3 | on:
 4 |   schedule:
 5 |     - cron: '0 */6 * * *' # Runs every 6 hours
 6 |   workflow_dispatch: # Allows manual triggering
 7 | 
 8 | jobs:
 9 |   update-contributors:
10 |     runs-on: ubuntu-latest
11 |     steps:
12 |       - name: Check out repository
13 |         uses: actions/checkout@v3
14 |         with:
15 |           fetch-depth: 0
16 | 
17 |       - name: Set up Python
18 |         uses: actions/setup-python@v4
19 |         with:
20 |           python-version: '3.x'
21 | 
22 |       - name: Run script to generate contributors file
23 |         run: python scripts/generate_lang_contributors.py
24 | 
25 |       - name: Commit and push if there are changes
26 |         env:
27 |           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 |         run: |
29 |           git config --global user.name 'github-actions[bot]'
30 |           git config --global user.email 'github-actions[bot]@users.noreply.github.com'
31 |           git add contributors.md
32 |           if ! git diff --staged --quiet; then
33 |             git commit -m "docs: update contributors"
34 |             git push
35 |           else
36 |             echo "No changes to contributors.md"
37 |           fi
38 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as SliderPrimitive from "@radix-ui/react-slider";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const Slider = React.forwardRef<
 7 |   React.ElementRef<typeof SliderPrimitive.Root>,
 8 |   React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
 9 | >(({ className, ...props }, ref) => (
10 |   <SliderPrimitive.Root
11 |     ref={ref}
12 |     className={cn("relative flex w-full touch-none select-none items-center", className)}
13 |     {...props}
14 |   >
15 |     <SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary">
16 |       <SliderPrimitive.Range className="absolute h-full bg-primary" />
17 |     </SliderPrimitive.Track>
18 |     <SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-background 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" />
19 |   </SliderPrimitive.Root>
20 | ));
21 | Slider.displayName = SliderPrimitive.Root.displayName;
22 | 
23 | export { Slider };
24 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/badge.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 badgeVariants = cva(
 7 |   "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
 8 |   {
 9 |     variants: {
10 |       variant: {
11 |         default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
12 |         secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
13 |         destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
14 |         outline: "text-foreground",
15 |       },
16 |     },
17 |     defaultVariants: {
18 |       variant: "default",
19 |     },
20 |   },
21 | );
22 | 
23 | export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
24 | 
25 | function Badge({ className, variant, ...props }: BadgeProps) {
26 |   return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
27 | }
28 | 
29 | export { Badge, badgeVariants };
30 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_cpp/function_types.cpp:
--------------------------------------------------------------------------------

```cpp
 1 | #include <iostream>
 2 | #include <vector>
 3 | #include <algorithm>
 4 | 
 5 | // Regular function
 6 | int add(int a, int b) {
 7 |     return a + b;
 8 | }
 9 | 
10 | // Templated function
11 | template <typename T>
12 | T multiply(T a, T b) {
13 |     return a * b;
14 | }
15 | 
16 | class Calculator {
17 | public:
18 |     // Static member function
19 |     static int subtract(int a, int b) {
20 |         return a - b;
21 |     }
22 | 
23 |     // Method using a local lambda
24 |     void printSum(const std::vector<int>& nums) {
25 |         auto printer = [](int val) { std::cout << val << std::endl; };
26 |         for (int n : nums) printer(n);
27 |     }
28 | };
29 | 
30 | int main() {
31 |     Calculator calc;
32 |     std::vector<int> numbers = {1, 2, 3};
33 | 
34 |     calc.printSum(numbers);
35 | 
36 |     // Standalone lambda
37 |     auto lambda = [](int a, int b) { return a + b; };
38 |     std::cout << "Lambda sum: " << lambda(3,4) << std::endl;
39 | 
40 |     // Regular function call
41 |     std::cout << "Add: " << add(2,3) << std::endl;
42 | 
43 |     // Templated function call
44 |     std::cout << "Multiply: " << multiply(2,3) << std::endl;
45 | 
46 |     // Static member function call
47 |     std::cout << "Subtract: " << Calculator::subtract(5,2) << std::endl;
48 | 
49 |     return 0;
50 | }
51 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_ruby/tests/test_mixins.py:
--------------------------------------------------------------------------------

```python
 1 | def test_ruby_class_includes_module(graph):
 2 |     # Check that the module node exists
 3 |     rows = graph.query('MATCH (:Module {name:"Flyable"}) RETURN 1 AS ok LIMIT 1')
 4 |     assert rows, "Expected a Module node named 'Flyable' but none was found."
 5 | 
 6 |     # Check that the class node exists
 7 |     rows = graph.query('MATCH (:Class {name:"Bird"}) RETURN 1 AS ok LIMIT 1')
 8 |     assert rows, "Expected a Class node named 'Bird' but none was found."
 9 | 
10 |     # Check that the INCLUDES relationship exists between Bird and Flyable
11 |     rows = graph.query('''
12 |         MATCH (:Class {name:"Bird"})-[:INCLUDES]->(:Module {name:"Flyable"})
13 |         RETURN count(*) AS c
14 |     ''')
15 |     assert rows and rows[0]["c"] > 0, \
16 |         "Expected an INCLUDES relationship from Class 'Bird' to Module 'Flyable', but none was found."
17 | 
18 | 
19 | def test_module_is_unique(graph):
20 |     # Ensure only one Module node named 'Flyable' exists
21 |     rows = graph.query('MATCH (m:Module {name:"Flyable"}) RETURN count(m) AS c')
22 |     assert rows and rows[0]["c"] == 1, \
23 |         f"Expected exactly one Module node named 'Flyable', but found {rows[0]['c'] if rows else 0}."
24 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_java/src/com/example/app/Main.java:
--------------------------------------------------------------------------------

```java
 1 | package com.example.app;
 2 | 
 3 | import com.example.app.model.Role;
 4 | import com.example.app.model.User;
 5 | import com.example.app.service.GreetingService;
 6 | import com.example.app.service.impl.GreetingServiceImpl;
 7 | import com.example.app.util.CollectionUtils;
 8 | import com.example.app.util.IOHelper;
 9 | 
10 | import java.util.List;
11 | 
12 | public class Main {
13 |     public static void main(String[] args) {
14 |         GreetingService svc = new GreetingServiceImpl();
15 |         User u = new User("Priya", Role.ADMIN);
16 |         System.out.println(svc.greet(u));
17 | 
18 |         int sumSquares = CollectionUtils.sumOfSquares(List.of(1, 2, 3, 4, 5));
19 |         System.out.println("sumSquares=" + sumSquares);
20 | 
21 |         try {
22 |             String first = IOHelper.readFirstLine("README.md");
23 |             System.out.println("firstLine=" + first);
24 |         } catch (RuntimeException e) {
25 |             System.out.println("IO failed: " + e.getMessage());
26 |         }
27 | 
28 |         com.example.app.misc.Outer outer = new com.example.app.misc.Outer("outer");
29 |         com.example.app.misc.Outer.Inner inner = outer.new Inner("inner");
30 |         System.out.println(inner.combine());
31 |     }
32 | }
33 | 
```

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

```typescript
 1 | import { useEffect, useState } from "react";
 2 | 
 3 | type PypiStats = {
 4 |   data: {
 5 |     last_day: number;
 6 |     last_month: number;
 7 |     last_week: number;
 8 |   };
 9 |   package: string;
10 |   type: string;
11 | };
12 | 
13 | export default function ShowDownloads() {
14 |   const [stats, setStats] = useState<PypiStats | null>(null);
15 |   const [error, setError] = useState<string | null>(null);
16 | 
17 |   useEffect(() => {
18 |     async function fetchStats() {
19 |       try {
20 |         const res = await fetch("/api/pypi/packages/codegraphcontext/recent");
21 | 
22 |         if (!res.ok) {
23 |           throw new Error(`API error: ${res.status}`);
24 |         }
25 | 
26 |         const data = await res.json();
27 |         setStats(data);
28 |       } catch (err: unknown) {
29 |         setError((err as Error).message);
30 |       }
31 |     }
32 |     fetchStats();
33 |   }, []);
34 | 
35 |   if (error) return <p className="text-red-500">Error: {error}</p>;
36 |   if (!stats) return <p>Loading stats...</p>;
37 | 
38 |   return (
39 |     <div data-aos="fade-in">
40 |       {stats?.data ? (
41 |         <>
42 |           <p>Last month downloads: {stats.data.last_month.toLocaleString()}+</p>
43 |         </>
44 |       ) : (
45 |         <p>No data available yet for this package</p>
46 |       )}
47 |     </div>
48 |   );
49 | }
```

--------------------------------------------------------------------------------
/website/index.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>CodeGraphContext - AI-Powered Code Knowledge Graphs</title>
 7 |     <meta name="description" content="Transform your codebase into an intelligent knowledge graph for AI assistants. Index Python code, analyze relationships, and provide context with CodeGraphContext MCP server." />
 8 |     <meta name="author" content="Shashank Shekhar Singh" />
 9 |     <meta name="keywords" content="code analysis, knowledge graph, AI assistant, MCP server, Python, Neo4j, code indexing" />
10 | 
11 |     <meta property="og:title" content="CodeGraphContext - AI-Powered Code Knowledge Graphs" />
12 |     <meta property="og:description" content="Transform your codebase into an intelligent knowledge graph for AI assistants. Index Python code, analyze relationships, and provide context." />
13 |     <meta property="og:type" content="website" />
14 |     <meta name="twitter:card" content="summary_large_image" />
15 |   </head>
16 | 
17 |   <body>
18 |     <div id="root"></div>
19 |     <script type="module" src="/src/main.tsx"></script>
20 |   </body>
21 | </html>
22 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as SwitchPrimitives from "@radix-ui/react-switch";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const Switch = React.forwardRef<
 7 |   React.ElementRef<typeof SwitchPrimitives.Root>,
 8 |   React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
 9 | >(({ className, ...props }, ref) => (
10 |   <SwitchPrimitives.Root
11 |     className={cn(
12 |       "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",
13 |       className,
14 |     )}
15 |     {...props}
16 |     ref={ref}
17 |   >
18 |     <SwitchPrimitives.Thumb
19 |       className={cn(
20 |         "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
21 |       )}
22 |     />
23 |   </SwitchPrimitives.Root>
24 | ));
25 | Switch.displayName = SwitchPrimitives.Root.displayName;
26 | 
27 | export { Switch };
28 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as TooltipPrimitive from "@radix-ui/react-tooltip";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const TooltipProvider = TooltipPrimitive.Provider;
 7 | 
 8 | const Tooltip = TooltipPrimitive.Root;
 9 | 
10 | const TooltipTrigger = TooltipPrimitive.Trigger;
11 | 
12 | const TooltipContent = React.forwardRef<
13 |   React.ElementRef<typeof TooltipPrimitive.Content>,
14 |   React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
15 | >(({ className, sideOffset = 4, ...props }, ref) => (
16 |   <TooltipPrimitive.Content
17 |     ref={ref}
18 |     sideOffset={sideOffset}
19 |     className={cn(
20 |       "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 | ));
26 | TooltipContent.displayName = TooltipPrimitive.Content.displayName;
27 | 
28 | export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
29 | 
```

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

```typescript
 1 | "use client"
 2 | 
 3 | import * as React from "react"
 4 | import { Moon, Sun } from "lucide-react"
 5 | import { useTheme } from "next-themes"
 6 | import { Button } from "@/components/ui/button"
 7 | import { motion, AnimatePresence } from "framer-motion"
 8 | 
 9 | export function ThemeToggle() {
10 |   const { setTheme, theme } = useTheme()
11 | 
12 |   const toggleTheme = () => {
13 |     setTheme(theme === 'dark' ? 'light' : 'dark')
14 |   }
15 | 
16 |   return (
17 |     <Button variant="outline" size="icon" onClick={toggleTheme} className="relative overflow-hidden">
18 |       <AnimatePresence initial={false} mode="wait">
19 |         <motion.div
20 |           key={theme === 'dark' ? 'sun' : 'moon'}
21 |           initial={{ y: 20, opacity: 0, rotate: -90 }}
22 |           animate={{ y: 0, opacity: 1, rotate: 0 }}
23 |           exit={{ y: -20, opacity: 0, rotate: 90 }}
24 |           transition={{ duration: 0.3 }}
25 |           className="absolute"
26 |         >
27 |           {theme === 'dark' ? (
28 |             <Sun className="h-[1.2rem] w-[1.2rem]" />
29 |           ) : (
30 |             <Moon className="h-[1.2rem] w-[1.2rem]" />
31 |           )}
32 |         </motion.div>
33 |       </AnimatePresence>
34 |       <span className="sr-only">Toggle theme</span>
35 |     </Button>
36 |   )
37 | }
38 | 
39 | 
40 | 
```

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

```typescript
 1 | import * as React from "react";
 2 | import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
 3 | 
 4 | import { cn } from "@/lib/utils";
 5 | 
 6 | const HoverCard = HoverCardPrimitive.Root;
 7 | 
 8 | const HoverCardTrigger = HoverCardPrimitive.Trigger;
 9 | 
10 | const HoverCardContent = React.forwardRef<
11 |   React.ElementRef<typeof HoverCardPrimitive.Content>,
12 |   React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>
13 | >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
14 |   <HoverCardPrimitive.Content
15 |     ref={ref}
16 |     align={align}
17 |     sideOffset={sideOffset}
18 |     className={cn(
19 |       "z-50 w-64 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",
20 |       className,
21 |     )}
22 |     {...props}
23 |   />
24 | ));
25 | HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
26 | 
27 | export { HoverCard, HoverCardTrigger, HoverCardContent };
28 | 
```

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

```rust
 1 | // lib.rs - Main library file for Rust sample project
 2 | 
 3 | pub mod basic_functions;
 4 | pub mod structs_enums;
 5 | pub mod traits;
 6 | pub mod error_handling;
 7 | pub mod lifetimes_references;
 8 | pub mod generics;
 9 | pub mod concurrency;
10 | pub mod iterators_closures;
11 | pub mod smart_pointers;
12 | pub mod modules;
13 | 
14 | // Re-exports for convenience
15 | pub use basic_functions::*;
16 | pub use structs_enums::{Person, Status};
17 | pub use traits::{Describable, Area};
18 | 
19 | /// Library-level documentation
20 | /// 
21 | /// This is a comprehensive Rust sample project demonstrating:
22 | /// - Basic and advanced function patterns
23 | /// - Structs, enums, and their implementations
24 | /// - Traits and trait implementations
25 | /// - Error handling with Result and custom errors
26 | /// - Lifetimes and references
27 | /// - Generics and type parameters
28 | /// - Concurrency with threads and channels
29 | /// - Iterators and closures
30 | /// - Smart pointers (Box, Rc, Arc, RefCell)
31 | /// - Module organization
32 | 
33 | #[cfg(test)]
34 | mod integration_tests {
35 |     use super::*;
36 | 
37 |     #[test]
38 |     fn test_basic_workflow() {
39 |         let result = simple_function(5);
40 |         assert_eq!(result, 10);
41 | 
42 |         let person = Person::new("Alice".to_string(), 30);
43 |         assert_eq!(person.name, "Alice");
44 |     }
45 | }
46 | 
47 | 
```
Page 1/18FirstPrevNextLast