Skip to content

Conversation

@tyrchen
Copy link
Owner

@tyrchen tyrchen commented Apr 28, 2025

No description provided.

tyrchen and others added 4 commits April 27, 2025 22:14
* feature: add package file

* Update specs/0006-package-file.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tyrchen tyrchen requested a review from Copilot April 28, 2025 06:21
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 adds support for the Go language by integrating a new Go parser, updating formatting rules, and adjusting the CodeBank logic and documentation.

  • Introduces GoParser in the language module and updates public exports.
  • Updates CodeBank to detect, parse, and format Go files along with relevant tests and examples.
  • Adjusts documentation and dependencies (Cargo.toml, README) to reflect Go support.

Reviewed Changes

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

Show a summary per file
File Description
src/parser/mod.rs Includes GoParser in public exports and updates language matching for Go.
src/parser/lang/mod.rs Adds the Go module and parser struct definition.
src/parser/formatter/rules.rs Introduces a GO_RULES constant and integrates Go formatting in language rule matching.
src/bank.rs Integrates GoParser into CodeBank, adds go-related language detection, parsing, and tests.
specs/0006-package-file.md Documents package file inclusion requirements.
fixtures/sample.go Provides sample Go file for parser testing.
examples/parser.rs Updates examples to include Go parsing.
README.md Updates documentation to mention Go support.
Cargo.toml Updates version and adds tree-sitter-go dependency.

Comment on lines 150 to 152
// Log or handle the error appropriately, for now just continuing
eprintln!("Warning: Failed to read package file: {}", e);
}
Copy link

Copilot AI Apr 28, 2025

Choose a reason for hiding this comment

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

Consider propagating the error from reading the package file instead of only logging with eprintln, so that consumers of the function can handle the error appropriately.

Suggested change
// Log or handle the error appropriately, for now just continuing
eprintln!("Warning: Failed to read package file: {}", e);
}
// Propagate the error to allow the caller to handle it
return Err(e);

Copilot uses AI. Check for mistakes.
@tyrchen tyrchen requested a review from Copilot April 28, 2025 06:25
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 introduces support for Go parsing and formatting in the CodeBank project. In summary, the changes add a new GoParser, update language detection and formatting rules for Go, and adjust tests and documentation to include Go support.

  • Introduces a new Go module in the parser and language layers.
  • Updates CodeBank to recognize Go file extensions and names.
  • Enhances documentation (README and Cargo.toml) to reflect Go support.

Reviewed Changes

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

Show a summary per file
File Description
src/parser/mod.rs Added GoParser to the parser aggregate and language docs.
src/parser/lang/mod.rs Introduced GoParser in language modules.
src/parser/formatter/rules.rs Added formatter rules for Go language syntax.
src/bank.rs Integrated GoParser into bank logic; updated tests.
fixtures/sample.go Introduced a sample Go file to test the new parser.
examples/parser.rs Updated examples to demonstrate Go parsing support.
README.md Documented Go support in the project overview.
Cargo.toml Added dependency for tree-sitter-go and updated description.

@tyrchen tyrchen merged commit f66cb4b into master Apr 28, 2025
1 check passed
@tyrchen tyrchen deleted the feature/support-go branch April 28, 2025 07:18
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.

2 participants