Commit Graph

4726 Commits

Author SHA1 Message Date
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
Jaime Wren e5d5434715 Standard output improvement from metrics_util.dart to print "<no counts>" if the counter has no counts.
Change-Id: I3d01f539670bb8d57f6b04b16cc4f92aaa2aa1c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-02-03 22:50:07 +00:00
Jaime Wren 78fe10c3be Completion metrics change- add missing documentation in the relevance_analyzers.dart file, as well as adding DartCompletionRequest as an input to the analyzers
Change-Id: I31c2523252f2574f092b44ec8b67d346804ac856
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134220
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-03 20:50:26 +00:00
Brian Wilkerson 00e4d8f33d Change the tests of quick fixes so they can use real lint results
This adds support so that tests of lint-based quick fix tests can use
the output of the linter rather than cons-ing up a fake lint to drive
the test. It also converts many of the existing tests to use real lints.

There were/are an amazing number of tests that were invalid and needed
to be fixed. This includes fixes for some of them, but there are still
several tests that have not been converted because they fail when run
using the output of the linter. Some of these are invalid tests, but
some might indicate bugs in the quick fix generation that should be
fixed.

Change-Id: Iea806849ea111dc8454073e8fe44fd42c5208652
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134141
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-03 15:34:55 +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
Jaime Wren d772141960 Initial RelevanceAnalyzer support in the completion_metrics.dart algorithm with an initial example implementation of RHSOfAsExpression
Change-Id: Icaf3e80cb4d634f5871d576d3344210d631641c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134092
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 21:41:47 +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 26fec2ef66 Add return types to methods in analysis_server
Change-Id: I6149cd21df4df44aee0374db32e47e849aa9a960
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134047
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-31 00:26:49 +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
Brian Wilkerson d6206fbbc7 Add return types to more tests in analysis_server
Change-Id: Ib85d299a34cfda6bc4772d53f16d9ba44251bfbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-30 14:30:18 +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
Brian Wilkerson 0d3571b52f Add return types to more methods in analysis_server
Change-Id: Ib61c92d65e6170a1b5cd3e3d24affb3a3fa16bb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-29 20:18:20 +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
Jaime Wren 1ec1b4d68b Completion metrics cleanup for FieldFormalParameters.
Change-Id: Id9151e182446ea0cb21141230e0378cc8cd6efa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133668
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-01-29 17:47:56 +00:00
Jaime Wren 1aea141b6e In completion_metrics.dart, skip files that have analysis errors
Change-Id: Iae95f7370b6dd6725af607bcc794373b675d6914
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133666
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-01-29 17:40:16 +00:00
Jaime Wren 34e271a64b Don't include library directives in the completion metrics computations.
Change-Id: Ic86383ad23a55c92b079f8b55d24ce7c33f29c5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133681
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-01-29 07:36:02 +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
Jaime Wren b1be0d58a1 completion_metrics.dart change, don't expect completions when the completed token would be a dynamic type.
This change improves the number of successful completions from 96.2% to 98.2% on the collection library.

Change-Id: I6dffa3b6ad6c92be482ca0810c1c0aa558fdcbde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133545
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-01-28 19:25:29 +00:00
Jaime Wren 213c80c5dd Add a new counter in completion_metrics.dart to count and report the number of each token that was a miss.
Change-Id: Id78b1f65b4e75b3321f18be04e0589d521852c12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133502
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-01-28 17:21:03 +00:00
Jaime Wren ff1cd53725 completion_metrics.dart improvement with named arguments in method invocations.
Named arguments, i.e. the 'foo' in 'method_call(foo: 1)' should not be included, by design, the completion engine won't suggest named arguments already it the source.

This improvement changes the percent of successful completions from 95.4% to 96.2% with the collection package.

Change-Id: I182c09b62acfc28ed3ae852e1c8e500c6a2f4f3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-01-28 17:12:58 +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
Jaime Wren 59e8068169 Introduce and use a new class to compute the mean reciprocal rank after a run of the code completion metrics execution.
Change-Id: I72ee7fdc500d6310231b3b03a2722e63feee251a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133439
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-01-28 07:43:37 +00:00
Jaime Wren c352c6c0b8 Cleanup and refactoring in completion_metrics.dart
Change-Id: I46dd8b9f05d44dcb1d3d2f1088b95845427005c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133428
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-01-27 19:41:19 +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