This CL does three things.
First, it makes the output options more fine grained to allow us to get
the information we're after without getting information that we don't
care about at the moment.
Second, it prints the unconditional output in a more compact tabular
form so that it's easier to read.
Third, it adds support for outputing a high-level comparison of multiple
experiments to make it easier to gauage the impact of a change.
Change-Id: Iee8b1eb126de43cb08c27a1b60036090fffc0421
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174941
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
The directory contains tools related to code completion that are not
used to measure completion metrics, so the old name was too specific.
Change-Id: Ie8745901655df6e7b29da645b3b0a48011ca9f10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174483
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This restores the ability to compare completions being computed under
different conditions, though at the moment it requires code changes
rather than being controlled by command-line arguments (largely because
there is only one condition available to be tested).
It also removes an unused getter.
Change-Id: I67d56b8543f33234400fe3289ab14813d01bf8ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173640
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
It's no longer just for the tools in the `tool` directory; it also
contains test utilities for use by the analyzer and related packages.
Change-Id: I0f8cf57f24ea7aad8e2177e43ee2bcb2ab3030da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171704
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL unifies the implementations of `package_root.dart` found in
packages `analysis_server`, `analysis_server_client`, `analyzer`, and
`analyzer_plugin`.
This should make it easier to re-use this logic in other packages,
such as `nnbd_migration`.
Change-Id: I0da44edb379b8e929dd0b1c16a6989c1e9418acb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This ensures canParse() methods correctly handle literal types from the LSP spec instead of allowing any literal of the same type to pass.
Change-Id: I4876f4adc8de1d9138e0f62868aa6a8a010b9102
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162753
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
In follow-up CLs I will update error reporting logic.
Change-Id: Iee42088beffee3915a2ef6a4c8cb5c1031535d4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158149
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
In follow-up CLs I will update error reporting logic.
Change-Id: Id07b861aa117b93e0c869ad0b52c048085706ee6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157801
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
In a follow-up CL I will update error reporting logic.
Change-Id: I6fd2916c24a531b1f41bd2872301ffec1fdb8722
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157382
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
It is up to the higher level clients to decide how to find SDK.
It is not API, and is not referenced internally, so we can land it
without going through breaking changes.
Change-Id: Id428519fa9bb3c38368f095c0f358e07f65c45b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
These cases are collected sorted and printed back out to help us improve the context type algorithm, that is we may choose to in completion locations 'var i = ^', to assume that the user will be entering an int type.
Change-Id: Ia3e4663b2cf1614935ff49a4ab10299db0dc909d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151783
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
There are two reasons to disable it.
1. This contributor talks to the file system, and for Cider this
operation is too slow.
2. It just does not work. We need `SourceFactory` for it, and the
way we get it is not compatible with the Cider's `AnalysisSession`
mock.
R=brianwilkerson@google.com, keertip@google.com
Change-Id: I652c4f438dbab2a9fa220878ff09d47c14434cd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151806
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
I will follow up with some additional fixes and tests for map and list literals.
Change-Id: I1a26e8f900dcf13402385a49e8f3538c5d1b39df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151030
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The values are now only printed when `verbose` is enabled, and are
sorted based on how mig an impact completions in those locations are
impacting the total.
Change-Id: I913f82e57cf0a97d3465b0b41d9431ca3cf56e30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150262
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This reverts commit a2c3ecabce.
Reason for revert: Breaking change to de facto API
Original change's description:
> Remove DartSdk.useSummary.
>
> R=brianwilkerson@google.com
>
> Change-Id: Ifa851f4af47a973d65c528c6d07fcac0a515134b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149495
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
TBR=scheglov@google.com,brianwilkerson@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I9998bedb74ea940371f18ac7dce42b2f5dcc3b98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149687
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
There was a bug earlier in which we were attempting to use a relevance
table (MethodInvocation_arguments) that was not generated. I thought
the bug was that the table wasn't being generated, so I attempted to
generate the table (in relevance_table_generator). But the table can't
be generated and the real bug was that the wrong contextLocation was
being generated when computing the OpType. So I backed out the earlier
change and updated the generation to generate the right location.
Change-Id: Ifbd2c6c3e11e1e98887108be7eb6d90e90452446
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149381
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This adds tracking of how often type parameters are declared and how
often import prefixes are used.
It also removes the code to convert to and from JSON because we don't
need it.
Change-Id: I7f3b19e9f82bd8aa1b327797726839ff63837795
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
We used to be somewhat inconsistent about the choice of element kind for
top-level variables, getters and setters and fields, getters and setters
in classes, mixins and extensions. We no longer use GETTER and SETTER as
kinds, using FIELD and TOP_LEVEL_VARIABLE everywhere. This makes some
cases better and some worse, but improves the overall score across all
the completions in our metrics.
Change-Id: Idd0b10b3afe6023ecf39930b6a09abf28b3232bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148883
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
The doc comments from flutter are sometimes very long.
Change-Id: Ie20d75101fd2bef9b35a3fbeb5277a282f9215c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148662
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
The code to check the element kind was not being used in a few places
because (a) the generator wasn't always generating a table when it
should and (b) the key for the table wasn't always being set when
creating the OpType. Both of these issues have been mostly addressed.
That required re-generating the element kind tables.
There were several places where context type information wasn't being
used when building suggestions. This has been fixed for all the places
I'm currently aware of.
There were a couple of places where the context type wasn't being
computed where it could have been. I have fixed the places I'm aware of.
Context types were not being computed anywhere because of a bug that
has now been fixed.
There is now one place that computes and caches the context type, which
should improve performance slightly.
I also removed some dead code that I discovered in the process of making
the other changes and cleaned up a couple of places in the code that
were suboptimal.
Change-Id: Ieae8dcc71b986841be3078d6e0b3a653c35384b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148237
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Sorry about the size of the CL. I can split it up if you'd like.
In order to do this I added a listener to SuggestionBuilder so that we
could capture the data as suggestions are being built. If it turns out
to be a performance problem we can remove it before shipping it, but it
should only impact the new relevance path, which isn't being used yet in
production.
This splits the "worst" and "slowest" (formerly "longest") results into
three groups. I might find it useful to split them out into more groups
later, but I think this gives me a good place to start.
This also adds a new flag to disable running completions using the old
relevance values. That cuts the time to get data by 1/3 to 1/2.
All off these changes led to a fair bit of refactoring to try to reduce
duplication (both existing and what would have been added if I hadn't
done the refactoring).
Change-Id: I5e8dcbba2c01b3665eb486f183f6ad8014285413
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148002
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: Ie1373e93092023caf5e0bcfd6bb88bfb422d5daf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
This adds support for analysis domains that plugins contribute to by
sending notifications. I've only implemented folding so far, but most
of this CL is to cache results from plugins and to adapt sending server
capabilities.
Instead of using a NullNotificationManager, the LSP server now uses a
regular NotificationManager, except that results won't be forwarded to
clients. LSP handlers will fetch partial results from plugins and merge
them with data from the server that will be computed when needed.
I've extracted the server capabilities calculation from the init
handlers into ServerCapabilityComputer. It will also contain the
interestingFiles glob from active plugins and re-register capabilities
whenever plugins change.
Change-Id: I9869240cbfa284592e952498933e638b89a2a763
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142981
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
See the email I sent as background.
Change-Id: Ib4f558a2dfdf585236e99d695bdfcaff045c95c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143940
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
I think it's safe to remove the experimental status at this point.
Change-Id: I3a992e7134633d1e9de0bba0f1a3d2ff357fd8b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142884
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
1- remove the token to complete, and then attempt the completion
2- remove the token and the rest of the file, and then attempt the completion
The default remains that there is no overlay, the file remains the same and the completion attempt is made at the starting character of the token.
Change-Id: I45f840fef295f2da12f2278445f85152b6c17262
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142521
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>