Commit Graph

7283 Commits

Author SHA1 Message Date
Brian Wilkerson e8e56ff2f5 Cleanup declarations in server with trailing digits
There are still lots of declarations whose name ends in a trailing
digit, but most of them are unrelated to the migration, and some
are required in order to not break internal code.

I'm happy to break this up into smaller CLs if it's hard to review.
Mostly it's just renaming some declarations, although there are one or
two places where I did a little more clean-up.

Change-Id: I50d32316e82e48c6a5a47aec630b4ffee2ead2c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410922
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-02-23 08:17:36 -08:00
Konstantin Shcheglov fad65ac3b4 Elements. Migrate NamespaceBuilder.
Change-Id: I3f51d6ad88528a7a7251a8c140795a442b04e5a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-21 16:41:39 -08:00
Chloe Stefantsova db96984d37 [analyzer] Add correction for removing '?' before elements
Part of https://github.com/dart-lang/sdk/issues/56989

Change-Id: I36543863eb76724cb23b4521780eccd130750014
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410042
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-02-21 11:28:29 -08:00
Chloe Stefantsova 57e5b2895f [analyzer] Handle NullAwareElements in Flutter outlines
Part of https://github.com/dart-lang/sdk/issues/56989

Change-Id: I32557d994d16b97b8f3b40bb3d654a657338b83e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-02-20 23:32:01 -08:00
pq 7ac018eaf4 [element model] migrate error_verifier (import directives, cleanup)
Change-Id: Ie413c7ab0cb9e4fdcdf11cec6e726c376e0701af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411085
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-02-20 15:32:29 -08:00
Danny Tuppeny bc7feacec6 [analysis_server] Fix missing trailing comma when inserting arguments before solo child/children
The logic here was bad, assuming we didn't need a trailing comma when inserting an arg before a solo argument (which can happen for child/children).

Fixes https://github.com/flutter/devtools/issues/8921

Change-Id: I38f9003cdc8b499d6417cac7989c65a4760416a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-20 15:07:32 -08:00
Brian Wilkerson 0ebec968c9 [migration] rename.dart
This also migrates all of refactoring.dart except for one getter that's used internally.

Change-Id: If11f30d740c02509e3eeeac90268b14540e3e0a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-20 13:40:40 -08:00
Danny Tuppeny a31be9beba [analysis_server] Provide DocumentLinks for packages in Pubspec.yaml
Having quick links to pub.dev in pubspec.yaml is a long-standing request, but all of the API options to implemented it seemed bad.

However I was recently made aware that DocumentLinks (which we use for the Flutter example links) support HTTP links and this turns out to be a perfect fit (credit to https://github.com/orestesgaolin for the idea).

Links are built based on the kind of package, so `git` and `hosted` packages will be built accordingly (I special-cased GitHub SSH links but don't know if this could be generalised for other Git-hosting services). We use PUB_HOSTED_URL as the default base for standard Pub packages.

Packages that don't have URLs (such as `path`, `sdk: x` or other unknown kinds) will not produce links.

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

Change-Id: I1c9e704f67736bbc451866a9e10f7928e2246c7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409660
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-02-20 09:36:01 -08:00
Brian Wilkerson 2c62efb890 [migration] cider/rename.dart
This also contains some minor, but unrelated, changes to
kythe_visitors.dart. I'm happy to back them out if you'd like me to.

Change-Id: I89dac691c3bb1c642a343c010fb71b66680272c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410901
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-20 06:54:29 -08:00
FMorschel 8f79645456 [DAS] Fixes closure cases for inline method refactor
R=scheglov@google.com, pquitslund@google.com

Fixes: https://github.com/dart-lang/sdk/issues/60160
Change-Id: Ie6313a92d5e4326b81ad0f277c5a8ff2c264ca39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410603
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-02-19 10:24:07 -08:00
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