Work towards https://github.com/dart-lang/sdk/issues/60635
I tried to keep this minimal but still sensible:
* Rename AnalysisErrorListener and all subtypes to use 'Diagnostic'.
* Rename all instantiations of such classes if they previously
contained the word 'error'.
* Rename `RecordingDiagnosticListener.errors` to `.diagnostics`.
* Rename some _testing_ instance members that had the word 'error'
to instead use 'diagnostic'.
Change-Id: I3948e27ba28ac2494092e04f4e1d201a20cc1135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433004
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This is a big CL; no code is really "changed." We basically move 3
components into the public API, which can all be reviewed concisely
in the `api.txt` file.
* The AnalysisRule classes: `AbstractAnalysisRule` (which is good to
make public as a lot of the public API is specified and documented
here), `AnalysisRule`, `MultiAnalysisRule`.
* The Pubspec classes, available for linting pubspec files:
`PubspecDependency`, `PubspecDependencyList`, `PubspecEntry`,
`PubspecEnvironment`, `PubspecGitRepo`, `PubspecHost`, `PubspecNode`,
`PubspecNodeList`, `PubspecVisitor`.
* The `RuleVisitorRegistry` class. This class is needed by analysis
rule authors, and is part of the public API of AnalysisRule.
Change-Id: Ib1803180de9469f4ff39cf1778f96787f5f74b14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432363
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This gets rid of (what is described in commented code as)
InstantiatedTypeWithArgumentsTest, Subtype1TestCacheLookup, BoolTest.
Running this through the benchmarker like this:
```
out/ReleaseX64/dart-sdk/bin/dart pkg/front_end/tool/benchmarker.dart \
--snapshot=pkg/analysis_server/bin/server.aot.1 \
--snapshot=pkg/analysis_server/bin/server.aot.2 \
--arguments="--disable-file-byte-store" \
--arguments="--train-using" \
--arguments="pkg/front_end/lib/"
```
(there `server.aot.1` is without this CL and `server.aot.2` is with)
I get:
```
msec task-clock:u: -0.9614% +/- 0.3557% (-78.23 +/- 28.95) (8136.80 -> 8058.57)
cycles:u: -1.0257% +/- 0.3626% (-348283560.66 +/- 123129577.69) (33955507948.94 -> 33607224388.28)
instructions:u: -1.0595% +/- 0.0662% (-479117043.74 +/- 29935955.93) (45220681554.68 -> 44741564510.94)
seconds time elapsed: -0.9548% +/- 0.3540% (-0.08 +/- 0.03) (8.15 -> 8.07)
seconds user: -1.0649% +/- 0.4031% (-0.08 +/- 0.03) (7.80 -> 7.72)
Scavenge( new space) goes from 130 to 129
Notice combined GC time goes from 2613 ms to 2608 ms (notice only 1 run each).
```
`StackImpl.pop` as reported by `perf report --no-children` goes from
0.81% to 0.34% (and I'm unsure why the apparent change seen as a whole
is quite a bit bigger).
Change-Id: Ife36da11215e0c8aa706d945f0ee5018ad03ab91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This changed definition is required for google3, in order to support
using `WorkspacePackage.isInTestDirectory` over the `inTestDir`
extension getter.
Then remove linter's export of the `inTestDir` extension method, and
instead rely on WorkspacePackage in lint rules.
Change-Id: I81fc6a27ca8f19f71a8b915edb3968d5d43262ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431943
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
When we use it, we already have a method declared, it is just that
its types are not specified. OTOH, combineSignatures() creates
a new sythetic fragment / element.
Change-Id: I5f735c1c09ade12c12294c3a6fd6894ba706eac0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431980
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
For the analyzer plugin APIs, these classes should not have the word
'Lint' in them, as they are used for all analysis rules, whether they
report lints or warnings.
* LinterContext -> RuleContext
* LinterContextWithParsedResults -> RuleContextWithParsedResults
* LinterContextWithResolvedResults -> RuleContextWithResolvedResults
* LintRuleUnitContext -> RuleUnitContext
I'm open to better names for these. Some of these suffer from a
chain-of-nouns name (a "RuleUnitContext" is a Context for a Unit for
a Rule). So we could go with "UnitContextForRule" and "ContextForRule"
or other ideas like that.
Only RuleContext and RuleUnitContext will be public API.
Change-Id: I5550736beaba7e39b36e7b5584ca6d023aa4d02b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
For now, we have a not nice looking way to write / read Element(s). Most
of the elements are stored as their first fragment, and then asked for
elements. I start with PrefixElementImpl2 to stop doing this, and switch
to writing actual element reference. When we are done with all elements,
it will become nice again.
Change-Id: Ia18c2ab516ae06dc0da0b1ab022f217bf9a7400d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431702
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
I few references to `Fragment` were converted to `FragmentImpl` because
it was a convenient time to do.
We added throwing implementations of `Fragment` methods to
`PrefixElementImpl` and `Member` temporarily. We remove
`PrefixElementImpl` completely in the next CL, and eventually `Member`
also will stop implementing `Fragment`, and will implement only
`Element`. But for now it would be a too big change to me to do at once.
Change-Id: I9cf9034a9c45e9baee6ab7421d7ba4d50b6c45c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431622
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Several call sites intentionally discard a future; these call sites
have been wrapped with `unawaited()` (which is the standard way to
suppress the lint).
Turning on this lint uncovered several tests that should have been
async; these tests have been fixed.
Change-Id: I66e0f6bf7a05946e8d460ce9b5581837ce067870
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
We give the interface its own ID to track its changes.
We also stop collecting requirements of a summary bundle _after_
computing library manifests for it, because any data that we put into
library manifests depends on what we requested while computing it,
not much different than the summary / elements themselves. Specifically,
interfaces for classes have `map` of all class members, and it
depends on the interfaces of superclasses. And we ask for interfaces
of classes only when computing library manifests, somehow we avoided
doing this while linking libraries.
test_dependency_class_interface_addMethod would not work without
these changes.
Change-Id: I14858bab48ff2ada8df32b8440b8f18eb743d061
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
This CL fixes co19/LanguageFeatures/Static-access-shorthand
/semantics_A05_t01.dart.
While working on this, I realized the static type was wrong and we weren't doing any inference for the constructor references so I updated the logic.
Unit tests passing, language test expectations are actually better than before and that particular co19 test passing.
Bug: https://github.com/dart-lang/sdk/issues/59835
Change-Id: I7437079c33640f53f48a4445890fadfebc9ec158
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430561
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>