feat: add java importing pattern util#260
Merged
morgante merged 3 commits intobiomejs:mainfrom Dec 1, 2025
Merged
Conversation
morgante
reviewed
Nov 21, 2025
Collaborator
morgante
left a comment
There was a problem hiding this comment.
Thanks for working on this!
.grit/patterns/java/java.grit
Outdated
| private pattern before_each_file_stdlib() { | ||
| file($body) where { | ||
| $body <: init_vars(), | ||
| $body <: init_import() |
Collaborator
There was a problem hiding this comment.
I'd match this directly against accumulate_all_imports:
Suggested change
| $body <: init_import() | |
| $body <: $maybe contains bubble import_declaration() as $this_import where { | |
| $GLOBAL_EXIST_IMPORTS += text(`$this_import`), | |
| }, |
.grit/patterns/java/java.grit
Outdated
| private pattern accumulate_all_imports() { | ||
| $_ where { | ||
| $program <: maybe contains bubble() import_declaration() as $this_import where { | ||
| $GLOBAL_EXIST_IMPORTS += text(`$this_import`), |
Contributor
Author
Collaborator
|
FYI the linter is failing, you need to format files with |
* inline unnecessary second call * add short-circuit
0414902 to
8fb3e0c
Compare
morgante
approved these changes
Dec 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Which problem is this PR solving?
Add java importing patterns, inclues:
Short description of the changes
How to verify that this has the expected result