Skip to content

Rust parser validation and correction #344

@Shashankss1205

Description

@Shashankss1205

Description

The current parser for Rust needs to be validated to ensure it correctly builds the code graph. This involves comparing the expected graph structure from the sample project with the actual output.

Steps to Reproduce

  1. Clone the repository:

    git clone https://github.com/Shashankss1205/CodeGraphContext.git
    cd CodeGraphContext
  2. Set up the environment:

    pip install -e ./
    cgc setup
  3. Navigate to the sample project:

    cd tests/sample_project_rust
  4. Index the project:

    cgc index
  5. Visualize the graph:

    cgc visualize

    This will open a Neo4j browser instance. You can run queries to inspect the graph.

Task

  1. Thoroughly examine the source files in tests/sample_project_rust.
  2. Inspect the generated graph using the visualization tool. Check for:
    • Correct identification of functions, classes, imports, and calls.
    • Correct relationships (e.g., CALLS, IMPORTS, CONTAINS, INHERITS).
    • Any missing nodes or relationships.
  3. If discrepancies are found, update the language-specific parser logic in src/codegraphcontext/tools/languages/rust.py.
  4. After making corrections, delete the old graph and re-index to verify the fix.
    cgc delete .
    cgc index
  5. Document your findings and the changes made in your pull request.

Relevant Files

  • Sample Project: tests/sample_project_rust/
  • Parser Logic: src/codegraphcontext/tools/languages/rust.py

Metadata

Metadata

Assignees

Labels

Hacktoberfest25This issue is created as a part of Hacktoberfest 2025 programgood first issueGood for newcomers

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions