Commit Graph

52 Commits

Author SHA1 Message Date
Konstantin Shcheglov 53c8eda967 Keep more specific types for AnalysisContextCollectionImpl to avoid downcasts.
It seems to me that implicitly expecting DriverBasedAnalysisContext
is equivalent to explicitly stating this with types.

Change-Id: I16ec14e73030d9b34242a2f4ad582e93fc44afa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189382
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-06 06:23:25 +00:00
Konstantin Shcheglov 9f986d2501 Migrate package:analyzer to null safety.
Change-Id: Iffe4370431587e46a141ddc72a86ceec29c163b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176486
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-02-01 18:56:04 +00:00
Konstantin Shcheglov 4a5ac9df57 Support for non-function type aliases in convertElement() and test navigation.
Change-Id: Ic2dcf6ad3faaf6712fdcbbe5197f332b6ba42e78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-26 06:40:00 +00:00
Konstantin Shcheglov b1196f7389 Use resolveTestCode() and resolveTestFile() in analyzer_plugin as in analysis_server.
R=brianwilkerson@google.com, pquitslund@google.com

Change-Id: I8d2a1dcc98bd58d00d4fed842174df4e9ca9f1d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179403
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-15 17:15:33 +00:00
Konstantin Shcheglov d2f2f734bf Replace findElementsByName() with FindElement.
Change-Id: Ia7b9d6785eb0d727c2bebee2b94fc6258b50d71c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179365
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-01-15 01:10:24 +00:00
Konstantin Shcheglov f950d94762 Simplify addSource() in analyzer_plugin/ tests.
Change-Id: Ib3810608ceaace11a3befcb2b6ceb6f7a527a9c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174224
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-28 05:12:47 +00:00
Konstantin Shcheglov 25b80442d4 Enforce that only Dart files can be changed after analysis in AbstractContextTest in analyzer_plugin/.
R=brianwilkerson@google.com, pquitslund@google.com

Change-Id: I2aefc2f4d2035d9e37ca36bf0c8ffc965a00aad9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174225
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-28 05:04:41 +00:00
Konstantin Shcheglov 6e311941bb Clean up WithNullSafetyMixin in analyzer/ and analyzer_plugin/.
Bug: https://github.com/dart-lang/sdk/issues/43837
Change-Id: I2282d0230e5ea0abdd2a08de2a16cfaa602c3cc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174223
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-28 04:56:46 +00:00
Sam Rawlins 38e3414748 analyzer_plugin: Prepare tests for Null safety flag flip.
Only one test suite featured tests which needed to be in Null safety, so
that was split into two suites. Otherwise, the changes very nearly mirror
those in https://dart-review.googlesource.com/c/sdk/+/169141.


Bug: https://github.com/dart-lang/sdk/issues/43777
Change-Id: I39219dc0157ac33d4be1d902930060577e659cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169244
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-10-28 04:26:17 +00:00
Mike Fairhurst 334d368146 [analyzer_plugin] Remove unused dart:async imports
Change-Id: I079d5f7c1f6c36d4e76ecd41b5d22e4199c1304c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161464
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-02 18:09:52 +00:00
Brian Wilkerson 6f15530536 Enable omit_local_variable_types in analyzer_plugin
Change-Id: I908e15b4820eab0e8375994ce3cebfac332306f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-30 04:06:49 +00:00
Brian Wilkerson 7494f58032 Enable always_declare_return_types in analyzer_plugin
Change-Id: I972f0e2569de64397828d887b1fb37fcf57e006f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133408
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-26 23:13:34 +00:00
Brian Wilkerson f34a25099b Enable slash_for_doc_comments in analyzer_plugin
Change-Id: I9cafff7fcbf6c8930e3ac8ddba05061601aa8223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132452
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-18 18:17:31 +00:00
Konstantin Shcheglov c3a2ed9555 Fix failing tests on unittest-asserts-release-win after analyzer Packages change.
Change-Id: Iec83b5d02d10e3b93f2e1e734bd155189f9ef2d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131780
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-15 03:10:24 +00:00
Brian Wilkerson ac8a2a657a Enable avoid_init_to_null in analyzer_plugin
All changes other than the analysis options file were made by dartfix.

Change-Id: I4c034327b39f938965c69e6eb504b8dc50267975
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-12 22:54:24 +00:00
Brian Wilkerson c547f5d933 Enable prefer_generic_function_type_aliases in most of the packages
Change-Id: I1338e731aa3f42f67fec605b20455a83fd5fce43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-27 00:43:14 +00:00
Brian Wilkerson 03c33360b7 Remove unnecessary uses of new in analyzer_plugin
Other than
- the change to enable the lint (in analysis_options.yaml) and
- updates to the generator (in tool) to stop generating 'new',
all of the changes were generated by dartfix.

Change-Id: I9d14b99ab748ef5b80f8800a802e20100eee04a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128577
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-17 20:12:05 +00:00
Mike Fairhurst 924ec34e01 Remove analysis logger, replace with calls to InstrumentationService
Change-Id: Ifddd58b731aa0af8f76a91261757997dc52a9fc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123328
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-31 21:26:44 +00:00
Konstantin Shcheglov 0a2de9238b Extract importLibraryElement() implementation, make it less pessimistic.
R=brianwilkerson@google.com

Change-Id: I916d4b761c8a9886dc701206c03cfd88c9f047ef
Reviewed-on: https://dart-review.googlesource.com/c/92021
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-05 21:05:45 +00:00
Konstantin Shcheglov 849285276d Extract and migrate ElementLocator tests.
R=brianwilkerson@google.com

Change-Id: I10914580c96daee9bae8794db477c6413a089c09
Reviewed-on: https://dart-review.googlesource.com/c/91850
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-03 17:26:46 +00:00
Konstantin Shcheglov f96a7fbc7d Create AnalysisDriver using AnalysisContextCollectionImpl in pkg/analyzer_plugin tests.
Mostly to ensure that AnalysisDriver/Session knows its AnalysisContext,
so we can check that a file path belongs to the context root.

R=brianwilkerson@google.com

Change-Id: I45798bcf2441716ade89e9f6ee40f2053ab18bad
Reviewed-on: https://dart-review.googlesource.com/c/87268
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-12-14 19:18:44 +00:00
Brian Wilkerson 235da6f45d Rename AstNode.getAncestor by deprecating it and adding the new method (analyzer)
Change-Id: Ia00d8cb7153bd9db798352aab00b2431ba709671
Reviewed-on: https://dart-review.googlesource.com/c/85540
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-28 21:04:57 +00:00
Konstantin Shcheglov b71948faee Consolidate MockSdk(s) into one, living in analyzer/lib/src/test_utilities.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I70946b8e6f790608ad52c8f27cd6f506673f7b0d
Reviewed-on: https://dart-review.googlesource.com/c/82710
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-02 21:52:44 +00:00
Konstantin Shcheglov 0299b98197 Renames for addPackageFile() / addPackageMeta().
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I9d710d76186f5e54592457ac8708551ac096a43a
Reviewed-on: https://dart-review.googlesource.com/c/82465
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-01 17:24:26 +00:00
Konstantin Shcheglov e223bd3628 Replace most of direct uses of MemoryResourceProvider with ResourceProviderMixin.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I87114418b63ef68665b9c3e487980a72db00ec6a
Reviewed-on: https://dart-review.googlesource.com/c/81744
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-27 17:50:10 +00:00
Brian Wilkerson 180b3dd301 Remove extra spaces in copyright notices in analyzer_plugin
Change-Id: Icf01fbdd84747fc92908fe5ca818124c5df992af
Reviewed-on: https://dart-review.googlesource.com/c/79640
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-13 18:05:23 +00:00
Brian Wilkerson 0cc7993ee3 Clean up a couple of hints in analyzer code
Change-Id: Ifd87f31f1441016d043fb2741ccf9dcd61ce0f0f
Reviewed-on: https://dart-review.googlesource.com/c/77674
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-04 14:54:28 +00:00
Konstantin Shcheglov e7e8786670 Replace MockSDK in analyzer_plugin to fix its tests on Windows.
I copied it from analyzer.

R=brianwilkerson@google.com

Change-Id: I6f39e4fca67deea9e0d0947cad2ff945feef09cf
Reviewed-on: https://dart-review.googlesource.com/77262
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-30 17:07:51 +00:00
Paul Berry 939497a0a3 Stop passing bogus "strong" parameter to SummaryBuilder.
This requires version 0.32.5 or later of the analyzer (which makes the
parameter optional).  In version 0.33.* of the analyzer, the parameter
will be removed.

Change-Id: I9a4eaf5a8ed445051864543d9da5e59a06cd635d
Reviewed-on: https://dart-review.googlesource.com/72552
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-01 03:54:16 +00:00
Paul Berry d04d304909 Stop using/generating spec.sum file.
For some time now, this file has had the same contents as strong.sum.
There's no point in keeping it around.

Change-Id: I793a41ca6cb1c47c68357f549d299fa95b96c4c5
Reviewed-on: https://dart-review.googlesource.com/71701
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-30 12:32:52 +00:00
Brian Wilkerson 0bcf767d4d Clean up more preview-dart-2 related code
Change-Id: Id1f81a635727f0f2fafb5dea4178f303c6ca4659
Reviewed-on: https://dart-review.googlesource.com/70143
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 14:43:12 +00:00
Brian Wilkerson 0bb8cbd9cb Use void in place of Null in analyzer_plugin
Change-Id: I21a3d3646c5906256e21fb8d7d71f8433b1b39e9
Reviewed-on: https://dart-review.googlesource.com/69500
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-11 15:30:28 +00:00
Devon Carew 6fc1dd4480 analyzer_plugin no implicit-casts.
Change-Id: I12e5d4da5b61938b3eb7cc7c0e2ade6a64510b9e
Reviewed-on: https://dart-review.googlesource.com/69201
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-09 22:41:41 +00:00
Brian Wilkerson 87f753dbd3 Replace some declarations of element with declaredElement
Change-Id: Idd62472b16cccaa98749a510197ec8d0f5053cb1
Reviewed-on: https://dart-review.googlesource.com/67820
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-08-02 16:00:36 +00:00
Brian Wilkerson ab1c1582b1 Remove deprecation hints in analyzer packages
Change-Id: I001e57239a87f2806be74052a5e7686245fea812
Reviewed-on: https://dart-review.googlesource.com/65000
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2018-07-17 15:22:07 +00:00
Devon Carew 2dd33c2a6c Have the package:analyzer strong mode option hard coded to on. Delete several spec mode only tests.
Change-Id: I5dffec68d9845fe75936d55100c03306b6eda363
Reviewed-on: https://dart-review.googlesource.com/64060
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-07-10 05:30:10 +00:00
Janice Collins 1afe71c08a Enable preview-dart-2 as default for analyzer.
Based on https://dart-review.googlesource.com/c/sdk/+/52340, but adds
the necessary plumbing through the test system to pass through
negations to strong and preview-dart-2.  Also adds support for those
negations to the analyzer.

Change-Id: I9793ff28bb593d25bbb0a2ed8736b5b53e0a62d8
Reviewed-on: https://dart-review.googlesource.com/52461
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-26 17:01:12 +00:00
Brian Wilkerson 7054d92a02 Remove some classes from the analyzer public API
Change-Id: Ic53a8426818b06f44c2876abd16c789589bf78b5
Reviewed-on: https://dart-review.googlesource.com/52421
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-24 15:28:15 +00:00
Brian Wilkerson b15860f43a Convert analyzer_plugin tests to pass under preview-dart-2
Change-Id: I4531491524de0e93391a75a3972f249d604f0e2b
Reviewed-on: https://dart-review.googlesource.com/46568
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-15 16:54:59 +00:00
Paul Berry e2f77056a5 Eliminate dependencies on pkg/front_end.
The API for pkg/front_end is still in flux so we want to avoid having
any packages depend directly on it (other than analyzer and
back-ends).

This CL re-exports some of the critical pieces of front_end needed by
analyzer clients so that those clients can access them via analyzer,
without having to directly depend on front_end.  It also updates
pkg/analyzer_plugin to make use of those re-exports.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2993123002 .
2017-08-07 09:46:30 -07:00
Konstantin Shcheglov 00d5012906 Format analyzer, analysis_server, analyzer_plugin, front_end and kernel with the latest dartfmt.
...instead of mixing formatting with actual changes in many CLs.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975253002 .
2017-07-13 16:28:18 -07:00
Konstantin Shcheglov 19265a82b4 Move findElementsByName() into shared analyzer/element_search.dart file.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2965133003 .
2017-07-06 11:51:17 -07:00
Konstantin Shcheglov 6323bedc58 Stop depending on LabelElement(s) to be reported in visitChildren().
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2973093002 .
2017-07-06 11:28:06 -07:00
Brian Wilkerson 6a7b9f441b Convert DartChangeBuilder to use AnalysisSession
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2969833002 .
2017-07-03 08:41:40 -07:00
Brian Wilkerson 0d315af354 Try again to fix the bots (TBR)
Review-Url: https://codereview.chromium.org/2926173002 .
2017-06-07 13:15:40 -07:00
Brian Wilkerson 8a724f7093 Port two completion contributors for use by plugins
R=danrubel@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2927663002 .
2017-06-07 09:14:49 -07:00
Konstantin Shcheglov a4fd5d814f Extract PerformanceLogger from AnalysisDriver.
I also added the runAsync().

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2883633002 .
2017-05-12 14:27:50 -07:00
Brian Wilkerson a70e29ac60 Add support for converting elements to plugin API objects
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2873503007 .
2017-05-09 13:02:31 -07:00
Konstantin Shcheglov bd1ee32543 Move [file_]byte_store.dart into pkg/front_end/test/src/incremental/.
We are going to reuse ByteStore in front_end, also for incremental
compilation.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2869803004 .
2017-05-09 09:12:15 -07:00
Brian Wilkerson acbd90b35d Fix tests under Windows (TBR)
Review-Url: https://codereview.chromium.org/2871933003 .
2017-05-09 08:56:20 -07:00