Commit Graph

3594 Commits

Author SHA1 Message Date
Devon Carew 204a70d4bd [nnbd migration] add an initial readme to describe the workflow and tool
Change-Id: I6d1614aafd0b722c633fba0aa128f90acb4ea006
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134560
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-02-05 21:48:49 +00:00
Devon Carew 0631e949b2 [migration tool] fail the CI if the generated files haven't been rebuilt
Change-Id: I824f8528b5b2bf2efec4121e017d77bab5b6ab60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134468
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-02-05 20:25:39 +00:00
Brian Wilkerson 0617d85227 Add a fix for the prefer_contains lint
Change-Id: I296bf15939b8dafd514db927859602ed91cb800d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134501
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-02-05 19:45:29 +00:00
Mike Fairhurst eff4807eef [analysis_server] Fix #36352, cannot stop a plugin that isn't running
Report it as a silent exception. This way it will show up in log files
and (in the future) over crash reporting (since we haven't solved the
underlying cause), but *not* to users, because it currently appears to
be harmless.

In the future we should consider a "logged-only" type of exception, once
we are confident this isn't causing secondary issues, if we don't intend
to or think we are able to solve this at a deeper level.

Change-Id: I2ee339718fbd6e7c684ccc42718fbb57742f2dd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134467
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-02-05 17:13:59 +00:00
Konstantin Shcheglov 34893faa60 Use DartType.getDisplayString() instead of toString().
Change-Id: I982a4fff312593e6788afcbc9200a83793fefb97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134464
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-05 07:41:22 +00:00
Devon Carew f51187a18d [migration tool] convert the javascript code in the migration tool to dart
Change-Id: I5145be275dda77de3c25d80a13812803217d6452
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134403
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-04 21:46:08 +00:00
Sam Rawlins 44814d320f Final fix for analyzer windows bots; don't canonicalize
Something is weird with our ResourceProviders and Context.canonicalize.
It causes the following:

newFolder(convertPath("/p3"));
resourceProvider.getResource(convertPath("/p3")) is File; // false
resourceProvider.getResource(
    context.canonicalize(convertPath("/p3"))) is File; // true

Change-Id: Iafbfb6ad1bfc912a6850faf063778879dc97fe62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134143
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-02-03 23:03:56 +00:00
Devon Carew 5f5e1db141 [nnbd tool] move nnbd preview tool resources to individual files
Change-Id: I7f3690e34d94e3d7f361b31447a5ae60cf01a1ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134140
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-03 00:38:34 +00:00
Sam Rawlins e4ddd90cd1 NNBD Preview: Fixes for a few edit details
These are bugs found while looking at the collection package.

Change-Id: I5527c873cbe015e723f59f743952b5dc493c5c97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134108
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-02-02 03:33:53 +00:00
Sam Rawlins 89edf6443b Fix another windows test in analyzer
Change-Id: I675efd198ce7e803e2f9e7bdb62385116da22032
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133438
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-31 23:55:22 +00:00
Sam Rawlins 147ed9e9e1 Load navigation programatically; use badges for edit counts; #40115
Change-Id: I83b1db7c95ea0edb8a8d3af0f125219659c6df1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134080
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-31 22:06:12 +00:00
Sam Rawlins 8d874bbb1e NNBD preview: Add 'view' links to Edit List; #40115
Change-Id: Ia365fb43c6efc12c78a82841bcecffceefb501f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134086
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-31 18:06:52 +00:00
Brian Wilkerson bff11ba6ec Enable always_declare_return_types in analysis_server
Change-Id: I9b06753cf552c9f50ea2abd7f3fa5ba9adecb526
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134085
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 17:45:24 +00:00
Brian Wilkerson d1ca36aa83 Enable empty_catches in analysis_server
Change-Id: Ic21556e8118a5b5d3b4a06ed6d3a7002f606f2ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 17:38:02 +00:00
Brian Wilkerson 9517c22b39 Improve the fix for empty_catch
The fix for empty_catch should not remove the catch clause if doing so
would leave the try statement invalid. It could remove the whole try
statement in such a case, but it isn't clear that that's a good solution
in general. This at least patches the issue until we can decide whether
additional work should be done.

Change-Id: I7c5190faba9fd5632c04708007bc65bb18d3db6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134087
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 17:37:22 +00:00
Brian Wilkerson 5d7f3093fd Update the lsp generator to generate return types for all methods
Change-Id: Id1a90d770aa772327011ee8ccc7a13f0ca6f8de4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-30 21:43:43 +00:00
Brian Wilkerson 58a9c22f80 Add return types to more methods in analysis_server
Change-Id: I65bed353bcff4f991faf8c3bdde979789a8d962b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-30 21:43:34 +00:00
pq fccae66fa6 require type for dynamic var decl splits
Fixes: https://github.com/dart-lang/sdk/issues/40239

Change-Id: I67da61874bdba2f27381436b009687ed2f3810e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133960
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-30 17:50:28 +00:00
pq 9a572c70fa call() suggestions for FunctionTypes
Fixes: https://github.com/dart-lang/sdk/issues/40270

Change-Id: Ic6f882391d1450b43cc224d5ec908589239c590e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133941
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-30 17:43:40 +00:00
Sam Rawlins bad477ded3 NNBD preview: properly render deleted regions
Fixes #40295; fixes #40314

Change-Id: I28d60754d601cbf8cd3403cc576d55e7a0c12e9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133870
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-30 17:33:28 +00:00
pq ca3c83b654 remove unneeded <Widget> assist/fix annotations
See: https://github.com/dart-lang/sdk/issues/40378

Change-Id: If404a3c248ee671f6f3ac9e07848ad71faf45e67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-01-30 16:50:28 +00:00
Sam Rawlins 7a3e1e7384 NNBD Preview: Fix region detail links to _not_ be POST links
Additionally fix un-highlighting upon new highlight.

Change-Id: I4ee85371bec11ed70cc31798519cdea3061474d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133864
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-30 05:02:30 +00:00
Sam Rawlins 1d4651f119 NNBD preview: Fix test for generic function types; typedefs still not fixed
This goes a long way to address #40034, but typedefs still don't work.

Change-Id: Ice6a9111a793def151d10bb3fa3d1a8e7db8d3a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133862
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-30 00:29:50 +00:00
Paul Berry a49dce0631 Migration: remove the "propagation step" part of the instrumentation interface.
It didn't wind up being used, and its presence limits our ability to
modify the graph propagation algorithm (which I plan to do in a
follow-up CL).

Change-Id: I48a9b879f25295075e8d95eb3fb0185839303957
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133425
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-29 18:30:46 +00:00
Brian Wilkerson 8efdee06d6 Begin adding return types in analysis_server
Change-Id: Id0daa52236bdc90cba6bfd7cf81d1b4cf47603c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133544
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-28 21:18:30 +00:00
Brian Wilkerson 85083ca5ab Enable avoid_return_types_on_setters in analysis_server
Change-Id: Idc4a05c30ce153d59d3b9e96b3803b18dc8c6edb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133437
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-28 16:25:18 +00:00
Sam Rawlins a6e01c23e2 Fix more windows tests in migration tool
No need to HTML-escape the root path; no HTML will be included.

Change-Id: Ibf9a19000a11207782b7b0d0f9222397f6d042fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133426
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-27 19:08:56 +00:00
Sam Rawlins 548127daa1 Fix Windows analyzer tests.
Don't map the unit path in the region renderer.

Change-Id: I2c947302626e320dea587efc0240316fc62d0dc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133164
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-27 16:16:06 +00:00
Brian Wilkerson 81c5d11691 Change tests of lint-based quick fixes to not require the lint marker in the result
Change-Id: I2a7e35c9754a5108e3d664684b8c2109b5689c58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133409
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-27 01:48:25 +00:00
Brian Wilkerson 61199914d7 Convert dartfix to use underscores rather than hyphens for fix names
Change-Id: I0bd264e8c0e196aa7a5a8cb46fc940242a844f07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133406
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-26 22:56:36 +00:00
Brian Wilkerson d29c5c174c Refactor dartfix to make the handling of lint fixes uniform
Change-Id: Ib329ec89bf19fa0c7d76b7f9ccdd796e20f71a9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133404
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-25 23:09:55 +00:00
Brian Wilkerson 9609975262 Update generators to not produce type annotations for variable declarations
Change-Id: Ia19c94b430192c606d12449011503d5ca8172feb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-25 16:31:15 +00:00
Brian Wilkerson 9918987c59 Enable prefer_if_null_operators and prefer_spread_collections in analysis_server
Change-Id: I14fa2e9a3196be1d5f5d7991104e7363c72b3fe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133334
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-25 16:31:07 +00:00
Brian Wilkerson 4cc45ec612 Cleanup some analyzer hints
Change-Id: Iba36b028895c56ef1f9831ef00650fde6527fbfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133361
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-24 23:00:13 +00:00
Paul Berry 2edd8d17c0 Migration: replace ?. with . where appropriate.
Change-Id: Id32f60caec0c25099704652c03fafc8b184bf4d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133241
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-24 19:58:43 +00:00
Brian Wilkerson c9b56d3530 Remove support for default fixes from dartfix
Change-Id: I497f48ee0930829adf44a510101181578a4a9c86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133242
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-24 18:33:05 +00:00
Sam Rawlins 322b2493b7 NNBD preview: Fix recent display issues; fixes #40307
Change-Id: Ief1a795fdf6b52a77c43ed0435d96bb4350fd1f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133202
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-24 17:32:09 +00:00
Sam Rawlins bc9348829e NNBD preview: change the Edit Details response to be JSON
* Also changes Edit Details to be an ordered list
* Also changed explanation to not include a `.` at the end;
  append it in JS if needed
* Also add POST click handler to unblock the POST edit work.

Change-Id: Ifc11f8d9e0194b58cd7d81028bac19e89887c7e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133169
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-24 04:33:01 +00:00
Brian Wilkerson 3d7dd5bfe0 Remove the notion of required fixes from dartfix and the server
Change-Id: I55389e1978d11820142961b5997d2187d1e61bae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132973
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2020-01-24 01:05:41 +00:00
pq 169dd530f3 de-dup mutiply exported elements
Change-Id: Id83d93207e32d069274b61a1352c99fb1bb940ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133151
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-01-23 23:54:01 +00:00
Sam Rawlins 0263d4daf3 NNBD preview: Make navigation directories collapsible; closes #40109
Change-Id: Icc6ef0627533ac1ff925bd69c3e5b172fca9c514
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133140
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-23 22:17:19 +00:00
Paul Berry 8f0e00eb1c Migration: Fix hang in preview server when an exception occurs.
See https://github.com/dart-lang/language/issues/791 for a detailed
explanation.

Change-Id: Iafcc2fa52b622e5db9dfc49ede595d0435a69f84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133080
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-23 20:00:39 +00:00
Brian Wilkerson 2ffe48efd9 Update a preview site after adding or removing a hint
The code to update the graph is still missing, but I believe that this
gets us closer to having everything plumbed through.

Change-Id: If3e66e3c77a04a8f043dcccf4346b379d16e573f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133000
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-23 16:43:57 +00:00
Paul Berry e0f97cda30 Migration: switch to using the FixBuilder.
Change-Id: I41e978439d36a26e55be71071a931390eb3dbf57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-23 16:06:57 +00:00
pq 90b74dcc97 element info for Function call suggestions
Fixes: https://github.com/dart-lang/sdk/issues/40286

Change-Id: Iaf9e36d4f29f4b2908be4ab42f0e8e997bdc8a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133001
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-01-23 00:40:01 +00:00
Paul Berry d0d232b66c Report an exception to the client if EditDomainHandler.dartfix encounters an exception.
Previously, an exception happening during EditDomainHandler.dartfix
would result in no response being sent, so dartfix would simply hang.

Change-Id: I5cadf78042cb91f1b11b1438a1699818f4dae74c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132963
Reviewed-by: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-22 23:39:19 +00:00
Brian Wilkerson 500822341e First steps to allow migration to be incrementally rerun
Change-Id: Ib4e682739a732ad9b8863ecb780ad88e5cbd9c6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132921
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-22 20:23:38 +00:00
pq 6e091bd781 Function call() suggestions
Fixes: https://github.com/dart-lang/sdk/issues/39761

Change-Id: If7dbe8b29fd081cd77310343a4cba0d7355c45e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132920
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-22 19:44:48 +00:00
Sam Rawlins 6b32a519bf Add an Edits panel, listing all edits in a page; #40115
Change-Id: I7e6f60d25bf85030fd4d3a700677d789f3978345
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-01-22 16:02:08 +00:00
Paul Berry ce5a0f5e32 Migration: fix instrumentation when dropping the condition and else parts of an "if"
When migrating an unnecessary "if" test like this one:

  if (x != null) {
    Do something;
  } else {
    Do something else;
  }

We make two modifications to the user's file:
- Drop "if (x != null) {"
- Drop "} else { Do something else; }"

With this change, the first modification has a description of
NullabilityFixDescription.discardCondition and the second has a
description of NullabilityFixDescription.discardElse.  Previously,
both modifications had a description of
NullabilityFixDescription.discardElse, which was confusing.

Change-Id: I6407d7616b7a2d2c8af853ab48c3480959c4fdb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-22 15:29:37 +00:00