Commit Graph

7273 Commits

Author SHA1 Message Date
Keerti Parthasarathy dd93f6fae0 Fix for create constructor for Widget with private fields.
Fixes https://github.com/dart-lang/sdk/issues/56182

Change-Id: I25a94dbb5af5dda4db1fde9494783df215587fd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410520
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2025-02-18 21:48:29 -08:00
Brian Wilkerson f0561dcdb9 [migration] refactoring_manager.dart and handler_rename.dart
Change-Id: I9294afbec0d472fb87c595d0e9c9b9ca2a2cc838
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410444
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-02-18 17:17:12 -08:00
FMorschel 2048190cb1 [DAS] Makes encapsulate field work with final
R=scheglov@google.com

Fixes: https://github.com/dart-lang/sdk/issues/60154
Change-Id: I45c887169672e3cdbce4aea95000996c09e8123b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410460
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-02-18 14:02:43 -08:00
Johnni Winther c714269f51 [analyzer] Migrate ElementDeclarationResult
Change-Id: Iaa18a32075e2dc92d47378d90cfb801bc5884473
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408702
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2025-02-18 08:22:51 -08:00
Brian Wilkerson b7178c2b58 [migration] element_visitors.dart
Change-Id: I85b6e19575a1a8695982bf8349fc88c84ace2645
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410241
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-14 21:28:52 -08:00
Brian Wilkerson 0c423637b6 [migration] namespace.dart
Change-Id: I87d287cd73e34b3797258e27e4b80e57942bd7c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410163
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-14 21:28:39 -08:00
Brian Wilkerson 02f86848ee [migration] etract_method.dart
Change-Id: I683d58f131fb610cd343e9446a2abf1466313b75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410143
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-14 15:49:46 -08:00
Konstantin Shcheglov 7964d55940 Elements. Migrate TopLevelDeclarations.
Change-Id: I9bdcf6ac8c26bfa2eb50de8efd8c2a3a3538403a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-14 14:46:37 -08:00
Brian Wilkerson d18af76865 [migration] analysis_server.dart
Change-Id: I111faf848d4243f72fb5e9bf20393784d6ed1fcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-14 12:15:10 -08:00
Brian Wilkerson 0c15648c0b [migration] search_find_element_references.dart
Change-Id: I320e4a92a8c5b5e6cb55347d93272c38a92cc325
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410100
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-02-14 10:48:20 -08:00
Paul Berry d3de420bf8 Add a custom lint to sanity check the analyzer public API.
The new lint, called `analyzer_public_api`, verifies that the analyzer
public API satisfies the following properties:

- No method, function, getter, setter, or supertype in the public API
  refers to a non-public type.

- No `export` declaration in the public API shows a non-public name.

- No declaration in the public API has a name ending in `Impl`.

- No file in the public API has a `part` declaration that points to a
  file that's not in the public API. (If it did, then the other checks
  could be circumvented.)

A new annotation is added, `@AnalyzerPublicApi()`, allowing
declarations in `package:analyzer/src` or
`package:_fe_analyzer_shared/src` to be marked as part of the analyzer
public API. This is necessary because some parts of the analyzer
public API need to be declared elsewhere and then exported by the
analyzer.

A few lint violations have been ignored using `ignore:` comments. I
will try to clean these up in follow-up CLs.

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

Bug: https://github.com/dart-lang/sdk/issues/60058
Change-Id: I0047a73dec8a29e2ffe03dd3a90f7e41ca2e27b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-02-14 05:24:22 -08:00
Brian Wilkerson 56f82965d0 [migrate] protocol_server.dart
Change-Id: I5dcaaa2ae57d17eafb6359eccf9ea2a35df21784
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-13 17:33:00 -08:00
Sam Rawlins 03eb25d975 Bump analyzer version used in plugins
Change-Id: I409bab47add37b51e676fc39286244aae554a4fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-02-13 12:25:00 -08:00
Danny Tuppeny b0566a5773 [analysis_server] Remove isDefault and don't set value when there's no argument for EditableArguments API
Now that we have `defaultValue` against each argument, there was some redundancy here.

`isDefault` is redundant because if `hasArgument=false` it's always default, and if `hasArgument=true`, then `value` and `defaultValue` can be compared
When `hasArgument=false`, there's no value in duplicating `defaultValue` into `value`

Change-Id: I5cba055e56175565842efef815e08dd46e9ed36a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406621
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-13 09:23:32 -08:00
Brian Wilkerson ffe97e5fdc [migrate] Partial kythe_visitors.dart
Change-Id: I571ba21c663a577a34daa02a50d232f05ba1857c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409565
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
2025-02-13 08:11:15 -08:00
Brian Wilkerson 0e9c9f0868 Some minor cleanup in the analysis server
Change-Id: Iebfa1f3fc421676ab053df6e7635b912dfe9ebbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409542
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-12 15:04:39 -08:00
Ben Konyi b732a62fd2 [ analyzer ] Add support for "Wrap FutureBuilder" code assist
Fixes https://github.com/dart-lang/sdk/issues/34364

Change-Id: I53b005fdae61fe84ebc7defd54531df6dcd2a351
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408341
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-12 13:12:19 -08:00
Danny Tuppeny ff93acd624 [analysis_server] Fix "Move to File" for top-level variables with references to their getters
There were two issues here:

1. Analyzer's `prefixesUsedInLibrary` search did not handle when an element was not found in the library (for example when looking for a top level variable that doesn't match because it's referenced through a getter)
2. The refactor not looking for prefixes for getters/setters when updating other files

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

Change-Id: Ic560e06c45091937611b247e7fee26b9854873fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406844
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-12 11:41:34 -08:00
Konstantin Shcheglov 0c412862d8 Elements. Migrate RenameImportRefactoringImpl.
Change-Id: I0e295b36fdc6c9e47c3cf5b0e648891d12fad031
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-11 08:59:50 -08:00
Danny Tuppeny e758dffdbb [analysis_server] Add missing bool completions for strict language options in analysis_options
Fixes part of https://github.com/dart-lang/sdk/issues/59827, but not the main issue.

Change-Id: I7f9d6cfd5163a1bf6c72f9eea4bb71872d3dfa15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-02-11 08:27:51 -08:00
FMorschel 2eec09dcd4 [DAS] Makes EXTENSION_DECLARES_INSTANCE_FIELD trigger on all field names
R=jensj@google.com, paulberry@google.com

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

Change-Id: Ic4b41973d0d74d809d813ba57b85f50fab4c9a47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407080
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-02-11 03:15:31 -08:00
FMorschel 3f71a43464 [DAS] Adds new fix for importing multiple names in combinantors
R=srawlins@google.com

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

Change-Id: I3f48517b927aeaa3c410b6f04fcf75b3beead923
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399021
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-02-10 23:51:30 -08:00
Jake Macdonald e6df5493c9 support renamed parameters when adding super calls
Bug: https://github.com/dart-lang/sdk/issues/59745
Change-Id: I177e4f748954ddfea1b300085800c8c9a87bed3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408840
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-10 12:48:10 -08:00
Keerti Parthasarathy 0246cc613f [Completion] Show enum constants when completion is in the declaration.
Fixes https://github.com/dart-lang/sdk/issues/56971

Change-Id: Ib33a58e774f5540c426f5d5ffb7a387414dcf9f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2025-02-09 22:41:31 -08:00
Sam Rawlins 093ab49d6f DAS: Correct several broken comment references
Change-Id: Id0e80d5566a5c05296a5941746888a48284c4ae0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407861
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-09 08:40:07 -08:00
Sam Rawlins 03c0855f9d DAS: Tidy snippet_producer.dart
While fixing the doc comments for DartSnippetProducer.addImports, I
saw that it references two methods only found in the subclass,
FlutterSnippetProducer ("Adds public imports for any elements fetched
by [getClass] and [getMixin]").

It turns out that the `addImports` method and the `requiredElementImports` are only needed in the subclass,
FlutterSnippetProducer, so I just moved them over. Now the doc
comment references resolve correctly.


Change-Id: Id90e8257b4096308b8cd3ce19b14708ca1b5e365
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-02-09 08:30:03 -08:00
Danny Tuppeny a78fb5e47a [analysis_server] Fix semantic tokens for method tear-offs in object patterns
Fixes https://github.com/dart-lang/sdk/issues/59976

Change-Id: I75127a59670522ddfc6526d10bfe9844638fdd99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408001
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-07 12:24:25 -08:00
Kenzie Davisson 46a739ce20 Add quick assist for Wrap with ValueListenableBuilder
Change-Id: If4941d867fbdea687a12a043da240ceb981c758f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408401
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-07 10:47:31 -08:00
Jake Macdonald f4cfbf9cdc Update create function fix to create an async function for await expressions
Bug: https://github.com/dart-lang/sdk/issues/59990
Change-Id: I9e89089ca5c60bea190060bc0c8e869c7e78e32e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408361
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-06 14:25:39 -08:00
FMorschel 07b7cfed07 New assist to add/edit hide at import for ambiguous import
Closes https://github.com/dart-lang/sdk/pull/56762

GitOrigin-RevId: af16e245090fa66e6212801cd862d809f5ede640
Change-Id: Ibbc49c36860ba6e58c45dfc40029e2375396c153
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386020
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-02-05 15:49:35 -08:00
Sam Rawlins 2ac59922d2 DAS plugins: Support fixes to ignore diagnostics
Change-Id: I71ae995d1a4a94ecfeafd187c5674c41b6d928d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-02-04 08:24:23 -08:00
Brian Wilkerson 5454e70ce2 [migration] Rename utilities in protocol_dart.dart
Change-Id: I90c06dffcac98bc8ec6bb2a982a6825157eda56d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407620
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-02-03 16:32:40 -08:00
Brian Wilkerson 448f0d4080 [migrate] server/protocol_dart.dart
I didn't rename all of the functions because I thought it would be easier to review if I did it in two steps.

Change-Id: If765d56300374794dc9964f17002cfbe172e66b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407602
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-03 14:34:21 -08:00
Danny Tuppeny 4be9188379 [analysis_server] Support occurrences (Document Highlights) with different lengths
+ split unnamed constructors from classes

Fixes https://github.com/Dart-Code/Dart-Code/issues/4454

Change-Id: I42e7346b7c22348cf6424d15c5c35a24e31c85b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-02-03 12:05:53 -08:00
FMorschel 6de0ef3d5f [DAS] Fix auto-complete update combinators
We already have a quick-fix that allows us to use the same existing import by editing the combinators. The auto-completer now should do the same.

Bug: https://github.com/Dart-Code/Dart-Code/issues/5238
Change-Id: I0f3a50299abb9890370a6c8934b49036f7e03196
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404525
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-03 11:15:57 -08:00
Konstantin Shcheglov 2946ea71d5 Macro. Remove more from analyzer/ and analysis_seever/.
Change-Id: Id5426cce73395d3d95657cf1e0b5f9d85fe3f574
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-31 11:35:10 -08:00
Konstantin Shcheglov 38d534ea57 Elements. Make PropertyAccessorElement2.enclosingElement2 non-nullable.
Change-Id: If54f6428cbf8e96cb84e9eb2e989104b2f56cbce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406689
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-31 11:00:40 -08:00
Sam Rawlins ca31648dbb Support 'new' analyzer plugins in dart analyze.
This change allows the LegacyAnalysisServer to understand when the
plugin isolate (if there is one) is analyzing or not. There are a few
primary concepts:

* The plugin isolate (PluginServer) notifies the analysis server, when
  analyzing all files in a context collection, and analyzing changed
  files, that it is analyzing, and later that it isn't.
* The NotificationManager tracks whether the plugin isolate is analyzing
  or not, based on the last status.
* The PluginManager tracks whether new plugins are initialized or not.
  This is determined by the work done by the PluginWatcher. If no
  plugins are configured, then plugins are declared to be "initialized".
  Otherwise, the AnalysisServer sets their status to be "initialized"
  after receiving the first status notification from the plugin isolate.
* The LegacyAnalysisServer now uses the additional "are plugins
  analyzing" signal, held in NotificationManager, and the "are plugins
  initializing" signal, held in PluginManager, to determine whether to
  notify the client that analysis is complete.


Change-Id: Ie2b6a6048f074d7a26d7d5d07622a17c30fcab96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405444
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-31 10:44:36 -08:00
Konstantin Shcheglov b528b6e441 Macro. Remove most of the implementation.
Change-Id: Icd5966b91fb594a618dde38bb8b4c217ede75d9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406724
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-01-30 14:58:41 -08:00
Danny Tuppeny 204039cdf2 [analysis_server] Add "defaultValue" to EditableArguments API
This adds a new field "defaultValue" to the API response that contains the default value for a parameter.

Change-Id: Ief11da553d57871ad1e3fab54c731cbc98d674a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406000
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-29 08:00:26 -08:00
Chloe Stefantsova 11edab5264 [analyzer] Add correction for adding '?' before null-aware elements
Part of https://github.com/dart-lang/sdk/issues/56989

Change-Id: I487790e796a37679fd5fe1c9bc1e72ccb6248249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405520
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-01-28 23:06:04 -08:00
Danny Tuppeny ca2119e0a6 [anlaysis_server] Improve the error text/codes for property editor APIs
Change-Id: If3ad0fd11cc661e88104444afd14a5d79374cc1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-01-28 13:00:18 -08:00
Danny Tuppeny 1ec4ea79fd [analysis_server] Include "get" or "set" in LSP override completions to distinguish them
Screenshot of how this looks here: https://github.com/dart-lang/sdk/issues/59929#issuecomment-2602188244

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

Change-Id: I220ee8facb96dbf31ee88868c8c44223de5e8406
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405007
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-27 09:06:38 -08:00
Danny Tuppeny 8884a8b4ad [analysis_server] Make it easier to print protocol messages when running LSP-over-Legacy tests
This moves the existing `debugPrintCommunication` flag out of `test/lsp` into `test/` and passes it to the `MockServerChannel` to simplify printing protocol messages for LSP-over-Legacy tests (similar to what MockLspServerChannel already does).

Change-Id: Ic5fa6309e8de01ce0c624584ad6eb653ced90698
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406021
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-01-27 08:47:42 -08:00
Sam Rawlins c550de7c40 analysis server: simplify LegacyAnalysisServer
This class had a few methods which only pertain to the resource provider
and can just be extensions on ResourceProvider. They also have the
exact same impl! So one can redirect to the other.

Change-Id: I3a0433304adba1b71f69d0a4afc8a44515a23d10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405600
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-25 11:52:58 -08:00
FMorschel a0db69f182 [DAS] Considers factory keyword on constructors auto-complete
R=keertip@google.com

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

Change-Id: I47c51bc521f97398ae19a8d124e836baadfdabd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405200
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-01-24 08:45:46 -08:00
Sam Rawlins 994b474b74 analysis_server_plugin: Bump versions of dependencies
Change-Id: I6f4a04732ef8ad5af178ea64b1ab259c891ea451
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-01-24 07:46:20 -08:00
Sam Rawlins be4d4fd5ed analysis_server: minor nits
Change-Id: Ic31459d36fa425ba1cbda30e97655c1a1441c21d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405580
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-23 09:59:03 -08:00
Paul Berry 6a927feb20 [analyzer] Change types in CollectionLiteralContext to TypeImpl.
The types of the following members of `CollectionLiteralContext` are
all changed to use `TypeImpl` rather than `DartType`:

- `elementType`
- `iterableType`
- `keyType`
- `valueType`

To reduce the number of casts that need to be added, some field types,
getter types, method return types, and method parameter types are
changed to `Impl` types in the following classes, mixins, and
extensions:

- `BodyInferenceContext`
- `ElementsTypesMixin`
- `ErrorDetectionHelpers`
- `ExecutableMember`
- `ExtensionMemberResolver`
- `ExtensionsExtensions`
- `ExtensionsExtensions2`
- `FormalParameterElementMixin`
- `FragmentedFunctionTypedElementMixin`
- `FunctionTypeImpl`
- `GenericFunctionInferenceTest`
- `InstantiatedExtensionWithMember`
- `InterfaceTypeImpl`
- `InvocationInferrer`
- `LeastUpperBoundHelper`
- `LowerBoundTest`
- `MethodMember`
- `NotInstantiatedExtensionsExtensions`
- `NotInstantiatedExtensionsExtensions2`
- `ParameterElementExtension`
- `ParameterElementMixin`
- `ResolverVisitor`
- `StringTypes`
- `TypedLiteralResolver`
- `TypeSystemImpl`
- `TypeSystemOperations`
- `_BoundsTestBase`
- `_InferredCollectionElementTypeInformation`
- `_NotInstantiatedExtension`
- `_ParamInfo`

There is no change to the analyzer public API.

This is part of a larger arc of work to change the analyzer's use of
the shared code so that the type parameters it supplies are not part
of the analyzer public API. See
https://github.com/dart-lang/sdk/issues/59763.

Change-Id: I7a5f7c411e81b829be205f1919c933f8f874e5ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405404
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-01-23 06:09:09 -08:00
Danny Tuppeny ecf74c5c54 [analysis_server] Add widget name + documentation to EditableArguments
Change-Id: I8b8424b77ff1f9683934c64636a9f56097be870f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405123
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-22 15:48:23 -08:00