Commit Graph

7 Commits

Author SHA1 Message Date
Paul Berry 3103e1e0f6 Migration: don't overcount "whereOrNull" fixes.
Fixes #44174.

Bug: https://github.com/dart-lang/sdk/issues/44174
Change-Id: Ida53a11afc2e265cd510b0ac63c50f6b5ac93fdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171962
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-13 18:51:30 +00:00
Paul Berry a666ac7ffa Migration: add preview info when changing iterable method calls.
With this change, the functionality of changing iterable method calls
such as `.firstWhere` into extension method calls such as
`.firstWhereOrNull` is working well enough that I think we can switch
it on.

We don't update the pubspec properly yet; that will be addressed in
follow-up CLs.

Change-Id: I758332e9752b12d399ecb5c70cf37bbc8da77d6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168988
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-10-25 18:57:35 +00:00
Paul Berry 5e2e2235ac Migration: handle inserted lines in UnitRenderer._computeRegionContent.
We don't want inserted lines to receive their own line number for two reasons:

- It makes the line numbers displayed by the migration preview fail to
  line up with the line numbers in the user's editor (since the lines
  haven't been added yet)

- It makes navigation links within the migration tool point to the
  wrong place, since these links are computed based on analysis of the
  pre-migration code.

So instead, we supply a line number string of `(new)` for inserted lines.

This required refactoring the algorithm for
`UnitRenderer._computeRegionContent` a bit.  Now, instead of trying to
accumulate the output HTML string all at once, we produce it one row
at a time, first accumulating the line text in a StringBuffer, and
then once the end of the line is reached, attaching the line number to
form a table row.  Then we join together all the rows into a table
when we're done.

Change-Id: Ie18632186ddd0f4f5f33d4da41b4943759699e1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168987
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-10-25 18:57:35 +00:00
Sam Rawlins 360363efc1 Migrator: opt all test files _out_ of null safety.
Well not quite all; migration_cli_test tests are a bit of a different
beast so I am going to tackle them separately. But this fixes over
1000 test failures, and should clean up test output for further
debugging of the flip CL.

Each test file needs to be in a package with a package config file
which spells out that it is _opted out_ of null safety.

Bug: https://github.com/dart-lang/sdk/issues/43883
Change-Id: I583f66119df57031fd80824111923e15e0f91782
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168900
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-10-23 21:07:04 +00:00
Sam Rawlins cddea627a7 Migrator: Accept 'late final' hint; same as 'late' hint
`late final` is not functionally different from `late`, as far
as the migrator is concerned; it is just an indication of late
in the face of missing initialization.

Fixes https://github.com/dart-lang/sdk/issues/41655

Change-Id: I1b0efd3de3b5c7064784ebd1e86c7d12436b1319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167203
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-10-13 19:41:58 +00:00
Sam Rawlins 20261e77af Migrator: Include the auth token in various links:
* Navigation links on the left
* target links in source
* "Proposed edit" links

Fixes https://github.com/dart-lang/sdk/issues/43135

Change-Id: I8ee8899286faadfda20dcf02aa409e118e227bcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159970
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-08-24 23:47:27 +00:00
Paul Berry eab774c255 Move much of migration tool UI code into pkg/nnbd_migration
Change-Id: Ia3b388b274c908dcc6f9cb9ee4bf004b82681c43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144320
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-04-23 23:43:42 +00:00