Commit Graph

25 Commits

Author SHA1 Message Date
Brian Wilkerson d00ef8611a Update the server protocol to support passing back the line and column numbers for the end of a range
Change-Id: I8310e4a32cacbe98310c1dbaa3b3563b1ff1a1ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191862
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-18 19:22:23 +00:00
Sam Rawlins aeb040fe75 dart migrate: Fix dead code; add test
Change-Id: I1cc015d4bf66c4810a2cb9a161018b075f317176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180602
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-01-22 18:14:23 +00:00
Sam Rawlins 97df2e6031 dart migrate: Tidy up extra newlines in opt-out comment
Change-Id: If0c2a2c98d3284da847cae40d1ae8fad97abce6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180482
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-01-22 16:22:03 +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 034540336a dart migrate: insert comment between first comment and first directive
Fixes https://github.com/dart-lang/sdk/issues/44704

Change-Id: I07402a958f7940bb603253a60e43709fc07529b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179920
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-01-19 15:16:12 +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 6eddd878c0 dart migrate: Fix preview_site_test on windows
Change-Id: Ib0fc934eb1620017da20a444ced58a8d9e63f540
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-12-15 23:45:01 +00:00
Sam Rawlins 56fb42cb62 dart migrate: enable incremental migration workflow
Also:
* Print out details when applying migration
* Also fix title text position to not scroll out of view.

Change-Id: Idc4b703535400956f78d76ab7959f40cf77a0bc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175860
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-12-15 17:59:41 +00:00
Sam Rawlins 451bd1183b dart migrate: Support Windows newlines in opt out
Also sort test file.

Change-Id: Id8133d699ae1a71d1852ef29ce1f843c7ede98cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175561
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-12-10 00:34:50 +00:00
Sam Rawlins 88de6b438e dart migrate: Implement incremental migration in backend
This is still hiding behind a flag pending final review.

Bug: https://github.com/dart-lang/sdk/issues/44101 and
Change-Id: I01b7cb07b3fde7ac67105034b0c4057cb8a69771
     https://github.com/dart-lang/sdk/issues/44124
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175402
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-12-09 15:21:50 +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 a3d3777094 Migration: add a hook invoked after changes are applied.
Change-Id: I97b5f132ab24887d6274fcaef96fadeac85de6da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154621
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-07-16 00:14:02 +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 3aad249fe2 Sort declarations in preview_site_test.dart
Change-Id: I6154bcff1b6421207ef3c76b5679a1d5d3b6a4ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150541
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-09 15:14:21 +00:00
Mike Fairhurst 79762f96f8 [nnbd_migration] fix hint test on windows that unnecessarily maps a path
Change-Id: Id35ae2332520c96265b92abd31c8ec3a92521c8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148569
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-20 15:42:54 +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
Paul Berry 9261549cdb Migration: eliminate preview_site_test.dart's dependency on analysis_server.
Change-Id: I7582f1cfc52d1fa7ed84e1c2f9b3669d3af4ef57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148541
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-05-19 18:09:54 +00:00
Mike Fairhurst b21ee57ccd [nnbd_migration] Support remove hint action in stack traces
Change-Id: I2878fde38b233747d8cf9e3e8666b5768f3125fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148187
Reviewed-by: Paul Berry <paulberry@google.com>
2020-05-19 16:34:20 +00:00
Mike Fairhurst 40d048ac29 [nnbd_migration] Fix hint action windows test.
Previous windows-incompatible implementation of hint action mapped the
path unnecessarily. The path for the new hint action comes from the AST
node and not a web URL and therefore should not be (and cannot be)
mapped for it to work on windows.

In the process of fixing this on cli_test, I missed this place where an
extra map was added in the preview_site test code which causes the test
to fail on windows.

Change-Id: If8d175379f0cb9fe864ab1f588af514a17b4758b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148229
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-05-15 19:15:43 +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
Paul Berry fabceab5ee Migration: remove changedPaths tracking.
See comments in
https://dart-review.googlesource.com/c/sdk/+/147043/1/pkg/nnbd_migration/lib/migration_cli.dart#484
for why this is unnecessary.

Change-Id: I046835d73eb581aecd8d65b1e3248d07daf34f17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147702
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-05-13 20:42:56 +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
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