Repository navigation
Conversation
GetDutchie#663 switched the lookup to `RegExp(r'class\s+${annotation.element.name}\s*')`. Because it is a raw string, `${...}` is never interpolated, so no model file matches and `brick_model_dictionary_builder` throws `Bad state: No element` for every project on `main`. Build the pattern with `classDeclaration(name)`: - interpolates and escapes the class name - keeps GetDutchie#663's support for line breaks after `class`/the name - uses `(?![\w$])` instead of `\s*`, so `class Post` no longer matches `class PostDraft` (Dart identifiers can contain `$`, so `\b` is not enough) Adds unit tests for the pattern. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 29, 2026
bookshiyi
added a commit
to insightop/brick
that referenced
this pull request
Oct 8, 2026
Port upstream PR GetDutchie#678: the pattern added in GetDutchie#663 was a raw string, so ${...} was never interpolated and every build failed with 'Bad state: No element'. The pattern now also rejects longer class names sharing a prefix (Post vs PostDraft).
|
This PR has been automatically marked as stale due to inactivity. To keep this PR open, you can:
|
|
This PR has been automatically closed due to inactivity. |
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.
Fixes #677
classDeclaration(name):RegExp('class\\s+${RegExp.escape(name)}(?![\\w\$])')(?![\w$])soPost≠PostDraft.\bisn't enough because Dart names can contain$.test/model_dictionary_builder_test.dart(7 cases)dart testinbrick_build: all pass.🤖 Generated with Claude Code