Commit Graph

54 Commits

Author SHA1 Message Date
Konstantin Shcheglov 26d9fbbd04 Add getResolvedUnit2(), deprecate getResolvedUnit().
Change-Id: I0217fefb2747f2f9bd757bc041b53acaf3d1a8f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195495
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-16 21:33:54 +00:00
Sam Rawlins 8833210ee4 dart migrate: Only opt out files with a comment if they appear in files-to-process
Change-Id: I3cb1bedaa4a03eca89e29528c554488955f2bb04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180083
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-01-21 00:57:33 +00:00
Sam Rawlins f6dba2b25f dart migrate: Separate HintAction and HintActionKind into separate file
This addresses a cyclic dependency build issue in google3.

Change-Id: I3ea917f7216e120b827577bde60b874a9bad52af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180240
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2021-01-20 21:54:53 +00:00
Sam Rawlins 9488ea4c7e dart migrate: support files-to-be-migrated initial state in google3
* Rename isPreviewServerRunnning to isPreviewServerRunning
* Fix top "Migrating" checkbox upon navigation.

This change does not completely solve google3-compatibility, just the
web preview UI portion.

Work to improve any opt-out `// @dart=2.9` comments will follow.

Change-Id: Iee38650ab732179d82060b14bc7b657e3c560543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178160
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-01-12 05:54:50 +00:00
Sam Rawlins 1b07887853 Migrator: Implement check boxes on directories
Checking and unchecking a directory toggles the status of all child files which
are 'migrating' or 'opting out.' Files which are already migrated do not
change.

Checking and unchecking a file updates the status of all parent directories.
Directories with both 'migrating' and 'opting out' files are 'indeterminate'.

The difference between 'file' and 'directory' NavigationTreeNodes was
getting too hairy so I split into two subclasses.

Removed the keepingOptedOut status and added the indeterminate status.

Bug: https://github.com/dart-lang/sdk/issues/44101
Change-Id: Iea1a8c07b08c3d7956db51ca372437093457fe7f
     https://github.com/dart-lang/sdk/issues/44124
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173600
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-11-25 02:32:59 +00:00
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 02b2e5398d Migration: permanently enable "transform where or null" feature.
This feature is now working reliably enough that we no longer need the
option of turning it off.

Change-Id: I2bbeb114ca1bd4e0dc8e94ac6775ec5e2fa8718e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171705
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-11-12 21:12:20 +00:00
Paul Berry 80ac9c999b Migration: update pubspec when adding import of package:collection.
Change-Id: Ia9e5090bafa7f67be87aa01367bec16f4fd80ee9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171701
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-11-12 21:12:20 +00:00
Paul Berry fdfcab8581 Rework DartFixListener callbacks to use an interface class.
I will need to add another callback in a follow-up CL, and it seems
silly to pass a bunch of closures to the DartFixListener constructor.

Change-Id: I969d1d90fca0889b131589248aaa1cec343a9059
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-11-12 21:12:20 +00:00
Paul Berry 05750310c9 Migration: rework fatal error reporting when pubspec cannot be parsed.
Previously, the user experience was an `UnimplementedError` with no
further information.  Now the user gets an error message telling them
how they need to update the pubspec, which I believe was the original
implementation intent.

Note that the field `_packageIsNNBD` has been removed.  Although the
comment for this field said it was tracking whether the package was
opted in to null safety, it actually had no effect (since the only
code path that would set it to `false` was after the
`UnimplementedError` and thus unreachable).

Change-Id: I3cef2f0a7203941b22e37e3ae1bee14806cfc9c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171621
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-11 17:49:02 +00:00
Paul Berry 50274ada87 Migration: add migration_summary_test.dart to test_all.dart.
Change-Id: I478ab5491fb3cbc32646d4ec3a76be838113bff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171261
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-10 15:09:26 +00:00
Paul Berry 7322bc027e Migration: replace pub outdated check with a check on transitive imports.
Instead of running `pub outdated` to see if the user's dependencies
have been migrated yet, the migration tool now examines all of the
transitive import dependencies of the user's code to see if they are
opted in to null safety.  This produces a more accurate result than
`pub outdated`, because it is able to ignore files in transitive
package dependencies that aren't reachable via imports
(e.g. references to `package:analyzer` brought in by `package:test`).

Fixes #44061.

Bug: https://github.com/dart-lang/sdk/issues/44061
Change-Id: I38465bcbf35e8552f0060b5d51c0f1cfc5d18c7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170561
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-11-05 23:05:51 +00:00
Sam Rawlins 40cfccda6f Migrator: Add a progress bar for explainMigration, which can take a long time.
This shows progress for work which happens after the migration suggestions have
been generated. This work is generating instrumentation details for the front
end.

When migrating the analyzer package, the progress indicated by this third
progress bar takes approximately the same time as generating suggestions (on
the same order of magnitude).

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

Change-Id: I0b40dd5e587b718bd1ef56d64f03929924cc430a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170563
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-05 22:10:51 +00:00
Sam Rawlins 416cfa7c41 Migrator: Add /*required*/ hints when meta not imported.
Currently the migrator can add `@required` from the preview, which will crash
the preview upon rerunning, if package:meta is not imported.

This change instead adds a /*required*/ hint when meta is not imported.

Additionally, /*required*/ is understood by the migrator just as if it were
`@required`.

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

Change-Id: I1ea532246b956feacedd179146372b13c65003df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169900
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-11-02 17:30:59 +00:00
Paul Berry 68c50f7f92 Migration: re-work test_informationalRegion_containsTraceLinks_separateDrive.
Previously, we were switching test paths to drive `D` at the start of
the test, after the `package_config.json` file had already been
generated to drive `C`; as a result, it didn't apply.  We will need
the `package_config.json` to apply when we flip the null safety flag
(so that the inputs to the migration tool are considered opted out
prior to migration).  This CL reworks the test so that the paths are
modified as part of test set-up, so `package_config.json` gets put in
the right place.

Fixes #43883.

Bug: https://github.com/dart-lang/sdk/issues/43883
Change-Id: I08f79ddb07d7a5ecf640370a32334a7ceb92ceff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169421
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-28 16:35: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
Paul Berry e20415403a Fix InfoBuilder._explainUnit to handle iterable method call renames.
The method we use to rename method calls to Iterable
(e.g. `firstWhere` -> `firstWhereOrNull`) causes a pair of consecutive
AtomicEdit objects to be generated: one to remove the old name
followed by one to add the new name.  This was causing
InfoBuilder._explainUnit to update its output offsets incorrectly,
because it waited until after processing all of the AtomicEdit objects
pointing to a single source offset before updating the output offset.
What it needs to do instead is update the output offset (in the
variable called `offset`) after processing every single AtomicEdit.

Change-Id: I8ad51e20d4021c62c45542cec7f0f54a9ff3cf26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169000
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-25 16:23:45 +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
Paul Berry d751681647 Sort declarations in info_builder_test.dart
Change-Id: I00caa1860f93f2fb8cfcdf9fa571f9cd0cc880b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168980
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-23 20:01:22 +00:00
Paul Berry 265ecc7488 Make test tolerant of changes to mock sdk
Change-Id: I5c2e6c964b666157977c66d8ad8a19ea41b09e58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168520
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-10-20 17:45: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 4e7848d17a Migrator: Fix windows path failure.
Fixes https://github.com/dart-lang/sdk/issues/43178

Change-Id: I9b41c7bf3f317abfe8f06b37a40ebd9a3d63a813
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160960
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-08-31 18:16:28 +00:00
Sam Rawlins 6f0e28b0c8 Fix #43178 by calculating relative path before doing the URI mapping.
Change-Id: I76c3a62d393537da1dbc73cacb9fedfc66f3d2d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160443
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-08-27 20:00:27 +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 aa2566410f Migration: Add a flag to allow the user to ignore exceptions.
This should allow users to work around bugs while waiting for fixes
from the migration team.

Change-Id: I04fe08b4753ee1377a60ec60728a16560847536f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150542
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-10 13:50:27 +00:00
Paul Berry 2e261f9386 Migration: add locations to trace entries that refer to elements.
Bug: https://github.com/dart-lang/sdk/issues/41402
Change-Id: I0dc59ae9d64c6e8ab470b2ddcb5fd42557ba5704
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148742
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-27 21:52:14 +00:00
Konstantin Shcheglov 00fa48fbb1 MockSdk does need to create summary.
Change-Id: Id62bc99394e9afd6306ba6a12118d7bcd045a598
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149202
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-27 19:39:10 +00:00
Konstantin Shcheglov 80e9667f2c Fix unused imports.
R=brianwilkerson@google.com

Change-Id: I02f47632bef3a2e601f7f471c7149829e06844f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148963
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-25 16:58:38 +00:00
Paul Berry 15df850fd3 Migration: fix trace display for variable and field types.
Change-Id: Ib601fea6b6edd50a047471fe4eacf56339e4a4a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147345
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-20 15:09:10 +00:00
Mike Fairhurst 71c10c4c9c [nnbd_migration] Fix navigation tree test on windows
Change-Id: Ib6bbf1af5c6061423093e1b05a1ce135ee097d47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148686
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-05-20 14:05:10 +00:00
Mike Fairhurst 59d66151d8 [nnbd_migration] Fix edit region top link on windows.
We want to continue to show windows users the windows path, but on click
we want to take load based on the uri path.

Change-Id: Idb1bff3cac1a7b9830c3a4458fc79fbf76551b4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148561
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-19 21:08:51 +00:00
Paul Berry e1316a1cc1 Migration: replace imports of analysis_server with imports of analyzer_plugin where possible.
Change-Id: I329e423bbe47645432d7a37e50a1877c7395f63d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148504
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-19 17:08:00 +00:00
Paul Berry fc9ed66071 Migration: remove analysis_server dependencies from some test classes.
These tests were initially based on analysis server tests, so they
shared a lot of analysis server infrastructure.  However, none of that
infrastructure was really needed; we can test equally well just using
analyzer infrastructure.  This helps pave the way for removing the
dependency from nnbd_migration on analysis_server, which will in turn
allow nnbd_migration to be published as its own package.

Change-Id: Icccb73a6248a0b766db5cfe66f42a6dceac0d944
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148540
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-05-19 17:08:00 +00:00
Paul Berry fa3a17bc4f Sort declarations in nnbd_migration_test_base.dart
Change-Id: I866fe463c81f59e40898f3ac39df54d8fc1a3c19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148469
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-05-19 17:08:00 +00:00
Mike Fairhurst a8ab569f5c [nnbd_migration] Support deletions in UnitInfo.handleInsertion
Change `handleInsertion` to use a `SourceEdit` instead, and update
`PreviewSite` to use it, but otherwise do not change `PreviewSite`. That
can be tested later when we have new `HintAction`s that allow us to
exercise this new code.

Change-Id: Idd6d782e003d4d643abb5770daa9055685f2e76a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148186
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-19 16:34:20 +00:00
Mike Fairhurst fdc19bc8f1 [nnbd_migration] Support replace/delete in offset mappers.
Change-Id: Ieef27cff8c9d03537b8f80e5d436eec524abac7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148220
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-19 16:34:20 +00:00
Paul Berry 166d083389 Migration: remove directory lib/api_for_analysis_server.
This existed solely to have a centralized location for the analysis
server's dependencies on nnbd_migration.  Now that nnbd_migration
doesn't depend on the analysis server, there's no need for it anymore.

Change-Id: I24b231337b1f724840b4533afef1672241b0af4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148181
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
2020-05-15 17:12:02 +00:00
Paul Berry c38742cdbc Migration: remove references from analysis_server to nnbd_migration.
Change-Id: I90b562b8b3e82b770f197d7ef2c4e10ac9f99100
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148160
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-15 16:49:32 +00:00
Mike Fairhurst f6d1c93a70 [nnbd_migration] Handle new stack trace add hint action
Change-Id: I94e11938214413955e066f5e1b00c412ee6d78f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147814
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-14 22:51:45 +00:00
Mike Fairhurst 95e11bc2d3 [nnbd_migration] Fix #41894, corrupt offset mapper on edit links.
Fixed: 41894
Change-Id: Ice7b436baa57c473f8cdcab02580b8e531372d7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148026
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-05-14 17:22:01 +00:00
Mike Fairhurst fc391eb620 [nnbd_migration] Add hint actions to stack trace info
Still not rendered by the front end or handled by the server, but now
sent over to the front end via json encode/decode.

Change-Id: I3f93dc78d9981bf08fddf03bcf484a0fc324b66a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147809
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-13 22:31:03 +00:00
Konstantin Shcheglov 123f92f239 Remove unused extension in NavigationTreeRendererTest.
Change-Id: Ieeac05bac86f06cb8fbd21169574e5b53fa3988d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147941
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-05-13 21:08:56 +00:00
Sam Rawlins ae5eb469dc Fix trace for unnamed constructors; remove stack frame icon
Bug: https://github.com/dart-lang/sdk/issues/41851
Change-Id: Ib3a4b76f094c2c4ce55e8617138ab6403b9d80f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147825
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-13 18:12:02 +00:00
Paul Berry 83a2b2e51d Migration: exclude "never" node from "why not nullable" traces
Change-Id: I7b1e22b439dc32b5272e13c947f86e640ffc366b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147050
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-12 17:50:39 +00:00
Paul Berry f48e7e9f8a Migration: assign better quality node targets in NodeBuilder.
This should help ensure that descriptions of nullabilities that show
up in the stack trace refer to parts of the program the user is
familiar with, rather than simply saying "explicit type".

Change-Id: If53198cc45077a664e44859c7c0770ec9831c765
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146964
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-05-08 12:40:49 +00:00
Sam Rawlins 57ff9b73f9 Migrator: Support nullable function-typed parameters
Feature includes:
* function-typed formal parameters
* function-typed field formal parameters
* overridding parameters
* nullability hints
* adding `required`
* optional parameters

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

Change-Id: I1d9b1a50a9a6a77651fe6179b66c8301c8ab9408
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146029
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-05-05 20:03:07 +00:00
Mike Fairhurst 44ad40afa5 [nnbd_migration] Add a trace entry for nodes with no known nullability.
Change-Id: Ic73563fb5c7dffd03685c87a5ba2eaf591513934
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145660
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-05-05 19:39:47 +00:00
Paul Berry 8061d2d6cc Migration: add support for a machine-readable summary of migration results.
Change-Id: Id41bc9869448dd4ed63286cab814bf7687baaaad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146620
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-05 17:35:22 +00:00
Paul Berry 11e5a05a70 Migration: when removing dead code, remove unnecessay ??=s
Fixes #38676.

Change-Id: Icc24c6f070d7f3e8a74fc9494aef3e4c2583fac4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146320
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-05-05 02:18:13 +00:00