Commit Graph

634 Commits

Author SHA1 Message Date
Brian Wilkerson f617f92c15 Capture the syntactic metrics removed from relevance-metrics
Change-Id: I89f7112ad31f41b0b6bc406156f4371fa373d62c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139842
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-17 19:35:55 +00:00
Brian Wilkerson 169b88654d Split out metrics computations for static members
Also did a little cleanup and sorted the file.

Change-Id: I7bb288345abf851dd88d6f7cf28e4d49ade75ec6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139829
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-17 19:23:27 +00:00
Jaime Wren 810d85d4cf Measure and report the average number of milliseconds it takes per code completions.
Tests to come for the new class.

Change-Id: I387ec41966e8db674c0be26124a9dcb8abeeb30a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-03-16 19:58:20 +00:00
Konstantin Shcheglov 51f5636daf Report FLUTTER_GET_WIDGET_DESCRIPTION_CONTENT_MODIFIED when a file is changed during the request.
R=brianwilkerson@google.com

Change-Id: I9d77df28dd16fdaf30ba4dd04fe8cfff221c236d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139144
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-03-12 01:09:00 +00:00
Jaime Wren a7b8401517 Add a Stopwatch to time the completion_metrics.dart
Change-Id: I05ba8ac79ffa6a63c1cf66a79410d289d3659a29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-03-11 18:24:09 +00:00
Jaime Wren 1d5601e7f9 Modify the completion_metrics.dart algorithm to compute the set of completion suggestions with useNewRelevance set to true and false, and printing out each set of results for comparison.
Change-Id: I2510d247b1ee7397cfb5a01e6e87a3015543bc31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139036
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-03-11 17:33:59 +00:00
Jaime Wren 699f4b7395 Add additional metrics into the completion metrics algorithm, MRR broken apart by type member completions, and non-type member completions
Change-Id: I5fd0c6b0ac1f9f0450ba630964e335488046a698
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138912
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-03-10 19:48:21 +00:00
Brian Wilkerson d673c176ae Start implementing new relevance scores for members of a type
Change-Id: I5594da6c9f1b71d239593131c02b5b10a57a4725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138907
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-10 17:28:51 +00:00
Konstantin Shcheglov 83378633e1 Add the attachment with the content of the file being analyzed.
Change-Id: I75b1c61e2d04cd5e03ef4375e97ef3c9f4add874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138384
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-03-10 04:57:20 +00:00
Jaime Wren 005c5d7b52 Add an additional MMR "Max Rank 5" metric to the output of the completion_metrics.dart
Change-Id: I00ff65853eaef85bd33d76e930d7ba1d39783a14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-03-09 21:54:20 +00:00
Brian Wilkerson 52ad8dc2d2 Gather metrics on super invocations
This only looks at method invocations and property accessors. It doesn't
look at operator invocations. While it might be interesting, I doubt it
would be significantly different.

Change-Id: I51ffd612fdbf5b60470bd40cbe90f3c2b82fe1e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138883
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-09 21:47:40 +00:00
Jaime Wren f5dae48fac Add an ArgParser to completion_metrics.dart in the same manner as relevance_metrics.dart (https://dart-review.googlesource.com/c/sdk/+/138700)
Change-Id: I7a1cc9b6f042cff42b267ceda20233e061d167f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-03-09 20:33:30 +00:00
Brian Wilkerson 7bc171483e Latest changes to the relevance metrics tool
I created a class to hold the methods that compute feature scores.

I moved more of the code into the feature computer.

I addressed a couple of TODO items.

I implemented a couple of extra ways of viewing the data so that I could
convince myself of the right feature definition for the feature that uses
the context type.

Change-Id: I448eb74e93e854a75be32d2a16ab0b50e295f4a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138700
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-07 20:01:27 +00:00
Jaime Wren 69851f34c5 Remove the unused type hierarchy from the completion_metrics.dart
Change-Id: I71d4f2518f107d296b359f34c4a00c0e0a472d18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138568
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-03-06 00:16:31 +00:00
Brian Wilkerson bf5171cfd1 Add support for reporting how an accessed member related to the context type and extract feature computation
Change-Id: Id5cd64ac5aaa8b5f502f978e4dab5f9502efb47c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138560
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-05 18:42:49 +00:00
pq 2a13c38ca7 corpus support
Basic support for running metrics over a corpus (e.g., directory containing n packages).

Change-Id: Ie92fc6d035edbe57c1581ccb2bee9b60ea9594d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-03-04 20:36:36 +00:00
Brian Wilkerson c01417a00f Add more data and improve output
Change-Id: Ib99336a26a83c9d502f1e7d1873151387e68c364
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138263
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-03 23:02:13 +00:00
pq af9d78555e make git clone recursive
Change-Id: I967bc82d2b9dece0e3f60b8ea30ff76365e91540
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-03-03 21:36:23 +00:00
pq b774160615 handle null exception params
(This occurs if there is no catch keyword.)



Change-Id: I3d8d561f33f7d626b590d78be44d5cce2ec73ad0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138108
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-03-03 19:31:31 +00:00
pq 258cb9f0ae fix pub get
Change-Id: I2328e683d0838b777b03183aa04b07e4d7f02246
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-03-03 19:05:44 +00:00
Paul Berry aaa63b511c Make migration codegen traverse directories in a stable order.
Fixes #40505.

Bug: https://github.com/dart-lang/sdk/issues/40505
Change-Id: I846c4262845a30417ae2cac91997a65692473e42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138060
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
2020-03-03 16:42:51 +00:00
Paul Berry 6bd202e4d4 Sort declarations in generate_resources.dart
Change-Id: If4222c778226bf20d143991d0fd3ad03a4d6c6a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138040
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-03-03 16:42:51 +00:00
Brian Wilkerson 1c34d8ce57 Add a new command-line flag for server to enable the new relevance computations
Change-Id: If4c9e95a6e5e804fe480cf8a061ff95ec37651e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138002
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-02 18:55:32 +00:00
pq 8c06eb107d relevance computer fixes && corpus support
* addresses memory issues
* prints stacktraces
* fixes an unsafe cast and adds a null check

This is ripe for refactoring if you want to tweak how we're clearing inheritanceManager or generally address hygiene.

It's better enough to be useful as is though and if anyone wants to analyze a corpus, they'll want these fixes...



Change-Id: Ic3b623cb3915c26f4ba691e5c2ee979d1e41d51c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137683
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-27 21:45:14 +00:00
Brian Wilkerson 2d3b8fd0a7 Add completion metrics table of distance by depth
Change-Id: I22d62dada840476f786952c69b4371ed1bc4b080
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137660
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-27 21:27:43 +00:00
pq a54d4eb149 recurse to install corpus dependencies
Change-Id: I5d4f27bcd8d57212e3b11faf1a8e6feeba4f308d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-27 17:10:13 +00:00
pq 8fb0e62bab corpus index updates
removed "bad" repos.

Change-Id: Iaa17a3134468c57f6c158b5ef5af9a1cd854b7f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-26 23:19:11 +00:00
Brian Wilkerson ede57f9ed4 Add some finer grained analysis around arguments
Change-Id: I1eb106a8a28a3de4fc6160794b098afb46d8aef1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137400
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-26 22:27:11 +00:00
pq 97aac77d7f corpus path fixes
Change-Id: Id7a5d219cb5dd25dff77ce9167728ce769aed3e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137288
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-26 17:30:07 +00:00
pq 26acdfb310 clone and update corpus repos
Running this with `data/itsallwidgets_repos.txt` as an argument, should produce
a directory `third_party/download` populated with cloned repos ready for
analysis (`flutter pub get` will have been run).


Change-Id: I5f5c553a4f880c9970e502b4efa9359f224a68aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-25 23:46:14 +00:00
pq af99f4ba9b itsallwidgets corpus repo data
Change-Id: I5ae23e923651240d7404185afefab9c4fb88f005
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-02-25 22:34:06 +00:00
Brian Wilkerson 74c22eb789 Stop gathering information about the class of child nodes
While this information is interesting, it isn't useful, so there isn't
any reason to continue to collect it.

Change-Id: I9da5664d200787cb673fa1c468e9995ce94cf459
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136855
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-25 20:37:59 +00:00
Brian Wilkerson e187e42593 Stop producing trailing spaces when writing the last column of tabular data
Change-Id: I386795a266a81f0a1b9c0d71a1465c2642084498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136522
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-20 01:57:45 +00:00
Brian Wilkerson 3dc8cb0d2b Minor improvements to metrics gathering
Differentiate between class references and constructor references when
the class name comes first.

Start gathering data for general cases (start of expression, start of
statement) to determine whether we need fine-grained handling based on
the context or whether all expressions (for example) follow the same
distribution.

Change-Id: Iec403474aa19a3468fd15c0b90ec26392bf040f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136440
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-19 18:01:34 +00:00
Brian Wilkerson 36a6d509ba More improvements to completion metrics computation
Change-Id: Idbab7d6cb14d45e850a08f5ca87e15c90c434664
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136300
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-18 22:29:24 +00:00
Brian Wilkerson 87b7275704 Print completion metrics for similar contexts side-by-side
Change-Id: I9e6b2c68804ebb1f94aa360967f9288e651bc686
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135966
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-14 20:19:37 +00:00
Brian Wilkerson c84b9230cc Store strings as labels for completion metrics
This simplifies the existing code and will simplify the next change I
want to make.

Change-Id: I0acc67655dd78bf380f49cfdf2cb7643c7d595d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135882
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-14 17:58:47 +00:00
Brian Wilkerson 63c8bb7e46 Collect information about the AST structure at completion points
There might be a better way to get this information, but if we have a
constructor invocation the identifier is resolved to a class element
rather than a constructor element. This is an attempt to be able to tell
the difference between those two cases.

Change-Id: I6086d53c108686a42162108f764758bb97cffc3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135761
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-13 21:46:18 +00:00
Brian Wilkerson e75c9192a1 Start converting dartdoc style in analysis_server
Change-Id: I013659a0f34dafce4c091dc534e2ab8ef0469217
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135491
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-13 15:00:03 +00:00
Brian Wilkerson 86b1b9d03c Enhance member depth completion metrics
This now looks in mixins (which were ignored before) and finds matches
from interfaces, reporting the interfaces separately from the superclass
and mixin chain.

Change-Id: Id5f3379261e1ec184dc347abb371693481b65680
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135528
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-12 22:16:32 +00:00
Brian Wilkerson 4f6a5811fc Add json support to completion metrics computation
Change-Id: I43e987c946dc5c3b200ced14c132a31cc97b5f29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135560
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-12 21:03:37 +00:00
Brian Wilkerson 680e109ad2 Gather more code completion metrics
The code is now gathering both element and token data in several places
where it used to gather only one of the two (using a new utility method).

The metrics are now better labeled to make the output easier to read.

It's also gathering a new metric: the distance between the static type
of a target and the class in which a referenced member is declared.

Change-Id: I566c02b069749221983ec960b8a67b293052bd93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135400
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-11 23:55:15 +00:00
Brian Wilkerson 7ce78365bf Remove the old relevance analyzer
Change-Id: I8537fafa4997e9470e8b4c3f2a2f5b730ae3aa5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135360
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-11 19:55:54 +00:00
Brian Wilkerson cbc9c47145 An initial attempt to gather metrics to guide ranking of suggestions
Change-Id: Ic06466dfe5919cc3a462e35fb6328a02bc795229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135342
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2020-02-11 19:13:54 +00:00
Devon Carew 8f5b1ea9bb [nnbd preview] general UI improvements to the NNBD preview tool
Bug: https://github.com/dart-lang/sdk/issues/40487
Change-Id: I0864720d6a7f9d24a4582bb0034cbcb2875a54fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134767
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-06 23:37:55 +00:00
Jaime Wren efefe78522 [completion metrics] Add a simple CLI at the start of completion_metrics.dart. This will allow run configurations in IntelliJ hold onto the directory paths instead of being hard coded.
Change-Id: I90680e9a867a5dc48f20bfd8fac3ecece6177c3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134740
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-06 19:00:32 +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
Jaime Wren 5d3c91b68e Fix the MeanReciprocalRankComputer computation math, the computed MRR computation was not the MRR, follow up tests coming soon.
Change-Id: I3ae4486eada3ab41b21190050a7a7a2368432004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134414
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-05 19:18:51 +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
Jaime Wren 270829d7eb Refactor the CompletionMetricsComputer class into three classes: a subclass and two concrete classes, AbstractCompletionMetricsComputer, CompletionCoverageMetrics and RelevanceAnalyzerMetrics.
This change breaks up the lengthy algorithm, and greatly speeds up the Relevance Analyzer tests.

Change-Id: I4273bcabe7399f80aa751c5963a53fa04e1b4d25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-02-04 19:34:56 +00:00