-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better debug diagnostics in the solver. (#1624)
The formatter supports a bunch of debug flags you can enable to see what the solver is doing as it works its magic. That output can be pretty verbose and chatty. When I added the Code intermediate representation, it got worse. Even more verbose, but less helpful because the Code tree doesn't really show you as much as just seeing the formatted output. This improves the debug output a few ways: - Instead of showing the Code tree (which is almost never useful), show the formatted result of that. This is a little tricky because the normal way we lower a Code tree to an output string requires access to the original SourceCode being formatted (in order to support `// dart format off`). The Solver doesn't have that. So instead, there's a new little debug-only visitor to lower Code to a string that doesn't handle format on/off markers and selections. In practice, 99% of my time debugging the solver doesn't have to do with format on/off or selections, so that's fine. - Add support for showing when a potential solution is enqueued versus dequeued. Often, when trying to figure out why a given solution doesn't win, it's useful to make sure it actually ended up in the queue at all, so showing enqueued solutions does that. - Add support for showing solutions without the code. Showing the code for each solution can be pretty verbose. Often I just want to see the solution itself (the states it chose for each piece) and don't care about the code. So this lets you toggle that independently. There are no user-facing changes in this PR.
- Loading branch information
1 parent
e9bd213
commit 67ba681
Showing
4 changed files
with
87 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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