Commit Graph

63 Commits

Author SHA1 Message Date
Konstantin Shcheglov e97f1bdbf0 Switch analysis_server to language 2.12, so null safety, but opt-out files.
This should allow doing partial migration, specifically protocol files,
which are imported by other libraries, but are a small library cycle
that does not import much outside of it.

Change-Id: I904c05d6d5b444ee9a9dbd1f7ada12aabdcc5165
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 23:39:37 +00:00
Konstantin Shcheglov a629b48fdc Remove file name constants from AnalysisEngine.
Change-Id: I3457973212e704a0fedee20db17956c017ec91ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-25 05:52:56 +00:00
Konstantin Shcheglov 2e99e59369 Fix integration tests for analyzer/ and analysis_server/ in preparation for Null Safety turned on.
Bug: https://github.com/dart-lang/sdk/issues/43777
Change-Id: Ibc5426dd3035c54306bed6e0dec8a6b379163057
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169286
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-28 15:42:55 +00:00
pq f84bba2897 get libraries to fix from the context collection
Fixes: https://github.com/dart-lang/sdk/issues/43694

Also implements recursive fix semantics consistent with `dart analyze`.



Change-Id: I349650a0c1704c2e2be84287b46de17ecc132d56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166602
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-08 01:34:08 +00:00
Mike Fairhurst d313fb70b6 [analysis_server] Tests should import dart:async to use Future
Tests which depend on the import can merely use Completer instead of
Future to get the same result. Tests which do not rely upon the import
have had the import removed.

Change-Id: I74641a58b1f97c8599c8faad86943b1c68508980
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161625
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-02 21:48:03 +00:00
Mike Fairhurst 1134a0f17c [analysis_server] Remove unused dart:async imports
Change-Id: I764ee78cb9e31bdb3abaa36ca4754e1fed180311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161447
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-02 17:29:52 +00:00
Konstantin Shcheglov c3655ed435 Remove FolderBasedDartSdk.defaultSdkDirectory() and getSdkProperty().
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>
2020-07-14 18:09:30 +00:00
pq 3d5df93fb1 bulk fix protocol
Change-Id: Id8505d5ad6f0f3d1c5289ab12d4932c6174f72e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-07-10 14:20:07 +00:00
Brian Wilkerson 8969b1839c Enable omit_local_variable_types in analysis_server
Change-Id: I7e5c13d40fd276854601681fc84be321e6031b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141583
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-30 03:58:44 +00:00
Brian Wilkerson b03ef5b3fe Convert more doc comments in analysis_server
Change-Id: I333d0af4444226a8152e840c4d9015fb4c30bd32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-13 19:29:28 +00:00
Brian Wilkerson 8efdee06d6 Begin adding return types in analysis_server
Change-Id: Id0daa52236bdc90cba6bfd7cf81d1b4cf47603c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133544
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-28 21:18:30 +00:00
Brian Wilkerson 61199914d7 Convert dartfix to use underscores rather than hyphens for fix names
Change-Id: I0bd264e8c0e196aa7a5a8cb46fc940242a844f07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133406
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-26 22:56:36 +00:00
Brian Wilkerson d29c5c174c Refactor dartfix to make the handling of lint fixes uniform
Change-Id: Ib329ec89bf19fa0c7d76b7f9ccdd796e20f71a9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133404
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-25 23:09:55 +00:00
Brian Wilkerson c9b56d3530 Remove support for default fixes from dartfix
Change-Id: I497f48ee0930829adf44a510101181578a4a9c86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133242
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-24 18:33:05 +00:00
Brian Wilkerson 3d7dd5bfe0 Remove the notion of required fixes from dartfix and the server
Change-Id: I55389e1978d11820142961b5997d2187d1e61bae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132973
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2020-01-24 01:05:41 +00:00
Brian Wilkerson 5584c96fde Enable prefer_single_quotes in analysis_server
All of the changes except in the analysis options file are from dartfix.

Change-Id: Icd9bf02ad07f71d1fc365979c7dfe18a792dc595
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132624
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-21 17:52:52 +00:00
Brian Wilkerson 91d6e1a0a7 Enable annotate_overrides in several packages
Other than analysis_server/test/analysis/notification_overrides_test.dart,
which had a naming conflict, all of the changes were made using dartfix.

Change-Id: I911dd75dcdee00420caa48724125e86d47c8857d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130002
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-01 21:31:40 +00:00
Brian Wilkerson 52c6620986 Enable unnecessary_const in analysis_server
Change-Id: I44d9902cb23d005ebedd4bc37d57d3751a8ebdc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-19 17:32:52 +00:00
Brian Wilkerson 4043a6fce3 Remove unnecessary uses of new in analysis_server
Other than analysis_options.yaml, all of the changes were from running
dartfix.

Change-Id: I92411642f12a00fc6bd0bfd24dd60fe67f0fed16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128845
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-18 19:01:51 +00:00
pq 52abcd3dd2 apply prefer_equal_for_default_values
Change-Id: I9b6fd3ee18ec834a5db3d0d25455b6db9ea4fbe2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108664
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-07-10 19:31:40 +00:00
danrubel 3afc3b58d0 Add dartfix protocol integration tests
... and address comments in https://dart-review.googlesource.com/c/sdk/+/91780

Change-Id: Ibd01a0de575065cf18822b806a9c687de2667add
Reviewed-on: https://dart-review.googlesource.com/c/92243
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-07 06:21:57 +00:00
Brian Wilkerson 47e988b781 Clean up the remaining copyright notices in analysis_server
Change-Id: Iee3110f92ab0f24312ddd1eff407d2229f895321
Reviewed-on: https://dart-review.googlesource.com/c/89101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-11 15:38:56 +00:00
Lasse Reichstein Holst Nielsen f0172a4c41 Export Future and Stream from dart:core.
This allows `async` and `async*` functions to be typed without importing `dart:async`.
All other async types still need to be imported, including `FutureOr` and `Zone`,
but pure `async`/`await` based code can be written with no imports.

Fixes #26162.

Bug: http://dartbug.com/26162
Change-Id: Iaf36631ef5b3251a688e495a9d238b2f8787f14c
Reviewed-on: https://dart-review.googlesource.com/71480
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-09-07 06:14:32 +00:00
Konstantin Shcheglov 1f52372bfa Remove CFE integration from analyzer, analysis_server, and analyzer_cli.
AnalysisDriverResolutionTest is partially updated, about 30 failing
tests added. I will get back to it in a following CL, it is not
directly CFE integration, but updated understanding how we want to
resolve. For example we don't need types for non-expression identifiers.

Change-Id: I3daddbb6c66ffad7a726f3313a1199fd7387aa04
Reviewed-on: https://dart-review.googlesource.com/71883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-29 13:46:45 +00:00
Devon Carew 8f31a2d96a Mark the test_postfix_completion test as slow.
Change-Id: I38db4fd08cdec35abf159cc2c9807aede266f1b1
Reviewed-on: https://dart-review.googlesource.com/71187
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Steve Messick <messick@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-08-22 19:25:59 +00:00
Devon Carew 9bf9822bec Increase a timeout for a slow test.
Change-Id: Ica5869cff0a710e778105c84fc8a6f4fbceb5ce9
Reviewed-on: https://dart-review.googlesource.com/70781
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-08-20 21:12:42 +00:00
Brian Wilkerson 978f12c17f Use void in place of Null in analysis_server
Change-Id: Ifef805cb3c0111e237a6147f71a968958d5651e5
Reviewed-on: https://dart-review.googlesource.com/69560
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-13 13:16:53 +00:00
Konstantin Shcheglov fe0640e3b1 Refactor way of providing file info, set codeRange for units.
This fixes a lot of search/refactoring tests, about 200.

R=brianwilkerson@google.com

Change-Id: I6ce5f61a08b8effa73ffde3861ff68eadd1f4e04
Reviewed-on: https://dart-review.googlesource.com/69383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-10 20:43:54 +00:00
Konstantin Shcheglov 0aa8f2d5cb Fix for some Quick Fix tests by adding CFE generated error codes.
R=brianwilkerson@google.com

Change-Id: I2b06dc388a00aa0c8e5ab3db045b3fe8ec02ed5e
Reviewed-on: https://dart-review.googlesource.com/69283
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-10 18:00:46 +00:00
Konstantin Shcheglov ac973e5ba7 Return SourceSpan with actual length from _CompilationMessage.
Change-Id: I883a4ce1b6fc63643db259a0d22e0719b460c109
Reviewed-on: https://dart-review.googlesource.com/69005
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-10 16:03:42 +00:00
Brian Wilkerson 31765bf56f Clean up some hints in server code
Change-Id: Ia620cfd7c4cb116ca55ce8a4405820007bc69160
Reviewed-on: https://dart-review.googlesource.com/68740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-07 18:35:33 +00:00
Brian Wilkerson b0de4d8ac0 Add support for and a few additional CFE-based tests
Change-Id: I8e52f41cc54341c4321e688ae46a6392e69f98ab
Reviewed-on: https://dart-review.googlesource.com/68500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-06 21:04:02 +00:00
Brian Wilkerson 66500de4dc More fixes to the CFE integration tests
Change-Id: Id6a54890d8d41ed220869eb1fb03c951cb9e1446
Reviewed-on: https://dart-review.googlesource.com/67500
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-07-31 19:14:17 +00:00
Danny Tuppeny 3dc201e168 Update ChangeBuilder to not include empty edits (Take 2)
Combination of Brian's change:
https://dart-review.googlesource.com/c/sdk/+/63901

and Devon's change:
https://dart-review.googlesource.com/c/sdk/+/66405

Change-Id: I57e5d1f7d3a653f225aba2d690190fe1ff18a5b1
Reviewed-on: https://dart-review.googlesource.com/67344
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-07-31 13:44:06 +00:00
Brian Wilkerson ed0ccc7ac9 Add more error message mappings
Change-Id: I5511ba2404ca3a430c6fda35b5e79a14eceb1188
Reviewed-on: https://dart-review.googlesource.com/63961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-09 16:38:08 +00:00
Devon Carew 17b53a2835 Test out no_implicit_casts on the analyzer source base.
Change-Id: I4eb2414d7d9bbe21883c9e5e8eca10f2eaafb465
Reviewed-on: https://dart-review.googlesource.com/62725
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-06-28 02:20:43 +00:00
Devon Carew f381778867 Update the status of analysis server tests.
Change-Id: I12c2366209ae712e064888714dd65ce8ec9d89f7
Reviewed-on: https://dart-review.googlesource.com/62003
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-06-23 18:42:31 +00:00
Konstantin Shcheglov 4ebdb31646 Separate getOutline() and getResolution() in FrontEndCompiler.
This will allow us later switch from applying resolution to parsed
AST to directly generating resolved AST, when we get to this.

New failing tests are because of absence of annotations, constant
values (initializers, default values), and constructor initializers
in outlines.

We also don't get errors for constant value computing, hence some
tests are now passing, but not by the reason we intended to test.

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

Change-Id: I5b45da592563af02c45e8cda160ccd24487c3591
Reviewed-on: https://dart-review.googlesource.com/61743
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-06-22 04:04:33 +00:00
Paul Berry 591cf85c76 Re-enable the old analyzer/FE integration logic.
This gets the tests running again.  I'll follow this up with CLs that
reshape the ResolutionStorer API to match the Factory API we're
building, and then after that we can transition the code over to
calling the Factory API directly.

Fixes #33504
Fixes #32258

Change-Id: I105841ed5b2ed1198ec5e3e7387f694c61d36ca7
Reviewed-on: https://dart-review.googlesource.com/61101
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-06-20 14:35:31 +00:00
Kevin Millikin be30b62e3d Remove the Kernel type inference listener
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>
2018-02-21 16:28:07 +00:00
Jaime Wren cd878bc433 Create the new flag --use-cfe in the analyzer, analysis server and analyzer_cli and migrate the old behavior of --preview-dart-2 to --use-cfe. The --preview-dart-2 flag is now a no-op, with functionality coming soon.
See https://github.com/dart-lang/sdk/issues/31640

Change-Id: I2db2e7ef6a324cbd5d369b807e331495fed167df
Reviewed-on: https://dart-review.googlesource.com/33121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2018-01-08 22:37:05 +00:00
Konstantin Shcheglov 9f7af9963a Convert UNDEFINED_SUPER_METHOD errors.
We don't grab parsing errors with previewDart2 anymore, because the
same errors are reported during compilation.

R=brianwilkerson@google.com

Bug:
Change-Id: I58dc8c098fe4c8b2009c3adb9cbbbc334a748f61
Reviewed-on: https://dart-review.googlesource.com/32444
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-04 23:00:36 +00:00
Brian Wilkerson fbe4151da4 Handle member references that cannot be resolved because of missing type information
Change-Id: I3599846476c082a533882f6d8d18e1adeb70fa3c
Reviewed-on: https://dart-review.googlesource.com/28383
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-11 22:21:53 +00:00
Konstantin Shcheglov 94fdf7dfe3 Apply types to top-level variables.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I93577570ae2b1cf1c2a5a837128378f1e2ce785f
Reviewed-on: https://dart-review.googlesource.com/27961
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-09 23:49:35 +00:00
Konstantin Shcheglov 6c23d21a4c Upgrade test_reflective_loader to 0.1.3
Update test expectations for tests that pass.

R=brianwilkerson@google.com, devoncarew@google.com

Bug:
Change-Id: If822e47146c438c57eb8dd45554a019f01fdca89
Reviewed-on: https://dart-review.googlesource.com/27921
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2017-12-08 21:28:10 +00:00
Devon Carew e38c1a98e4 Add --preview-dart-2 integration tests for the edit domain.
Bug:
Change-Id: Ie63cd20cad7d27cb380db1cdefd7a5d4f7254a2a
Reviewed-on: https://dart-review.googlesource.com/27461
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2017-12-08 04:26:10 +00:00
Brian Wilkerson 35f6d5da1b Correctly handle adding imports when pasting into part files
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/3001733002 .
2017-08-16 07:43:36 -07:00
Brian Wilkerson 44b5341de8 Update edit.importElements response data to support part files
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/3001723002 .
2017-08-15 08:51:51 -07:00
Brian Wilkerson ae69313731 Initial implementation of the import-aware copy support
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2988183002 .
2017-08-01 08:32:12 -07:00
Brian Wilkerson d9754a58e9 Initial implementation of copy/paste support
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2972833002 .
2017-07-05 14:02:07 -07:00