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.
This is the first PR of many to implement a new frontend for protocompile. New packages will live under
protocompile/experimental
until we're ready to promote the next protocompile verison.This change adds:
internal/golden
, a golden tests framework.Usinginternal/width
, a port of Rust'sunicode-width
for calculation the approximate terminal display width of multilingual strings.uniseg
for this, works great!report.proto
, a Protobuf for diagnostics.experimental/report
, the package itself.experimental/report/testdata
, a suite of tests for the report renderer.The fussiest part of this PR is
experimental/report/renderer.go
. I have tried to include tests for all of the corner cases, and I have attempted to document it so that which mysterious layout trick is written down, lest I forget.There's one intentionally broken test: it's very difficulty to support users who want to use RTL scripts in diagnostics, because not only does that cause the text direction to flip, it flips around things that are not part of the RTL script. Bidi handling is not worth it, and not even Rust tries to get this right.