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>
Reason for revert: it was a breaking change to the analyzer public API.
There were two breakages:
- A @required `languageVersion` parameter was added to
AstFactory.compilationUnit, which is part of the officially
supported analyzer public API.
- A @required `languageVersion` parameter was added to the Parser
constructor, which is not part of the officially supported analyzer
public API, but is part of its de facto public API due to the fact
that it is used by dart_style.
This reverts commit ce26dfda7d.
Change-Id: I507103ea6f6ffabf915d6f56e9f24454725c3930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136851
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL fixes several minor bugs:
- In info_builder.dart, we were trying to apply SourceInformation from
the defining library to all its parts.
- In NnbdMigrationTestBase, we were trying to fully migrate each file
before processing any other files. We need to prepare each input,
then process each input, then finalize each input.
- In NodeBuilder, we were failing to send part file sources to
NullabilityGraph.migrating(). As a result, methods declared in part
files were being treated as already migrated, so they were getting
the wrong kinds of nullability nodes.
- In _ProvisionalApiTestBase, we were sometimes visiting parts before
discovering what libraries they were part of, causing inconsistent
resolution results.
I'm hoping this will be sufficient to address
https://github.com/dart-lang/sdk/issues/40670.
Change-Id: I07d693b31b6cf64bc6f72126f5ef4792b29e5029
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136521
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Since deleted code is shown in red in the preview tool (rather than
being deleted), we should only look at insertions when computing the
offsets for applying navigation links to the preview text.
Fixes a bug wherein a large block of deleted text near the top of a
file would cause a crash due to a bogus negative offset.
Change-Id: I704b2cecaf4b93eeb91f16d9bd5890ad3e3080e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136403
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
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>
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>
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>
Adds analysis error tracking and fixes the enum declaration to not produce a warning.
I'm not happy with `assertNoAnalysisErrors` and would like something more configurable and context-aware but haven't thought it fully through.
Maybe something like:
```
assertNoErrors(
except: ['unused_import'],
);
```
(And maybe a file and line number?)
Alternatively, we could add ignores to the test sources:
```
import 'a.dart'; // ignore: unused_import
```
and maybe special case the line we're completing on:
```
f(^);
```
Still mulling it all over but your thoughts are welcome!
Change-Id: I1d0c5fbd72c80dde13ae98cb76c3728ab00a12f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135440
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
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>