Skip to content

Comments

fix: enum should contain fields#8

Merged
tyrchen merged 2 commits intomasterfrom
fix/fix-enum
Apr 29, 2025
Merged

fix: enum should contain fields#8
tyrchen merged 2 commits intomasterfrom
fix/fix-enum

Conversation

@tyrchen
Copy link
Owner

@tyrchen tyrchen commented Apr 29, 2025

No description provided.

@tyrchen tyrchen requested a review from Copilot April 29, 2025 06:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the enum parsing so that enum variants are correctly included as fields in the parsed structure.

  • Updated the attribute extraction logic to skip comment nodes when searching for attributes.
  • Added a new code block to extract enum variants from an enum's body and populate them as fields.
  • Introduced tests in the fixtures to verify public and private enum parsing.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/parser/lang/rust.rs Updated enum parsing by extracting variants and reusing extracted attributes and documentation.
fixtures/sample_enum.rs Added sample enums and test cases to validate the new enum variant parsing behavior.
Files not reviewed (1)
  • .cursor/rules/rust.mdc: Language not supported
Comments suppressed due to low confidence (1)

src/parser/lang/rust.rs:310

  • [nitpick] Consider renaming 'fields' to 'variants' for clarity, as this variable stores enum variant information rather than struct fields.
let mut fields = Vec::new();

@tyrchen tyrchen merged commit 882b855 into master Apr 29, 2025
1 check passed
@tyrchen tyrchen deleted the fix/fix-enum branch April 29, 2025 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant