Move logic out into a ContextCache since we're not interested in caching
at least two if not three things (the options, the options path, and
optionally the builder).
Move some convenience methods around accessing contexts into a mixin.
Regarding some semantic decisions for finding analysis roots:
* treat the analysis_options.yaml file as the analysis root if it exists
* if it doesn't exist, assume the directory passed in is the root
* if custom options are provided, assume they "overwrite" the others
_in-place_.
Tests to confirm this logic via excludes configurations with & without
the yaml file specified, passing in the root in some cases and
subdirectories in others.
Also change to use PathFinder for handling wildcards in excludes.
Bug: 31343,31344
Change-Id: I400fe30a1ec379f9040f812fc0bd9481d42a13cf
Reviewed-on: https://dart-review.googlesource.com/41570
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
In CLI no batch, support analyzing multiple files in multiple contexts
Support `dartanalyzer pkg/a/foo pkg/b/foo` and use a different context
for each.
Requires knowing the source being analyzed while creating a context,
which gets a bit hacky with build mode, but seems to work as is.
Suggestions on a cleaner integration there are welcome!
Change-Id: I2648fdb80c0a36a05580ef7267350ffb847c43e9
Reviewed-on: https://dart-review.googlesource.com/42582
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
We have decided to move to a different API for Fasta/Analyzer
integration, one that doesn't involve compiling to Kernel or observing
type inference. The listener API will become broken, so let's just
remove it before that happens.
We lose the ability to trace type inference so let's restore that
ability next. The analyzer's resolution storer is not used, but that
code has been left. The resolution applier will no longer work
without the resolution storer, so those tests have been disabled.
Change-Id: If9ac5aba2d5de7788d8a65f7fa8410599e636d21
Reviewed-on: https://dart-review.googlesource.com/42400
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This reverts commit 126bfebb4e.
Reason for revert: Fails on windows due to forward slash paths, and seems to have one or two other secondary issues.
Original change's description:
> In CLI no batch, support analyzing multiple files in multiple contexts
>
> Support `dartanalyzer pkg/a/foo pkg/b/foo` and use a different context
> for each.
>
> Requires knowing the source being analyzed while creating a context,
> which gets a bit hacky with build mode, but seems to work as is.
> Suggestions on a cleaner integration there are welcome!
>
> Change-Id: Ia4e63fe01342f2299c96ca8d34ca983a9280a911
> Reviewed-on: https://dart-review.googlesource.com/41900
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
TBR=scheglov@google.com,brianwilkerson@google.com,mfairhurst@google.com
Change-Id: I0e90d8d4e2256b7087daeeb934ed14da57fd20df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/42540
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Support `dartanalyzer pkg/a/foo pkg/b/foo` and use a different context
for each.
Requires knowing the source being analyzed while creating a context,
which gets a bit hacky with build mode, but seems to work as is.
Suggestions on a cleaner integration there are welcome!
Change-Id: Ia4e63fe01342f2299c96ca8d34ca983a9280a911
Reviewed-on: https://dart-review.googlesource.com/41900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
(was reverted in https://dart-review.googlesource.com/c/sdk/+/40980
due to an analyzer bot breakage)
Original commit message:
Implement proper checking for callability of Function class.
There was some old (incorrect) logic for doing this, behind the flag
enableStrictCallChecks. This flag has been removed, since the new
behavior is now standard in Dart 2.0.
Fixes#31509
Change-Id: Ice5cf38bbc648badf7f2563ff930b69f9a799635
Reviewed-on: https://dart-review.googlesource.com/41120
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL deprecates the front-end API and moves it into src/api_prototype.
For now all usages have been updated to point to the new location,
but they should be updated to use custom-client invocations instead (e.g.
one specific way for DDC, another for dart2js etc.)
Bug:
Change-Id: I9b4f41f6ebf55d42510fd35240d942d1dc7292d6
Reviewed-on: https://dart-review.googlesource.com/24822
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
At this point KernelDriver is used only by Analyzer, so I don't include
anyone from the FrontEnd team. We will merge to get the same performance
benefits of the latest IKG approach, but later.
Only just enought integration is done - we can store and apply
types in the local variable declaration.
Everything is in disarray, I will follow up with improvements.
R=brianwilkerson@google.com, paulberry@google.com
Bug:
Change-Id: Ie3434e26233b84fb019c50a7cc834a08d0dadbed
Reviewed-on: https://dart-review.googlesource.com/22202
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Also fix Fuchsia tools to account for new project location (//third_party/dart).
Change-Id: If89a934729c4fa44229eaca83219dbdf8bb700a8
Bug:
Reviewed-on: https://dart-review.googlesource.com/14800
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
This allows us to collect stats about language-style tests as follows:
./tools/test.py -m release -c dart2analyzer -r none --preview-dart-2 --report \
language language_2 corelib corelib_2
As of this morning, the command above has 87% of the tests passing.
Change-Id: I0f84211d5f33659d5923601267367be90c578107
Reviewed-on: https://dart-review.googlesource.com/3381
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>