Skip to content

Conversation

@munificent
Copy link
Member

In the very rare case that a user called formatStatement() and gave the formatter something longer than a single statement, we need to throw a FormatException but don't actually have a diagnostic from the analyzer to use.

To deal with that, it used to import some internal implementation libraries in order to conjure up a diagnostic. Instead, this has a local implementation of the necessary public analyzer classes.

This will avoid dart_style being broken with analyzer 9.0.0 when that internal code changes.

In the very rare case that a user called formatStatement() and gave the
formatter something longer than a single statement, we need to throw a
FormatException but don't actually have a diagnostic from the analyzer
to use.

To deal with that, it used to import some internal implementation
libraries in order to conjure up a diagnostic. Instead, this has a local
implementation of the necessary public analyzer classes.

This will avoid dart_style being broken with analyzer 9.0.0 when that
internal code changes.
@munificent
Copy link
Member Author

I also checked and there are no other imports of analyzer/src/ anywhere else in the formatter after this PR.

Copy link
Member

@stereotype441 stereotype441 left a comment

Choose a reason for hiding this comment

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

lgtm! Thanks, Bob!

@munificent munificent merged commit e8190bf into main Nov 15, 2025
7 checks passed
@munificent munificent deleted the remove-analyzer-internal branch November 15, 2025 00:24
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.

3 participants