Commit graph

4752 commits

Author SHA1 Message Date
Konstantin Shcheglov 5dd02f0583 Add getParsedLibrary2(), deprecate getParsedLibrary() and other parse related
Change-Id: I585fa1f01b71522dc99ba86c2b9e20da256b2d27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-19 15:52:39 +00:00
Konstantin Shcheglov 2622d728ae Add getLibraryByUri2(), deprecate getLibraryByUri().
R=brianwilkerson@google.com

Change-Id: I6769ccb5767408490934693cc9019d5af1d8d8d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-19 00:19:32 +00:00
Brian Wilkerson fa1a28bf65 Migrate analysis_server.dart and other libraries in its cycle
I plan to start migrating the associated tests next, but wanted to
unblock other work sooner (and minimize the size of the CL).

Change-Id: I83340208b116acca6f9a4c59d7dfceb625a39eb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195780
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-18 15:43:39 +00:00
Konstantin Shcheglov db2aceaa42 Add getResolvedLibrary2(), deprecate getResolvedLibrary().
Change-Id: If502203708ed4c6a64e7054c2b12970eac11755b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195497
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-17 16:51:07 +00:00
Konstantin Shcheglov 26d9fbbd04 Add getResolvedUnit2(), deprecate getResolvedUnit().
Change-Id: I0217fefb2747f2f9bd757bc041b53acaf3d1a8f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195495
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-16 21:33:54 +00:00
Konstantin Shcheglov 7eda3cfe76 Migrate test/services/refactoring/
R=brianwilkerson@google.com

Change-Id: Ica52e54ba277969ae8a3b63627902ba53045397f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195494
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-16 18:11:16 +00:00
Konstantin Shcheglov de09de4976 Migrate lib/src/services/refactoring/
Change-Id: I17b11b8ea60ef141444b6c8108189d7a8588217f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195493
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-16 16:01:22 +00:00
Paul Berry 0ccb2771a3 Analyzer: change extent for assignability errors with named arguments
Previously, if a type mismatch occurred on a named argument, e.g.:

    int.fromEnvironment('foo', defaultValue: 'BAD')

the error would be reported on the entire NamedExpression
(`defaultValue: 'BAD'` in this example).  Now, the error is just
reported on the expression (`'BAD'` in this example).  This makes the
analyzer behavior more self-consistent (since now assignability errors
are now consistently reported at the site of the expression that can't
be assigned).  It also makes the analyzer behavior more consistent
with the CFE.

This will make it possible, in a follow-up CL, to eliminate a lot of
the inconsistencies between analyzer and CFE in the "why not promoted"
ID tests.

Change-Id: I17db256959d730a22a5766f65d5c0736b627f244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195489
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-15 21:38:37 +00:00
Danny Tuppeny 934be22ab5 [analyzer] Support package descriptions + version numbers in pubspec.yaml package completion
Change-Id: I064689814b1f81671be870bb5c8499ebf35ab468
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195077
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-15 20:24:32 +00:00
Danny Tuppeny 790ceec1ab [analyzer] Support additional LSP completion trigger characters
Fixes https://github.com/Dart-Code/Dart-Code/issues/3211.

Change-Id: Iad4db41b539990d39f641ff1dd07b174f207891b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195510
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-15 20:16:37 +00:00
Danny Tuppeny 2dcbd22e0c [analyzer] Don't send Dart's trigger/commit characters for non-Dart LSP completion registrations
Change-Id: I703b183ebd9aedaf87dbbce664107d5bcff14367
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195509
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-15 19:44:27 +00:00
Konstantin Shcheglov 4dc165f7fd Add getUnitElement2(), deprecate getUnitElement().
Change-Id: Ib1ed93f215356442ca9db5b8ed5fab99667e996e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195361
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-15 17:16:27 +00:00
Danny Tuppeny eb0e7199ac [analyzer] Fix a null assertion error when completing in comments
Change-Id: I6456e951ec8cfe624efd6cbf7696c324e7a4b581
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195504
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-15 15:18:17 +00:00
Brian Wilkerson bdc6c65b32 Migrate the search support in server
Change-Id: If9379ac44cea9ccd5cf15886d0c22624a2b66b2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195421
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-15 13:37:47 +00:00
Brian Wilkerson 374e35ce87 Migrate the highlight region computer
Change-Id: I580a10014c217cec9b225b7d45c9cc72b37d8614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195303
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-15 01:00:26 +00:00
Brian Wilkerson 4f57626aaa Migrate the mocks used by tests and tools
Change-Id: If5093c5ba1b53fb1d96390b0740e1337acec9958
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195307
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-15 00:14:36 +00:00
Brian Wilkerson a28d35ae9e Migrate ContextManager
Change-Id: I0306c2485af0de4edf5e12e2cd3c13afdc3e8729
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-14 21:42:26 +00:00
Danny Tuppeny 1aa56ed7b1 [analyzer] Migrate LSP semantic tokens + generation script to null-safe
Change-Id: I3d903a406808c50d995c50b8f890db8f97de8cd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195276
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-14 20:08:15 +00:00
Danny Tuppeny 7e50eedf80 [analyzer] Migrate LSP constants + ClientCapabilities to null-safe
Change-Id: Id7d1e4dae9eb9b1a29d82244d503dfdf2a9c2524
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195275
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-14 19:00:25 +00:00
Danny Tuppeny 7ea96c93d5 [analyzer] Migrate generated LSP code to null-safe
Change-Id: Ibed2e796bfcfe2ad48460cf1029a9fd9034e6418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195274
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-14 18:24:25 +00:00
Danny Tuppeny 133f9936e0 [analyzer] Ensure server-generated diagnostics are recorded to be merged in with plugin errors
Fixes https://github.com/dart-lang/sdk/issues/45678.

Change-Id: I90d2908d1299f3b18efe74f3741d32bbd39e3beb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195270
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-14 16:11:38 +00:00
Konstantin Shcheglov 60a53afc5e Revert "Make AnalysisResult.path non-nullable, more non-nullable for ParsedLibraryResult and ResolvedLibraryResult."
This reverts commit 83ca0e87a0.

Reason for revert: breaks google3

Original change's description:
> Make AnalysisResult.path non-nullable, more non-nullable for ParsedLibraryResult and ResolvedLibraryResult.
>
> Change-Id: Iab3a8c6c81ace30049a93d0a453e2473634ba07a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195058
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com

Change-Id: Iecaa81064450f536a45235d4d79d3b212a93918b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195188
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-14 00:41:59 +00:00
Konstantin Shcheglov 83ca0e87a0 Make AnalysisResult.path non-nullable, more non-nullable for ParsedLibraryResult and ResolvedLibraryResult.
Change-Id: Iab3a8c6c81ace30049a93d0a453e2473634ba07a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195058
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-13 18:05:28 +00:00
Brian Wilkerson 97f2b1439a Migrate the signature computer
Change-Id: I5e76ffb55747a1865716b649fe209d836fe95cd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195045
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-13 17:34:27 +00:00
Brian Wilkerson 770bc1e55c Migrate fix and assist support for Cider
Change-Id: Ie37bc2b7868a0001aba1937322052bbc73147af5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-13 17:18:06 +00:00
Konstantin Shcheglov 68edc773dc Check in getHover() that the result is valid.
Change-Id: I7f97c2ba57500dc540631d678e1bf6aa8a785e65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195044
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 22:09:46 +00:00
Konstantin Shcheglov 050fa8a70a Migrate correction/assist_internal and correction/fix_internal.
Change-Id: I07f44983a14119f34a7637c34cbff1983284a913
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195047
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-12 21:12:26 +00:00
Konstantin Shcheglov 1d9bb15018 Fix remaining individual correction producers.
R=brianwilkerson@google.com

Change-Id: I80d97654b06a0926ce0f2d6c0ee5930c93f2d8a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195046
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-12 20:35:56 +00:00
Brian Wilkerson 14fea36798 Migrate some of the plugin support
Change-Id: I5e8cdf215836470f8cf237f0da5155c0ac80e281
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195042
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-12 20:07:16 +00:00
Brian Wilkerson 7f1b4f93bd Migrate more of the data-driven fix support
Other than the changes in
  'pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart'
all of these changes have been reviewed before.

This doesn't include some tests that I had previously migrated, but those
depend on a large number of libraries that haven't yet been migrated.
There are some tests that are now migratable, which I'll tackle separately.

Change-Id: I0f77d86d892216bf42d94b098575f6529ca72ed1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 18:59:26 +00:00
Konstantin Shcheglov 81be9be4a6 Migrate several lib/src/services/correction/dart/
R=brianwilkerson@google.com

Change-Id: I7957e3fa724e618e6cf8c6a94344b0b4057aa080
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-12 18:56:16 +00:00
b-stime c1339411bb Adds assist for basic Flutter Builder
Fixes issues such as

* https://github.com/flutter/flutter-intellij/issues/814
* https://github.com/dart-lang/sdk/issues/33957 .

Essentially, in Flutter, it's often useful to create a new context in the UI/widget tree as a place to begin a search towards the trunk of the tree for various state structures attached to lower levels of the tree. The basic `Builder` widget is the official means for creating such a context/entry-point.

The patches in this PR are essentially a copy-paste-tweak from two types of existing, similar assists. The main origin was taken from `FlutterWrapStreamBuilder` which wraps client code with a constructor for the StreamBuilder sub-class. The new assist, provided here, is a little more basic/general than the StreamBuilder so it was able to also adopt assertion and test code from some of the other assists for basic widgets.

Closes https://github.com/dart-lang/sdk/pull/45656
https://github.com/dart-lang/sdk/pull/45656

GitOrigin-RevId: 00a5043e5dbd410f24f30f6503711413341dbe7a
Change-Id: I5f93837af571b4974e35da131112f82cd9359697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 17:33:06 +00:00
Brian Wilkerson 41641e9c8f Migrate more completion support
Change-Id: I073972400bb79166a836e517e268452a03b64f52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195040
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 16:30:16 +00:00
Brian Wilkerson 77cfcff92f Migrate postfix completion
Change-Id: I92a96785777c651fef7c8a68762c954ba652d68f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194964
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 14:12:21 +00:00
Brian Wilkerson ecdb3689b9 Migrate widget descriptions
Change-Id: I2c6cd72b5572ff30642a5c836adea8839fe2e964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194965
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-12 14:08:16 +00:00
Brian Wilkerson 9b1583101e Migrate statement completion support
Change-Id: I9d6751888286e4a068fc1dac192c93ffb8089b69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194963
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-11 15:28:25 +00:00
Konstantin Shcheglov e1539dc3d4 Migrate several lib/src/services/correction/dart/
Change-Id: I49f43e801f13dbbfe67be79fea19073990acb658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194962
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-10 22:32:16 +00:00
Brian Wilkerson 5b6d517fe8 Migrate PropertyDescription
Change-Id: Id8f02d1e98897f3ba37fb0ebdb4cfff6bfe1a4a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-10 20:43:04 +00:00
Konstantin Shcheglov 7367c980a7 Migrate several lib/src/services/correction/dart/
R=brianwilkerson@google.com

Change-Id: Ie38a28ee77c2faeb50f9c46e54a64cef933e3916
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194880
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-10 01:05:23 +00:00
Brian Wilkerson 08c5b9f8ff Migrate more completion support
Change-Id: Ia55132ef8f4cd6e80dfc4fe16689e8b4e50cf387
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194821
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-09 22:40:03 +00:00
Konstantin Shcheglov 8fb98b25c1 Migrate several lib/src/services/correction/dart/
Change-Id: I0db19c94d26c7c604d71663e2f2c944286898c0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194546
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-09 17:15:45 +00:00
Brian Wilkerson e461f937db Migrate most of the completion contributors
Change-Id: I2802422c59801134af342eed1d43367b8175b099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194543
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-09 04:14:21 +00:00
Konstantin Shcheglov bbbe5bfc87 Migrate several lib/src/services/correction/dart/
Change-Id: I8c50c6e7664a7bd8ee7b0d881d9adeaf9c544f61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-08 21:17:10 +00:00
Sam Rawlins bc5d362959 analysis_server: Standardize on package:path/path.dart import prefix.
One file used 'pkg_path' which really threw me; I'd never seen it before. Two
more used 'pathos'. All other files in the package use 'as path', except a few
spots which do not use a prefix.

Change-Id: I94577c1783162c52c7f8dc3c6bf02e9a0b9159df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-04-08 20:02:50 +00:00
Brian Wilkerson beea8076cd Migrate more of server
Change-Id: I6342016847257ae95314e97b2f31186c43f10e6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194481
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-08 19:05:30 +00:00
Sam Rawlins a75fdd4d98 Remove unnecessary imports from analyzer_plugin, analysis_server, analyzer_cli, test_runner
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I52753bf0ac8112e0a2e6864ca2bd3289e63d5cf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-04-08 19:02:31 +00:00
Danny Tuppeny e8d53cff92 [analyzer] Improve handling of loose files and context rebuilds
Change-Id: Ifd047a29953503a70216ce29b3fe4cdbfc4132df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192926
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-08 17:49:35 +00:00
Konstantin Shcheglov 3131d5a6c5 Migrate CorrectionProducer and two producers.
I decided against landing https://dart-review.googlesource.com/c/sdk/+/194321
It gets too bulky.

So, we will migrate producers, and only then tests, and will know
our null safety mistakes.

Change-Id: I7b358549fc33c9d9a02aef80f30a676c7875f85a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194326
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-08 16:17:50 +00:00
Konstantin Shcheglov 2af2f3559d Migrate lib/src/services/correction/util.dart
R=brianwilkerson@google.com

Change-Id: Ie85217c57e26fc2430e916c8b7829d64ffddc4db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194210
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-07 20:52:03 +00:00
Brian Wilkerson a0f7ff92a1 Migrate the first round of completion support
Change-Id: I64ca0b7b6d3040b6e37d328ed62e75059c48ef07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194212
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-07 20:44:58 +00:00
Konstantin Shcheglov 9db78a3b49 Migrate lib/src/services/kythe/kythe_visitors.dart
R=brianwilkerson@google.com

Change-Id: I9cf4eef071d72d2bf68043a0a7ab919cb65d3da9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194206
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-07 07:50:57 +00:00
Konstantin Shcheglov c5769f6604 Migrate lib/src/search/workspace_symbols.dart
R=brianwilkerson@google.com

Change-Id: I14e70698e91db02f3e49ced438668d0d903bf349
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194203
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-07 07:08:17 +00:00
Konstantin Shcheglov d8da40ec52 Migrate lib/src/protocol_server.dart and related.
Change-Id: Ibb1e5a53aa8ad67fa43b315880c491093b051e20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-07 00:26:59 +00:00
Brian Wilkerson e066070f14 Migrate a couple of individual libraries
Change-Id: Ibb26391f59fa576a6a9a1cd29a70edbe8e4d3f15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-06 23:45:59 +00:00
Brian Wilkerson cf8761d37a The subset of data-driven fixes that can be committed at this point
Change-Id: I76e115efbbef1649d53d01ffdff3473446330f0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194117
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-06 23:36:43 +00:00
Konstantin Shcheglov 43b5d134b3 Migrate lib/src/channel/
R=brianwilkerson@google.com

Change-Id: I2748f92589ef9501325535d79188fdbb103130f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194118
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-06 23:16:43 +00:00
Konstantin Shcheglov 1469f984fc Migrate lib/src/services/search/
Change-Id: I52b2fb72952c0abacb897607d6969bedbfd027b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194114
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-06 22:58:25 +00:00
Konstantin Shcheglov 321a0e0246 Migrate lib/src/services/pub/
R=brianwilkerson@google.com

Change-Id: I19cd5bed18c3ae4d9fe163fd3b962550bf1344a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194111
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-06 22:24:42 +00:00
Konstantin Shcheglov b903d73c9b Migrate allowed status pages.
Change-Id: If81a0e66a22f9219535420041b6cd7efe1aa3341
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194103
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-06 16:17:17 +00:00
Konstantin Shcheglov b173c18796 Migrate LspPacketTransformer.
Change-Id: Ib0a84ae01b66e92a9406b559c1c8e4deb52ad3b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194102
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-06 15:46:37 +00:00
Brian Wilkerson 4cba249477 Migrate a couple of additional libraries and some missed tests
Change-Id: I7c107b71a7b6226c8e294428a70656182353a048
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194018
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-05 23:01:26 +00:00
Danny Tuppeny 06729f230a [analyzer] Don't produce edits during MOVE_FILE for directives that don't change
Fixes https://github.com/dart-lang/sdk/issues/45593.

Change-Id: I4110c5a6bc4a08caff7d40cd288ae554625703e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-05 22:20:56 +00:00
Brian Wilkerson d4bc97ec16 Migrate a couple of files in the completion support
Change-Id: Idcb26425dad2b2a1d88346ad0ceea9d1fff209f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194012
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-05 16:40:06 +00:00
Konstantin Shcheglov 4757152a0b Migrate a few random analysis_server libraries.
Mostly no-ops.

Change-Id: Ia538aed657576203ec104bd849862bcc87025bef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-05 16:06:36 +00:00
Konstantin Shcheglov 3ea23d2f55 Migrate pkg/analysis_server/test/integration/analysis/
Change-Id: I6dc636c06e13d1ac1da6caf2e33443baca08315d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194001
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-05 07:46:16 +00:00
Brian Wilkerson 99814617b0 Migrate more of server to null safety
Change-Id: I8989f5f9a45a9c832f0aeb56397fed978386ce30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194041
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-04 21:40:55 +00:00
Brian Wilkerson 34873853d8 Migrate some of the plugin support in server
Change-Id: I1294a33725ff0d0c3d2eb981c23211a8576f60f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194023
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-04 00:23:39 +00:00
Konstantin Shcheglov 454d4db340 Use Object as the type for TypeUnion in analysis_server protocol generator.
Change-Id: I6772182341df26211ff245748afb983e9d1b6ef4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-03 19:44:24 +00:00
Brian Wilkerson 744fa0ba2d Migrate some additional libraries and their tests
Change-Id: I3aae14488fb5def205788a60b27d33211c88d330
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193889
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-02 20:02:22 +00:00
Brian Wilkerson 90d42351db Migrate a few more utilities to null safety
Change-Id: I2b623713ec3a7c366f6fe7643e7c56bab54f40a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193822
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-02 17:53:32 +00:00
Konstantin Shcheglov c2d660d161 Migrate analysis_server and analysis_server_client protocol.
Change-Id: Ie0912627733f0481de0d3239647a4978e5327f12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193641
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-02 06:46:41 +00:00
Sam Rawlins 5e040a20f8 analyzer: Improve span of use_of_nullable_value errors
This changes the span reported from the _receiver_ to
the _use_ (method name, property name, operator token).

I think this change is overall an improvement.
Specifically, its a great improvement for cmdline
output, where the receiver and the "use" are on
different lines.

One possibly weird change is that if the operator is `[]`,
then I only highlight the `[` character. I don't know if
there is a better place, and I think this is fine.

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

Change-Id: Ie66ddf04b4904a367575193106385dd63ee39985
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188680
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-02 02:43:48 +00:00
Devon Carew bfaed5e927 Update the text for the 'in file' version of a fix.
Change-Id: If9263f567acd20d377bf661f65f051d468f4eadd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193721
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-03-31 18:04:29 +00:00
Brian Wilkerson 628e630ca2 Convert a few utility libraries to null safety
Change-Id: I1e1cde29a40eb498d8e25c72189641d568d7db03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193591
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-31 05:45:32 +00:00
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
Brian Wilkerson 8c775581e2 Fix a bug in data-driven fixes handling of parameter changes
Change-Id: Ic5872a364bfcadc302ec35c0cf63ec87e5e2594b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193444
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-30 04:15:38 +00:00
Konstantin Shcheglov 114d7b980a Migrate analyzer_plugin package to null safety
Bug: https://github.com/dart-lang/sdk/issues/45236
Change-Id: I01175a2b2b1eb3ce6cdf30ade794d8186c6e8ead
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191622
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 00:29:37 +00:00
pq a68db103ae rename lintProducerMap2 => lintProducerMap
(Also removes deprecated "legacy" lintProducerMap.)

Change-Id: I8c9222657029fe709228e010c4b90f34244814d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193086
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-03-26 14:50:04 +00:00
pq 9847e7fbe6 migrate to lintProducerMap2
Change-Id: I90b41091b354f02e84772e797257bf20db404f30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192949
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-03-25 14:59:04 +00:00
pq 727d90540d remove nonLintProducerMap
Change-Id: Iae2b150c2dffd8aa13197d08811eed63b707e072
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192941
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-24 23:12:03 +00:00
pq 67cf58cde8 unnecessary_final fix support
Change-Id: I79338f2001d621b83ae4234fd4a79321836167b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-03-24 15:05:41 +00:00
Danny Tuppeny 387e9d9ab2 [analyzer] Include ConditionalExpressions in Flutter Outlines
Fixes https://github.com/Dart-Code/Dart-Code/issues/3196.

Change-Id: I369e48285329c808a092ff677440e159aa7a103b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192688
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-24 15:01:21 +00:00
Konstantin Shcheglov 85f460594b Include debug data for NPE in _ContextTypeVisitor
Bug: https://github.com/dart-lang/sdk/issues/45429
Change-Id: Ibb8a72666eaa7af16a4bb173526f16c7bab14c1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-23 18:57:01 +00:00
Konstantin Shcheglov 86c5085565 Fix NPE when the return type of a method is inherited.
Change-Id: Iaf77f250c806b116f0f0d6bbd3d9b9ff2ab0090d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192540
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-22 21:03:45 +00:00
Sam Rawlins b047c6e188 Remove unnecessary imports from analysis_server
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I71f28e7b8b56bde11c9b2f349b05534bd4851a76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192503
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-22 20:33:47 +00:00
Brian Wilkerson 464cc509ab Remove one move ignore comment from generated LSP support
Change-Id: I905056f98780f127466caa0ba9e8a5f6d13a7282
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192285
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-22 14:09:23 +00:00
Brian Wilkerson d56098f1d4 Fix an npe in AddStatic when the field declaration cannot be found
I wasn't able to find a test case that reproduced the bug.

Fixes: https://github.com/Dart-Code/Dart-Code/issues/3205
Change-Id: Ie45c76ef7ed18755ccc576ad9aa39ff35055233e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192281
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-20 20:00:29 +00:00
Brian Wilkerson c5d01ec4f7 Remove a couple of ignore-in-file comments and make one more unnecessary in generated code
Change-Id: I8313fe2b4c3908dd5751f7eeca417adfcb2e5790
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192040
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-19 14:44:27 +00:00
Brian Wilkerson ec04c1f335 Remove some unnecessary ignore comments
Change-Id: Iafa4b9c8aa5dc696c5746248a8701b4f6e875979
TEST=Existing tests.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191980
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-03-18 19:58:43 +00:00
Brian Wilkerson d00ef8611a Update the server protocol to support passing back the line and column numbers for the end of a range
Change-Id: I8310e4a32cacbe98310c1dbaa3b3563b1ff1a1ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191862
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-18 19:22:23 +00:00
Michal Terepeta 9933192f36 Move watching generated Bazel files to an isolate
This does a few optimizations to improve the performance of the analyzer
when watching for generated files:

- We do all the polling in a separate isolate.

- We detect when Bazel finished running and only poll afterwards.

- We use a batch interface and deliver all changes at once (instead of
  one by one). This allows us to avoid resetting caches more often than
  necessary.

I had to remove one of the larger tests and created an integration test
instead, since the code for detecting the Bazel builds relies on
`dart:io` directly (`ResourceProvider` does not expose a way to
check for symlink targets).

Since this required a bit more code, I've decided to create a separate
file for it (`bazel_watcher.dart`).

Change-Id: I6c2383e7fd4348ab8af1af639b10db519c7a2f33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183010
Commit-Queue: Michal Terepeta <michalt@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-18 17:50:58 +00:00
Sam Rawlins 5d1faf6cc6 Refactor yaml utilities in analyzer and analysis_server
* Two extension methods were moved from analysis_server to analyzer, to replace
  identical top-level helper functions in analyzer.
* Add nodes2 which returns a YamlMap with YamlNode keys.
* Privatize two static functions in Merger.

Change-Id: If54e73d6e8133bf1b2a3af809d6bb732c77ab9be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191381
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-17 16:57:05 +00:00
Konstantin Shcheglov fd92cd4ce1 Add Expression.inConstantContext to API.
Change-Id: I13f96d2123e96eea11ccdcef2bb9a301a8afd26a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-16 19:28:30 +00:00
Danny Tuppeny 44275c6001 [Analyzer] Add support for LSP experimental SnippetTextEdit
Change-Id: Id37a1954c71fb10c4968c5af6a873ad0ef864a5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191403
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-16 18:40:50 +00:00
Sam Rawlins 1cb203d8c9 Remove unused code and files from analysis_server:
* ManifestFixKind, PubspecFixKind, ImportElementInfo class
* WithNullSafetyMixin mixin
* suggestionComparator function

Change-Id: I9e332be6345b2f2b7b788bc4ae63a075a21cbe06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190821
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-16 05:08:24 +00:00
Danny Tuppeny cf3dcc4256 [analyzer] Prevent MOVE_FILE using absolute URIs when moving files out of lib
Fixes part of https://github.com/dart-lang/sdk/issues/41889, maybe part of https://github.com/dart-lang/sdk/issues/43602.

Change-Id: Ic7a1e81a280e9786e26f0075ea079e0136e934b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191142
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-15 18:42:44 +00:00
Brian Wilkerson 55522f9e90 Fix a bug in completion when a setter does not have a corresponding getter
Fixes: https://github.com/dart-lang/sdk/issues/45300
Change-Id: I0a5043b5d395abb426615e8c434f23c20062e182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-15 17:34:53 +00:00
Brian Wilkerson 2f3c274632 Clean up some code in analysis_server
Change-Id: Icaa4cc19d1966e3dbc70f82745e4fd771a18ed16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190728
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-12 04:45:39 +00:00
Brian Wilkerson d043b1428e Resolve type parameters to their bounds when suggesting instance members
Change-Id: I19fe690216ba0c0dd7d0444d7bda4a58aaa3e8a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190723
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-11 19:14:30 +00:00
Brian Wilkerson 917688fe3c Resolve type parameters to their bounds when computing the context type
Change-Id: I34349ccf3728e0cc1f1caab4499896f2f827e85b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190721
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-11 18:59:01 +00:00
Brian Wilkerson 78ca98ac8e Minor cleanup to SuggestionBuilder
Change-Id: I1f3a71b81e7f2bb29808102ea076c7e7e67a6967
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190740
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-11 17:18:30 +00:00
Brian Wilkerson 879f46ea4f Make element-specific features be relative to the element kind range
Change-Id: Ia4194ed749bbd78a85c0c189f1dc95f5b555c95b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190581
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-11 15:28:20 +00:00
Paul Berry c509ad1e41 Change "could not" to "couldn't" in error messages
See comments at
https://dart-review.googlesource.com/c/sdk/+/186320/4/pkg/analyzer/lib/src/generated/resolver.dart#3423.
On the recommendation of the documentation team, we use a more
informal tone in messages.

Change-Id: I0c243669ebd91b8f4a745530582e0f829769a754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189100
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-10 15:26:38 +00:00
Brian Wilkerson acdd5231fd Deprecated setters should not take priority over non-deprecated getters
I hadn't really noticed this behavior until we deprecated large numbers
of setters in the AstNode hierarchy.

Change-Id: If068edd0a55a7a828b7ad114ff5812716ff265e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190283
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-10 00:55:42 +00:00
Brian Wilkerson 7a862df2d8 Compute the context_type feature in instance creation expressions
Change-Id: I72c34e7ecb24377605b8983bcbdb98bdfd73c6f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190281
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-09 23:27:02 +00:00
Brian Wilkerson 038c653c08 Fix a bug in the sort_child_property_last fix
Fixes: https://github.com/dart-lang/sdk/issues/45220
Change-Id: I6634443de0fd87983097cb452238b6b1588ae818
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-09 17:51:00 +00:00
Brian Wilkerson 097a825e4a Suggest the fix add_ne_null only when the type of the condition is nullable
Change-Id: Iaad91d5e8b7f5725a8ccb7430eb3f7570a1eea38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189842
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-08 23:13:43 +00:00
Brian Wilkerson 7d971fad1c Stop suggesting non-factory constructors for abstract classes
Change-Id: I3ed6936d36b0f35cea7950ac089c89efacdf0ca6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-08 18:53:51 +00:00
Sam Rawlins 7ee3f73a9a Analyzer: Allow generic function types as type arguments and bounds
Bug: https://github.com/dart-lang/sdk/issues/44929
Change-Id: I9c83a9abd47ec6b3d59c118493c838632fc3182a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185305
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-08 18:32:31 +00:00
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 c8d6f85d0f Enforce lint unnecessary_parenthesis in analysis_server.
Change-Id: Ib68c124988743b45807015e7274f429fff67fe44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189384
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-06 05:20:16 +00:00
Brian Wilkerson 7aaf620de7 Make it easier to experiment with enabling or disabling existing features with example
Change-Id: I22b7a1259fee585e1baeba0faf7b62c9f0d2f5ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189340
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-06 01:02:24 +00:00
Konstantin Shcheglov 3f5694c827 Issue 45141. Check for loadLibrary() using namespace.
Bug: https://github.com/dart-lang/sdk/issues/45141
Change-Id: Ifb0825d66a560d0136873942f9666d3dc630b6c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-05 22:21:54 +00:00
Konstantin Shcheglov 9f5f825d96 Check that the element of MethodInvocatio is ExecutableElement.
Change-Id: Ibf414e624b32b6ac5a0b0fde13422db45f875a15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189262
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-05 16:50:56 +00:00
pq 82ad11aeb9 fix all support for USE_NOT_EQ_NULL
Change-Id: I928c669eed12c7f0a6082db059f7ce4133d4f27a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189164
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-03-04 23:14:20 +00:00
pq d202a4c719 fix all fix for USE_EQ_EQ_NULL
Change-Id: I02f78f01b3fcc647dd8e3ca0557cb4f023a745f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189140
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-04 21:58:39 +00:00
Brian Wilkerson 84cafbde9d Remove some unused code from analysis_server
Change-Id: I369a93a9d67cf6a9346e0edcc439d34a8e959e3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189161
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-04 21:13:29 +00:00
Danny Tuppeny bacd31dcdf [analyzer] Flatten capabilities into a wrapper to simplify checking capabilities
Change-Id: I184e8ce3379bbb6ae4d8e81d80979510a8f1f393
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188724
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-04 19:51:09 +00:00
Danny Tuppeny dcc466919f [analyzer] Suggest named args between partially-typed names and values
Fixes https://github.com/dart-lang/sdk/issues/35414.

Change-Id: I847aa87c56de248e8e704790c163de4f83813bbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-04 18:39:49 +00:00
Danny Tuppeny 78dd7a4bb3 [analyzer] Suggest arg names in front of positionals
Fixes https://github.com/dart-lang/sdk/issues/40654.

Change-Id: I329d8b4af9371e8d61c4044bb003f9c22cd72c41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182783
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-04 18:21:19 +00:00
pq 567d745312 fix all support for REPLACE_BOOLEAN_WITH_BOOL
Change-Id: I9b9c9d1732653697abd66b2d7b0d09e818a33ae3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189101
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-04 17:54:39 +00:00
Danny Tuppeny 0635916aeb [analyzer] Set InsertTextMode.asIs for LSP completions when supported
Fixes https://github.com/dart-lang/sdk/issues/45147.

Change-Id: Id6c758eadf9a79ec9cd285fef9e50a1540cdc280
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188723
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-04 16:44:49 +00:00
pq 64012a281f fix all support for REMOVE_UNNECESSARY_CAST
Change-Id: I1507f07271390d24aefed9db96a7fbf9e304ff01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189000
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-04 16:20:27 +00:00
pq c43be3487b bulk fix support for REMOVE_UNNECESSARY_PARENTHESES
Change-Id: I4ce0336398adab64ba6bd811ab918d3f77a0c6cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-03-03 23:01:15 +00:00
Sam Rawlins 8d7dfd6769 Analysis_server: Improve add_null_check fix
This adds add_null_check support for prefix operations, postfix operations,
binary operations, and cascades.

Bug: https://github.com/dart-lang/sdk/issues/43708
Change-Id: I2d1e80f2ccad58adfbac72400ce44efd48751833
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188740
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-03 22:31:14 +00:00
Brian Wilkerson 38a4d48974 Fix bugs in convert_to_generic_function_syntax
Fixes: https://github.com/dart-lang/sdk/issues/45178
Change-Id: Idcdb392637c85225caeba0bab3f539e30abf55f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188742
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-03 21:10:34 +00:00
Konstantin Shcheglov e64981d94e Use getDriverFor() and check for null.
I see that sometimes we get a watcher event that AndroidManifest.xml
was changed, and we don't have the corresponding analysis context.
I suspect that these events are buffered, so we quickly first get
an event that forces us to re-create analysis contexts, and then
the event about AndroidManifest.xml, and if the new set of analysis
contexts does not include the AndroidManifest.xml, we get null.

Change-Id: Ie0bcfbb8f7baa6b6335bf6326f2ea2b7093a1b67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-03 20:32:44 +00:00
pq 944169ad81 fix attempts to fix lints not in the producer map
Fixes: https://github.com/dart-lang/sdk/issues/45177

Change-Id: Id3282f69ee1639b45f5de938f30ae414cee4a3cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-03-03 20:01:04 +00:00
pq 4b35c50cbd fix all support for ADD_NE_NULL
Change-Id: I03e09133fa8af48da1395a538c042c1ee33137de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188681
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-03 18:22:24 +00:00
Danny Tuppeny d901f7326a [Analyzer] Add code completion for Pub package names
Change-Id: I0fa8fb1c2801e2acb2d2cf75f7efecf4f9058eeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-03 17:12:58 +00:00
pq e7644d9a4c fix all support for REMOVE_UNUSED_IMPORT
* adds support for non lint fix all fixes
* enables multi fix for REMOVE_UNUSED_IMPORT

Change-Id: Ib08e82686622d449592cd899df8d63873232a703
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188587
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-03 02:58:57 +00:00
pq f5d71fd1fe enable lint fix-in-file processing
Replaces: https://dart-review.googlesource.com/c/sdk/+/186220

Note:

* this is only for lint producers
* `VerificationTests` ensure that file multi-fixes are tested (as bulk fixes)

Change-Id: Ia2543a31bc9db2cd8ff9c5757e4695a0302fe9b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188585
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-03-02 22:48:17 +00:00
Brian Wilkerson 61d09495b9 Add code to support comparing the quality of code completion relevance tables
Change-Id: Ib4500712e3e63114a357af8cf2c2479b70cc27d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188583
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-02 22:37:47 +00:00
Danny Tuppeny 5c2afd5e34 [analyzer] Base LSP filterText on displayed label, not inserted text
Fixes https://github.com/dart-lang/sdk/issues/45157.

Change-Id: I13d42a1c37b30c8e4d7969a6a20ed14f9fd1f0b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188466
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-02 17:41:32 +00:00
Danny Tuppeny f77eba360e [analyzer] Generate completion text more suited to replacements for LSP
Change-Id: Id8c20ea7e1c32759673c32c9f4b363345bc23116
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188290
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-02 16:14:12 +00:00
Danny Tuppeny ff61ff7d33 [analyzer] Call toJson() on items in Lists when generating LSP json
Change-Id: I9f5876dc577499ae609079eaecae6a3eb47535d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188288
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-02 15:24:38 +00:00
Konstantin Shcheglov c33616c713 Remove isContainedInDotFolder(), switch to isAnalyzed().
Change-Id: I037947c253afe8d676bc2bf44e4b0eeaadc56e19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187641
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-25 23:19:14 +00:00
Konstantin Shcheglov 0e9f75c14c Fix for NPE in ReplaceIfElseWithConditional.
Saw it in crashes and was able to reproduce.

Change-Id: I6cb79b51319730636f1a0200ea0ba71e2ece015a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-25 21:10:27 +00:00
Konstantin Shcheglov 34bec2f1a5 Deprecate AnalysisDriver.contextRoot
Change-Id: I2dfb7f2f751e3c3ba7cdc11c94b9dfa5ddd35670
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-25 19:35:11 +00:00
Danny Tuppeny 85aecd53f4 [analyzer] Seed overlay modification stamp with DateTime.now().millisecondsSinceEpoch
Fixes https://github.com/Dart-Code/Dart-Code/issues/3160.

Change-Id: If57d37796dc36c06ec4bbd986719cecbbc1a98a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187462
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-25 18:02:36 +00:00
pq ecaabe591b prefer constants for fix kind priorities
Change-Id: I665bd9bab8e2ea54a3b1bf295135f4024f1b2440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-02-25 17:33:36 +00:00
Konstantin Shcheglov b3f5c31465 Analyze AndroidManifest.xml files in ContextRoot.analyzedFiles()
Change-Id: I30ceb3c714ffaa498b4f348ed5d3fdc62915feb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-25 16:52:36 +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 2c3d4c9d88 Use InstrumentationService instance where available.
Change-Id: I615faf1e74fdd5134a35f0d562c289d8f2d21a1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-25 05:52:35 +00:00
pq 94f6b6ec94 migrate multi-fixes to unique fix kinds
Change-Id: If28b89ebeab3be8120cb9189d7c54eb1393beb6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186741
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-25 00:24:35 +00:00
Konstantin Shcheglov 722fb9fbc6 Use file_paths.isAndroidManifestXml() instead of 'manifest.xml'
I am a bit surprised that there are no failing tests before or after.

Change-Id: Ie2f94ba6437f95a95c74ec301f2bcbad4ebd9b49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187100
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-24 21:13:14 +00:00
Konstantin Shcheglov c9332fb487 Renames for check/analyze non-Dart files.
Change-Id: I31d9b19429f73e4c9c40f95cf5e7a55ac4a5a09a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-24 21:10:06 +00:00
Konstantin Shcheglov fd81b73e67 Replace AnalysisEngine.isDartFileName() with file_paths.isDart()
Change-Id: Icf5d524945ffdb7087b96555968804946b4e5af4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-24 21:03:24 +00:00
Konstantin Shcheglov 7b68624218 Remove unused analyzedFilesGlobs in AbstractAnalysisServer.
Change-Id: I46f0b7c1b426d3c530d568df3cb04c0ad194d186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186802
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-24 04:14:37 +00:00
Konstantin Shcheglov c3a41ab771 Remove ContextManagerImpl.createSourceInContext()
Change-Id: I58bfa95d0cbddb96f79043b854f398602420268d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186801
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-02-24 04:11:07 +00:00
Konstantin Shcheglov 5036e3ad2c Ensure that _getSdkPath() returns absolute normalized path.
Change-Id: I92dc53e6248e36c2025cd848057eb732b0ae69be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186744
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-24 00:47:37 +00:00
Danny Tuppeny c4edcc4cfa [analyzer] Support separate insert/replace ranges for completions
Fixes https://github.com/Dart-Code/Dart-Code/issues/2998.

Change-Id: I8e989932c16dc97f704c79c06374c8d1d1881f7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186581
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-23 17:43:11 +00:00
Konstantin Shcheglov 917d61b92e Add only dart files to drivers.
Change-Id: I345d3481a9107b6eec1e7e8845e8181f9d12a1ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186500
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-23 04:24:59 +00:00
Konstantin Shcheglov 8194c530e8 Handle ChangeType.REMOVE for any file, flush it.
Change-Id: Idb61bcb96ad5b6d29d46063fe46a9ae7413679a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-22 22:05:20 +00:00
Sam Rawlins 9a673e4ae7 analysis_server: Remove unused dart: import
A bug in the analyzer is causing it to not report this unused import currently.
This PR is part of a cleanup to allow fixing the bug.

Bug: https://github.com/dart-lang/sdk/issues/45028
Change-Id: I2306306e1e51d141c6ba8aa29b7b655fac7b36fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186384
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-22 22:05:00 +00:00
Konstantin Shcheglov 64757ef097 AbstractAnalysisServer.notificationManager is always provided.
Change-Id: Ic99fac81c734ec5d743e77b717e11753b6890b3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186382
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-22 20:50:29 +00:00
Konstantin Shcheglov 3f54b435e1 For for NPE in isInAnalysisRoot when the collection is not create yet.
Change-Id: Iee6142397e490fba84b7c56b976a2c75f4fb1648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-22 20:35:34 +00:00
Konstantin Shcheglov 41dd9e5bea Replace ContextManagerCallbacks.removeContext() with afterContextsDestroyed()
Change-Id: Ibd3dead3e2f117d29f336cd289b1483bcbe0e092
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186380
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-22 20:28:40 +00:00
Danny Tuppeny 8f9cdb3b2f [analyzer] Remove LSP fix-all-in-file functionality
To be replaced by new functionality that works with LSP + original protocol.

Change-Id: I59627e2c4e99b0a6aa0eb850168c870e5390e03b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-22 19:53:39 +00:00
Brian Wilkerson 191e95fa3e Fix the replace_conditional_with_if_else assist in null safe libraries (issue 45030)
Bug: 45030
Change-Id: I2a0946a490a1e69cab7d1bbac6c9efdabd8926c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-22 18:20:59 +00:00
Konstantin Shcheglov a68d60090e Add util/file_paths.dart and use in ContextManagerImpl
Change-Id: Ibbf8ec0b0809fa17e073df6b61065f7e6278c7d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186022
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-02-20 20:33:36 +00:00
Konstantin Shcheglov c2195fcc14 Rewrite to use AnalysisContextCollection in analysis_server.
Change-Id: Iee6b392711790d17c25a3c18fa1e9bdfe8b8cc4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-19 23:01:25 +00:00
Konstantin Shcheglov e4643d5809 Deprecate ElementVisitor.visitFunctionTypeAliasElement()
Change-Id: Ib5d364b77af7974d757626a0719604fa7ec1fec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185902
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-19 22:21:15 +00:00
Keerti Parthasarathy dcf6b12270 Add CiderAssistComputer to compute assists for Cider.
Change-Id: I6087ccabda0c0749d0027b40ecad5050a2eb0431
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185492
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-02-19 15:08:34 +00:00
Konstantin Shcheglov 2e40e359e2 getElementDeclaration() can return null.
Change-Id: I2c8331d22191587991cd1782525d84f5044a79b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185721
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-19 08:21:37 +00:00
Konstantin Shcheglov 9bfd416c45 Add ContextRoot.workspace, deprecated AnalysisContext.workspace, support included excludes in ContextLocatorImpl
Change-Id: Iecd324ad45b926ca6b0626f8bea4f479409154e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185499
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-19 02:15:40 +00:00
Konstantin Shcheglov 9a30392588 Require Workspace for ContextBuilder.getAnalysisOption() and createSourceFactory()
Ideally we want to create Workspace only once, and pass it around.
I was not able to do this yet, because DAS ContextManager kind of
dynamically updates contexts and drivers. I expect to avoid this issue
by switching DAS soon to AnalysisContextCollection.

I will follow with a bigger CL that keeps Workspace in ContextRoot.

Change-Id: I3050ba65400e0e5aa73e6d5f8beae821db10a6ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185498
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-19 00:54:30 +00:00
pq 4302f058dd disable legacy fix-all fix creation
Tests to be re-enabled when we wire-up `FixInFileProcessor`.  (Or maybe we want a different approach to testing fix all fixes entirely?  TBD.)

See: https://github.com/dart-lang/sdk/issues/45026

Change-Id: I66f83d06801a71143dcc770cc38d9e2f86782264
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185180
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-16 20:50:20 +00:00
Danny Tuppeny c8c49c7cc8 [analyzer] Handle creating new files from code actions
Fixes https://github.com/Dart-Code/Dart-Code/issues/3141.

Change-Id: I44d7f20962512988ff1d54c7b38b6a144f973a58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-16 18:54:39 +00:00
Brian Wilkerson 77da201b19 Add a fix for unnecessary_nullable_for_final_variable_declarations
Change-Id: Ibd6570c05f3a289fba72c42f3fc30e88649a9004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185000
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-15 16:26:39 +00:00
Brian Wilkerson e6b5d2c7c0 Add the fix data file to analyzableFilePatterns
Devon noticed the other day that this was missing. I was curious so I
commented out all of the non-Dart file patterns and ran the tests. There
were no failures. There were failures when I also commented out the
file pattern for Dart files, so that much is being used. My guess is
that it would be better to remove the seemingly unused patterns, but
then I have to ask whether we shouldn't just remove this field and
replace uses by a check that the name ends in '.dart'. Let me know what
you think.

Change-Id: Icda44a6fa532989f86cdb52acb3bd0f7a5b28e20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-13 00:40:29 +00:00
Keerti Parthasarathy 5a97dc8fc2 Add lineinfo to CiderErrorFixes
Change-Id: Ic2b82c27a98794a456a43a129ccfc9bd1fc0c07a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184841
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2021-02-13 00:04:11 +00:00
Brian Wilkerson bf8b510a8b Use the type of literal keywords for relevance
This has little negative impact on the completion metrics and some
positive impact in several places. The impact is fairly small overall,
but still worth having in my opinion. The biggest improvement is at the
beginning of a statement. The overall changes in relevance and relevance
by element kind (lower is better) are:

                            shipping  |  keyword type    delta
all completions                4.013  |         3.930   -0.083
successful completions         3.995  |         3.912   -0.083

class                         28.359  |        28.325   -0.034
constructor                    4.739  |         4.739    0.000
enum                          12.928  |        12.928    0.000
instance member                3.273  |         3.153   -0.120
keyword dynamic              136.713  |       136.223   -0.490
keyword void                 239.200  |       227.453  -11.747
local function               161.336  |       161.340    0.004
local variable                 1.632  |         1.616   -0.015
parameter                      4.406  |         4.383   -0.023
prefix                       363.871  |       368.868    4.997
static member                  6.012  |         5.984   -0.028
top level member              12.443  |        12.443    0.000
type parameter               252.785  |       254.135    1.350

Change-Id: Ia449feb716bfd6150f0204885e05fc0e812f1448
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184861
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-12 20:56:01 +00:00
Konstantin Shcheglov 51950ab881 Add Resource.parent2 that returns non-null Folder, add Folder.isRoot
A bigger version of than https://dart-review.googlesource.com/c/sdk/+/184381
This is breaking change, so we do this in steps.

Change-Id: I0c7212a073b605ade56657036543c604651810c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184581
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-12 19:09:20 +00:00
Konstantin Shcheglov 875af7c991 Deprecated TypeProvider.futureType2/listType2/etc
Change-Id: Ia994be1e29b4d96b89d714beafcb9256a0cb4de6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184641
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-12 17:26:07 +00:00
pq 2d27b34b06 appliedTogetherMessages for fixable in file fixes
Change-Id: I674f0e79c5d7ce5c44bcbddff8e6866106e860c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-02-12 17:10:23 +00:00
Konstantin Shcheglov 27e707268f Always crawl up in getOptionsFile()
Change-Id: I424cd625f05d9bc10ae0366e0332e96496633062
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 23:24:11 +00:00
pq fbf07bc7b7 migrate towards a shared nonLintProducerMap
Introduces a new map datastructure and migrate BulkFixProcessor to use it.

Change-Id: I6294cce875ac5e5052b363282454af6dadf011f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-02-11 18:37:30 +00:00
Danny Tuppeny 235292605e [analyzer] Filter code actions returned from LSP server based on params.context.only
Fixes https://github.com/Dart-Code/Dart-Code/issues/2854.

Change-Id: If6036a4361b68ae2daa66b99755dfa9b9a8adcfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184464
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-11 18:16:20 +00:00
Konstantin Shcheglov 244964d893 Refactor ContextBuilder.createPackageMap() and createWorkspace() into static methods.
There are places when we need to call createWorkspace(), but we don't
have enough data to create full ContextBuilder, because we don't
know SdkManager.

Change-Id: I12ec5701ecab897bf1c49c478e8487c7ca348a29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184380
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 17:52:53 +00:00
Danny Tuppeny ab8335b4fd [analyzer] Don't fail to initialize LSP server with non-file:// workspace folders/roots
Change-Id: I52fa0620ef563ff0362cb86b24ffc287e8e007c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-11 16:10:19 +00:00
Brian Wilkerson 1ee6459ded Fix a bug in addParameter handling
Change-Id: Id321108ce4fbd096ba79212f530486ec2318fba3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184205
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-10 22:49:33 +00:00
Sam Rawlins b948c7ee26 analysis_server: Remove unnecessary imports
Change-Id: I153b993e5d7721ad71818f3bd29d5117a76f3f08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184280
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-10 18:24:36 +00:00
Konstantin Shcheglov b4409ea3b4 Deprecate FunctionType.element/typeArguments
Bug: https://github.com/dart-lang/sdk/issues/44629
Change-Id: I5009a1abd456f33738d3b5e2ecae24b269b20000
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182700
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-10 17:17:58 +00:00
Devon Carew 3f8c508a94 [analyzer] don't analyze html files
Change-Id: I45fa266be055a7d6ca1c0ecb90dc8245fa8b4616
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184102
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-02-10 15:52:24 +00:00
Devon Carew c290fc0eaf [analysis server] Fix an NPE in the diagnostic page
Change-Id: Ifafd1c75978aa9a5b6193139455926a6936b66ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-02-10 01:14:17 +00:00
pq 7b2dcad078 improved fix in file computation
Follow-up from: https://dart-review.googlesource.com/c/sdk/+/183700

Change-Id: I6d15b25a2dc4664fd3743763fedd83bf39bba794
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184041
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-09 22:24:54 +00:00
Danny Tuppeny cc7bd35516 [analyzer] Support completing argument names in function expression invocations
Fixes https://github.com/dart-lang/sdk/issues/42064.

Change-Id: I186bef47771a56844833fc908c183358955e11ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-09 21:44:32 +00:00
pq db09afdd1f fix (all) in file processor
Change-Id: I092d99ab8dd7e16fe351cf475a7c935a2546d67c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-02-09 20:35:46 +00:00
pq 720a2af3bd appliedTogetherMessage consistency
Change-Id: I187719426677c6d473fc8e0377f91d6ae54b8751
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183765
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-02-09 17:37:47 +00:00
Brian Wilkerson cf2e85f035 Generalize FeatureComputerTest to make writing more tests easier
Also, fixed a small bug found by updating the code used to find the node.

Change-Id: Id64e66f4d50f70aaadd3e56e37a83b257d119b9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183181
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-06 01:24:28 +00:00
Keerti Parthasarathy 8f74a46b05 Use line number to compute fixes, Cider provides line and column number.
Change-Id: I134480f88b55893a1a397847902176a792dfb0ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2021-02-04 19:16:27 +00:00
Konstantin Shcheglov 950234803b Update DartEditBuilderImpl.writeType() to support type aliases.
Change-Id: I560596384e8a8d422a013b6597ca9ab91c2d00df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182663
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-04 00:23:29 +00:00
Konstantin Shcheglov 3be5f7c356 Use Future<void> when extract an async method that returns nothing.
R=brianwilkerson@google.com

Change-Id: Ic148974ba587310c475795caf8ed0c8565d96909
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182664
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-03 22:25:39 +00:00
Konstantin Shcheglov 02d2b4fb8a Update CorrectionUtils.getTypeSource() to support any type aliases.
Change-Id: I6bb3ea6c60adc2efe071b58369296de4d63fd6d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182602
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-03 20:26:29 +00:00
Danny Tuppeny ddd70f5cd0 [analyzer] Don't rebuild declarations when analysis roots don't really change
Change-Id: I7e63f6933ec936282555667261eb9fa3e42bb177
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182509
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-03 20:11:17 +00:00
Sam Rawlins f306f4c4d4 Analysis server: Remove unnecessary imports; standardize on prefix use
In a few files, an element is available twice: once without a prefix,
and once with a prefix, and the element is referenced in both ways. This
triggers an "unnecessary import" diagnostic, and changing all of the
references to be unified resolves the issue.

Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I3c5a3f397f0a3603624a2d23becfda2753cc9f8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177280
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-03 08:41:48 +00:00
Konstantin Shcheglov 5b227c8fbe getElementDeclaration() can return null.
Change-Id: I63207c55890d1c3b817bae1b57275ed37b9befa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182368
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-03 00:27:20 +00:00
Brian Wilkerson f4f974a1ac Add a feature to decrease the probability of suggesting noSuchMethod
This feature improves the metrics in locations where methods can be
suggested and has no effect in the remaining locations. The improvement
is very small, but I think it's worthwhile nontheless.

Change-Id: I88cdb19a1d870f5a27871925d56ce204f5b3f8a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182302
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-02 18:48:54 +00:00
Konstantin Shcheglov 74583b31ed Make looking for BUILD file substitutes in BazelWorkspace optional.
Disable it for DAS, we always have BUILD files when interactive analysis.

Change-Id: I095f74ad25698e7ec07ea94252ee287d29e6a52f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182122
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-02 17:03:14 +00:00