Commit Graph

9716 Commits

Author SHA1 Message Date
pq 4d1b785239 [productivity] add “current file” launch configs
Bug: https://github.com/dart-lang/sdk/issues/60070
Change-Id: I003a492e6004d2dcaf6c2c52688c733d7f43e53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408900
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-10 14:31:52 -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
Danny Tuppeny 3ded147e2e [analysis_server] Make format of LSP completion tests more consistent
No functional changes here, only formatting/code style:

- Remove additional intending from embedded code in some tests (which didn't match others in this file or the style of other tests in the server)
- Change expression-bodied-tests to block bodies where they're not on a single line

Change-Id: I2c15bbcf7b7accff85f34a4e9ad5afa3e0a0a221
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-02-10 10:27:40 -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
Jake Macdonald da2ffedc50 add test for adding super calls with multiple parameters
Bug:https://github.com/dart-lang/sdk/issues/59745
Change-Id: Ibaf6321f0ea6cf3046f360e91cf58faba7a16cb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408460
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2025-02-07 13:30:01 -08:00
pq c87b18581a [CQ] rationalize/unify test lint registration
Eliminates duplication and promotes hermetic tests (some were registering and failing to unregister test lints).

Bug: https://github.com/dart-lang/sdk/issues/60036
Change-Id: I9d0fe5fd610b51ce9000decbf75da2338ed87737
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-02-07 13:09:28 -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 7559108945 [DAS] Tests for parameter highlights
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/60046
Change-Id: I5b57109e9459a8583fd543031f239174a71472cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408040
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-02-06 13:08:59 -08:00
pq 93847ce649 [productivity] server test launch config and generate task
Bug: https://github.com/dart-lang/sdk/issues/60070
Change-Id: Ia7dea87b6b2ac3c74745bb81807fe7347f1a552a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408340
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-02-06 11:47:14 -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
pq 466cc35c7e [CQ] correct options fix test docs
Change-Id: Ib87ca966872e7ea165d866a1c95fd8669b6852c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407622
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-02-04 09:05:03 -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
FMorschel 1372538855 [DAS] Fixes import prefix go to definition (multiple)
R=keertip@google.com

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

Change-Id: Ida0cb58cdb4267af31a87a29862a3f4f2e28907f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405201
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-02-03 09:18:52 -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
Konstantin Shcheglov 6e17841614 Macro. Remove tests from analyzer/ and analysis_server/.
Change-Id: Iabe04d7ff8fe0cc9b605d0c18fd47591fd02d6bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406681
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-29 14:58:19 -08:00
pq a11d2feb92 [CQ] enforce unnecessary_ignore
Change-Id: Id2c57e56425aa31e86b78f081d71575e8fec7838
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406722
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-01-29 14:49:38 -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 8eb9bcd7f0 [analysis_server] Verify with/without documentChanges for EditArguments tests
The tests by default run with documentChanges (set in `setUp`), but it's possible LSP-over-Legacy clients won't support it.

Change-Id: I40c65f05127c88e15a43f16669f64675285955dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406002
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-27 12:54:48 -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
Brian Wilkerson 83f540b4f0 Fix three links to the contributing docs for the sdk
Change-Id: I7da01e06279b649021c3c40e44c223cd1cec02c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405860
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-01-27 08:12:11 -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
Danny Tuppeny 0d90ccc2ec [analysis_server] Use unique request IDs in tests to avoid flaky tests
Some of the LSP-over-Legacy tests were intermittently failing because the test did not correctly wait for the `setClientCapabilities` request to complete.

The reason for this was that it used the ID `0` (from `_newRequestId`) but so did `setAnalysisRoots`. If the timing was right, the second request would appear to complete when the first did (because the response had id=0) and the test would start before the capabilities had actually been set (and since the test reads them directly off the server, they would be incorrect).

This moves the `_nextRequestId` field down into a base class and updates the helpers for requests like `setAnalysisRoots` to use it too.

Change-Id: Ice44191aad39c7ea81c40e501827557fe563e3d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-01-24 09:26:38 -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
Chloe Stefantsova b0813fb9e2 [analyzer] Add trailing comma test for null-aware elements
Part of https://github.com/dart-lang/sdk/issues/56989

Change-Id: Iad92a1144374ba24cc5b228f7e4b58c6329c8fbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405380
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-22 23:32:01 -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
Danny Tuppeny 1165528f9f [analysis_server] Improve the formatting of inserted arguments
This improves the formatting of inserted arguments by including newlines and indentation if an invocation spans multiple lines.

Change-Id: Idef4602ee9ac9f145879a4628190ec44f87a0018
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405122
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
2025-01-22 15:15:31 -08:00
Danny Tuppeny 199d50aab1 [analysis_server] Check for applyEdit support before handling EditArguments
If we get an editArgument request (usually via DDS), we should verify the connected editor supports edits and return an explicit message if not.

Also adds a `setUp()` declaration to `SharedTestInterface` so shared tests can set client capabilities instead of them being duplicated in each test class (and moves the same for ApplyEdit tests to this).

Change-Id: Ie6a85620b3b53663ce92e55d93e3aefcaf4dc980
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-01-22 15:15:19 -08:00
Danny Tuppeny 154b473cdb [analysis_server] Fix missing dartdoc references in Library comments
Fixes https://github.com/dart-lang/sdk/issues/59946

Change-Id: I3b8558f72b6cc932f2c87ee4f2e993c5584907a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-01-22 13:00:30 -08:00
pq 26f220614c [fix] fix unnecessary_ignore eol ignore corrections
Change-Id: Ifdae16f0a401d28322796b3fecc2e575896fca37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405246
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-01-22 09:46:56 -08:00
Mohamed Abdelaal 9b7bb9df90 Fix "the the" typo
Closes https://github.com/dart-lang/sdk/pull/59926

GitOrigin-RevId: cb37bca473b0c177b876a0f4e75858cd1862e699
Change-Id: I6827241b22e99db455945afcdfbaee0450999ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404923
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-01-21 14:08:20 -08:00
Paul Berry 751fe131e9 [analyzer] Use TypeImpl for type annotation types.
The types of `TypeAnnotationImpl.type`, and the fields that override
it, are changed from `DartType?` to `TypeImpl?`. Also, the type of
`TypeAnnotationExtension.typeOrThrow` is changed from `DartType` to
`TypeImpl`.

To reduce the number of casts that need to be added, the following
changes are made in parallel:

- An additional extension `TypeAnnotationImplExtension.typeOrThrow` is
  added; this has the same behavior as
  `TypeAnnotationExtension.typeOrThrow`, but it doesn't require a type
  cast.

- Some field types, getter types, method return types, and method
  parameter types are changed to `Impl` types in the following
  classes:
  - `AstRewriter`
  - `EraseNonJSInteropTypes`
  - `ExtensionTypeErasure`
  - `FreshTypeParameters`
  - `FullInvocationInferrer`
  - `FunctionExpressionInvocationResolver`
  - `FunctionReferenceResolver`
  - `FunctionTypeBuilder`
  - `InstanceCreationInferrer`
  - `InvocationExpressionInferrer`
  - `InvocationInferrer`
  - `NamedTypeBuilder`
  - `NamedTypeResolver`
  - `ResolutionReader`
  - `TypeAliasElementImpl`
  - `TypeAliasElementImpl2`
  - `TypeImpl`
  - `TypeParameterElementImpl`
  - `TypeSystemImpl`

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: I7f753508b53f6744677fd18f66858d70eb974093
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405221
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-01-21 10:46:52 -08:00
Sam Rawlins 6c5fe06d70 DAS plugins: Add an SDK constraint to generated pubspec
Change-Id: I98765c019d5e41b347b11b874165e3de0e381002
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-01-21 10:30:20 -08:00
FMorschel 667730a0b5 [DAS] Fixes import prefix highlighting
R=scheglov@google.com

Fixes: https://github.com/dart-lang/sdk/issues/59942
Change-Id: Id5c971f040dc2dcdddde6e36055e9045eb4b2aef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404925
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-01-20 10:11:52 -08:00