There is logic to navigate to the top of a newly-loaded page. It
broke with a visual redesign, in which the title of a page is always
sitting at the top of the screen. The new logic will scroll the page
to the first line of source text.
Change-Id: I685d1fb96c6ca1789f114871acd2bb8148e6ae7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151032
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Previously the API was general, exposing a `numPhases` integer, and
providing a generic processing function with a `phase` argument. This
was necessary back when migration was built into DartFix (because
different kinds of fixes had different numbers of phases), but now
that migration is a separate tool, it gets in the way because it makes
it difficult for the caller to have different behaviors in different
phases.
This is a prerequisite for making it possible to have some files
analyzed but not finalized (which is in turn necessary for handling
generated files).
Change-Id: I5993808eb3dace21d8b6cb9c5308f94a3b1f898e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151081
Reviewed-by: Samuel Rawlins <srawlins@google.com>
This API can be used by tools that wish to perform migration but want
to provide their own command-line argument parsing.
Change-Id: Ic54e993139c803ded5ac39229ae84980db12184e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151080
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Previously, MigrationCli.run() would always return, but it would set
MigrationCli.exitCode to indicate whether an error occurred. This
made it necessary to thread a lot of tricky logic around to ensure
that we would exit quickly if an error occurred. This CL switches to
using an exception, so we get the same effect automatically.
Change-Id: I2b885092dec551700900b118ec3d9acd2f3649d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150760
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
When running the FixBuilder we need to override the behavior of
ClassElement.interfaces so that it returns the post-migration
interface types. We also need to override the behavior of
LibraryElement.isNonNullableByDefault so that the library being
migrated is considered opted in during FixBuilder analysis. This
required adding hooks to the analyzer to allow those overrides.
Additionally, since the analyzer caches the InheritanceManager, we
need to clear that cache out just prior to running the FixBuilder, so
that no pre-migration interface types leak into the FixBuilder.
Fixes#40475.
Fixes#42139.
Change-Id: I45e2c30ebe8c12e4a599e2458d77a3731bad0f98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150260
Reviewed-by: Janice Collins <jcollins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Permissive mode in the analyzer currently is broken, leading to a
useless stacktrace if an exception occurs. As a quick fix, turn
permissive mode off, so the exception just bubbles up normally and
shows on the console. In follow-up CLs I'll actually fix permissive
mode and add a user option to enable it.
Fixes#42138.
Change-Id: I59322ca9dd90b856c56a6ec335762b94ec6935b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149863
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
* Prevent cast exception crash when pubspec.yaml is not a map
* Prevent cast exception crash when pubspec sdk is not a string
* Test error cases for parsing pubspec.
Change-Id: Id392815207dc52719cfec5038d6fa2d09f952f08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149602
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This is only an issue for the old style (not in stacktrace) buttons.
I did not add a test for this; there are many tests for this code in the
new workflow, inside UnitInfo.handleSourceEdit, etc, and this code path
will be removed soon hopefully.
I *did* test manually and saw that it works.
Change-Id: Iac8ba4cb775b9b15c8db1c1cadd4701da81452be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149382
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
We're not currently working on this, and it has some dependencies that
interfere with publishing the migration tool. If we wind up needing
it again, we can always revert.
Change-Id: Ia6219ac376cef77bda7470777eaf2bebf38769b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149343
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
Relands https://dart-review.googlesource.com/c/sdk/+/148642
Due to a z-index bug, regions are showing up on top of the popup. Fixed.
A regression during a previous a.button/.button change that meant that
the close button wasn't rendered as a button.
Previous change from `a.button/.button` reduced the specificity which
caused incorrect font color in edit link buttons. This has been fixed by
using `.button, a.button` so that we keep the desired specificity but
also keep applying the style to all elements with the `button` class.
Change-Id: Idb5eb154904430d946a80b7574537564b7c71bd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148646
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
I noticed that failed GET requests did not show the error popup. At the
time it seemed like uncommon enough to not be a priority, but this is
occurring frequently for windows users, so it's not reasonable to rule
this out and should be handled.
I also have seen that if the preview server is killed, we get an
unhandled `ProgressEvent` error which is just "instance of minified:ew",
handle that case more gracefully as well.
Change-Id: I4f1f307dc33cd7bf0d76a9702df6728dda09926e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148601
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Ensure that the preview server responds with full paths so that the
front end does not need to do path magic on relative links, and test
that those full paths are correct on both windows and linux.
Remove [UnitLink.uri], as it is no longer correct, and it does not have
access to a [PathMapper] which is necessary to build a correct URI.
Change-Id: I7ef764d84c0859d72a21134dc042f837767e91b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148565
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Previously, the backend was returning a relative URI, but that doesn't
work when you have stack traces across root directories. So the front
end used path logic to turn the relative path into an absolute one, but
it didn't do this correctly on windows.
Instead just send an absolute path (still a relative URI, though) from
the backend.
Change-Id: Ied06a9d948851fcf6dc1d4aa007961d3d2a000fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148564
Reviewed-by: Paul Berry <paulberry@google.com>