Commit Graph

147 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 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
Devon Carew 2f9cb8e81b Remove support for v1 of analysis highlighting.
Change-Id: I65bc645de9565628d82d1ff969616f3e38582275
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171682
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-12 18:36:19 +00:00
Konstantin Shcheglov a0227f5902 Issue 44063. Report IMPORT_OF_LEGACY_LIBRARY_INTO_NULL_SAFE hint.
Bug: https://github.com/dart-lang/sdk/issues/44063
Change-Id: I69c6f84da9a9c928e177507cedb30e06a561f3f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-09 19:42:08 +00:00
Konstantin Shcheglov 2513d37525 Fix reported void_checks diagnostics.
Change-Id: I49b27cf3aab3606fb5b024cba3ed4b95e9ebe0f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 23:50:37 +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
Danny Tuppeny 9181df9d6b [Analyzer] Fix error in LSP go-to-definition when target is in a "part"
Plus unrelated navigation regions (for example in comments, references
outside of the required range would be returned).

Fixes https://github.com/dart-lang/sdk/issues/28799.

Change-Id: I2fce33a3bd2678abfb40e5e9b3e3c5662e4f5608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161948
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-09 18:53:39 +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 ebd5b622ba Add DartSdk.languageVersion
Bug: https://github.com/dart-lang/build/issues/2763#issuecomment-666707445
Change-Id: I8232bd395abc9efea0e5c27716450d6a5442b3bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156489
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-04 21:01:09 +00:00
Sam Rawlins 32a93e2147 Analyzer: Remove error on class-used-as-mixin referencing super
Fixes https://github.com/dart-lang/sdk/issues/34806

Change-Id: I1cfd0b9c0699734b172aa62f7a04ab533a6cd03f
Fixed: 34806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151099
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-06-13 15:11:25 +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
Keerti Parthasarathy 8329bd7ca8 Do not check for '.analysis_options' for default options file in builder.
Change-Id: I9decba4d0db318caedcfd3695f41c127b66f416f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2020-03-09 19:31:24 +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 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 5b1065ac60 Enable avoid_init_to_null in analysis_server
Change-Id: I1909b0d8939d9b436fce772bd97dc4835f1093ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131322
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-13 00:35:34 +00:00
Brian Wilkerson 32ce9c7872 Enable prefer_collection_literals in three packages
Other than the following changes, all of the changes were made by dartfix:
- the analysis options files
- one line to enable the fix through dartfix (missed in an earlier CL)
- three places where a bug in the fix produced invalid code (issue and fix TBD)

Change-Id: If8660700792561805f4d1c96ccecd81abcebfeb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131209
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-11 20:39:02 +00:00
Konstantin Shcheglov 39f14a000e Rewrite most getDisplayString() to ElementDisplayStringBuilder.
R=brianwilkerson@google.com

Change-Id: I500d0045873a12d550d9ffe302e066a63ba56660
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-06 16:43:40 +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
Brian Wilkerson 61b4c0f770 Cleanup hints and lints in analyzer packages
Change-Id: I7f1a6ad1ed3610da9616683576ebfb5efd543fd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119164
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-09-27 16:12:44 +00:00
Brian Wilkerson b4e66ed3d0 Add highlighting for extensions
Change-Id: Ifa790e8e0830276cd794aa903aa5b2a9c1e03a97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109464
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-07-17 22:03:07 +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
Brian Wilkerson e43d81af5f Folders containing overlayed files should exist even if they do not exist on disk
Change-Id: I511b5075cb10b2594dce9dc33f165b64d9527043
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103565
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 20:47:46 +00:00
Devon Carew 9081f28fbb [analyzer] fix a copy paste doc issue and 2 unused imports
Change-Id: I20f4ae5454c2bceafd3b86e279357dee3b321006
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103644
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-05-24 16:31:25 +00:00
Jaime Wren cd2188f2f5 DAS change in hover behavior- the containingLibraryName now returns the URI of the containing library instead of the (possibly non-existent) library name
Change-Id: Ief2a7615b92ca635c696d48f907677bae538577b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103481
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-23 19:06:19 +00:00
Paul Berry b72ab0790d Add an Iterable type to the nonstandard SDK test.
With the new "UI as code" functionality, the analyzer requires any SDK
it analyzes to contain an Iterable type.

Change-Id: Ib098b135665b970040abf9e319b93f36fe09bea8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96122
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-08 20:13:38 +00:00
Brian Wilkerson 5787f08619 Clean up some hints in server and analyzer
Change-Id: Ia6bb5e4e4e398dbed29fe6649c490a88d4e0a406
Reviewed-on: https://dart-review.googlesource.com/c/92523
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-09 17:58:44 +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
pq 0df81c42a7 fix options integration tests
Fixes: #28868

Change-Id: Ia3a144b583432228531243ac53e07977fcf1db01
Reviewed-on: https://dart-review.googlesource.com/c/87024
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2018-12-12 00:28:39 +00:00
Konstantin Shcheglov 61a1793574 Issue 35162. Include SDK version constraint into AnalysisOptions.
So, analysis result signatures depend on it and recomputed when it
is changed.

Also, change analysis server to update analysis options not only
when analysis_options.yaml is changed, but also when pubspec.yaml
is changed.

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

Bug: https://github.com/dart-lang/sdk/issues/35162
Change-Id: If4b937c26212d3da74ac7125eb2c6f70dbcb1793
Reviewed-on: https://dart-review.googlesource.com/c/85405
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-11-27 00:57:27 +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
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
Brian Wilkerson fdcbe5dc93 Rename test files to be recognized by test.py
Change-Id: Id302623c9ff257647981f713c7229120bd70ada8
Reviewed-on: https://dart-review.googlesource.com/73800
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-06 23:31:32 +00:00
Brian Wilkerson e20064b8bf Add syntax highlighting support for the new mixin syntax
Change-Id: I4d6cfdfe0cd8d9c5be82c6efabeb642c4ca87e72
Reviewed-on: https://dart-review.googlesource.com/70902
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-06 19:49:20 +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
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 a1ca88f554 Resolve invocation arguments to parameters.
R=brianwilkerson@google.com

Change-Id: I76a8ea8221e0a888253af8297fb50c423699e175
Reviewed-on: https://dart-review.googlesource.com/69000
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-08 21:38:59 +00:00
Konstantin Shcheglov cb4f5b3a3a Resynthesize nameOffset for properties/parameters.
R=brianwilkerson@google.com

Change-Id: Ib3213529836df20f580a5d8805006ba13b82bf20
Reviewed-on: https://dart-review.googlesource.com/68761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 21:54:55 +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 95d1ebd9f0 Fix one cause of timeouts in tests
Change-Id: I8514c7a1e89c69bbbf11882fa734903cd7c7569c
Reviewed-on: https://dart-review.googlesource.com/68430
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-06 16:08:05 +00:00
Brian Wilkerson 6a6e7abfc6 Clean up some warnings in the server code base
Change-Id: I762fcc704fe0fa0547bbbc347eb248853d358121
Reviewed-on: https://dart-review.googlesource.com/67842
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-01 21:09:45 +00:00
Brian Wilkerson 373ed6b47f Create a LineInfo when resynthesizing a CompilationUnitElement
Change-Id: I42c075eefacab22d519a646395ec0cdb7322a87b
Reviewed-on: https://dart-review.googlesource.com/67702
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-01 18:35:37 +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
Brian Wilkerson 66828182f1 Update server integration tests
Change-Id: I8cc3e4b1d8bf963a39e086ea29be6c234715da63
Reviewed-on: https://dart-review.googlesource.com/67204
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-27 21:10:19 +00:00
Brian Wilkerson be7717dab4 Deprecate more propagated info members
Change-Id: I65555bad9f1087602b7bdb5ae41a3920c23d143d
Reviewed-on: https://dart-review.googlesource.com/66500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-25 13:17:23 +00:00
Devon Carew f08ada2d52 Disable a flakey analysis server test.
Change-Id: I9af9145305e29a37c82afc0b2199fba7866a0e0d
Reviewed-on: https://dart-review.googlesource.com/65281
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-07-17 14:54:07 +00:00
Devon Carew 6f648307b9 Address two flaky tests.
Change-Id: Ia32cd45d03e45d8a5bbc76cc37343f3e23c3a138
Reviewed-on: https://dart-review.googlesource.com/64581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-07-11 16:39:43 +00:00