Commit Graph

30 Commits

Author SHA1 Message Date
Paul Berry afcfbbeba8 Migrate developer experience packages to new constructor decl syntax.
(Part of https://github.com/dart-lang/sdk/issues/63288)

This change migrates the packages owned by the developer experience
team to use the new constructor declaration syntax, described in
https://github.com/dart-lang/language/blob/main/accepted/future-releases/primary-constructors/feature-specification.md#abbreviations-of-in-body-constructor-declarations.

This change was performed in an automated fashion, by (a) bumping the
packages' SDK constraints to `3.13.0-0`, (b) enabling the lints
`unnecessary_type_name_in_constructor` and
`unnecessary_const_in_enum_constructor`, (c) fixing the resulting lint
failures using `dart fix`, and then (d) reformatting the affected
files.

To ease code review, I've reverted unrelated formatting changes.

Since this change requires bumping SDK constaints to `3.13.0-0`, it
was only performed on packages that are *not* published on
pub. (Packages that *are* published on pub should remain on lower
language versions until at least after the stable version of 3.13 is
released, so that we don't block users on the stable channel from
receiving updates to those packages.)

Change-Id: Ibb4daebafd239da58251e838ea6a3f336a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505046
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
2026-05-27 14:52:58 -07:00
Konstantin Shcheglov 6cd3938741 Breaking changes for analyzer 13.0.0
https://github.com/dart-lang/sdk/issues/62799
https://github.com/dart-lang/sdk/issues/62944
https://github.com/dart-lang/sdk/issues/63002
https://github.com/dart-lang/sdk/issues/62970

Looks mostly green in google3: https://fusion2.corp.google.com/presubmit/901021300/OCL:901021300:BASE:901308428:1776439417713:37cd1695

Change-Id: I44754a48f66a0b58851d7c20fcfa61f7fb1b555a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488624
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-17 23:06:25 -07:00
Paul Berry 07b214eef5 Bump analysis server to language version 3.12.
Also start using the "private named parameters" feature.

Change-Id: I1c6da5f8ae2985e12313d405a2eb419c6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487521
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-03-12 14:18:11 -07:00
Paul Berry 8600df906e [messages] Add SyntacticEntity.sourceRange getter.
This will allow diagnostic reporting code in the analyzer to be more
easily converted to the new literate diagnostic reporting API, because
it will make it possible to use `SourceRange` as the common
denominator for situations where the location where a diagnostic needs
to be reported might come from either a `SyntacticEntity` or a
`SourceRange`.

Change-Id: I6a6a6964f3ec2ea33e8900d93b5abe714c9e1dcc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-12-15 09:02:26 -08:00
Sam Rawlins 76c35b2f11 DAS: Rename constants in code_completion tool to use lowerCamelCase
Change-Id: I993d9386c63766471dd8d5ae7f1e63f3f9bf8ce3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/459844
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2025-11-07 11:32:56 -08:00
Sam Rawlins 33f664940a Bump DAS to use Dart SDK 3.9.0
Change-Id: I04bc285d822a657adb5573c6de3eb38655ab0fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448232
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-09-03 12:56:29 -07:00
Brian Wilkerson 587cbed231 Convert the completion metrics tool to use candidate suggestions
The tool was previously using the old implementation, which is now only
used by the Cider support. As a result, it wasn't providing valid timing
measurements for the new implementation. That's been fixed.

The map/reduce functionality is not yet supported, but it's also rarely
used. There's some information missing, but most of the functionality
works as expected, and I'd like to tackle the rest in a separate CL
(though I don't know exactly when I'll get to it).

Change-Id: I98150c1d5273a8ffaccf7858f9588e52e11636c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444183
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-08-07 09:03:20 -07:00
Konstantin Shcheglov 49599e06cc Elements. Deprecated element2.dart library.
Change-Id: I2be38df49e6f242d9fe59f34164549da4a0f41b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424683
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-25 11:23:18 -07:00
Sam Rawlins fbf331e0dd DAS: reformat source code with tall-style
Change-Id: I42b4a44fd6a2197e499e8623274b3cd1a4b5556f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394003
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-06 23:04:00 +00:00
Brian Wilkerson 83dc895d18 Migrate the remaining files in server's tools directory
Change-Id: I8388cde7fc9f7904324b41a3fff31cec88e42a6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390804
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-10-18 17:03:00 +00:00
Konstantin Shcheglov 5543d88289 AE. Deprecate OnClause, use MixinOnClause instead.
Change-Id: I938a1ff4046851c46c6ae4cebdff25e05e88300f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-02 23:02:22 +00:00
Konstantin Shcheglov c5f876b7aa Augment. Use ExtensionOnClause in ExtensionDeclaration, make it optional.
Change-Id: I696ffd0b8e8f3bf9017b583d480313ec7c7753f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-04-02 16:12:00 +00:00
Konstantin Shcheglov 94abcc81ab Completion. Use CompletionSuggestionBuilder in completion metrics, faster.
For sdk/pkg/analyzer_cli

Before: 0:01:32.542000
After:  0:00:33.254000

So, about 3 times faster.

Change-Id: I8eae44eeefd5624f88a42fe37b8ae1c29427ee49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356310
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-03-15 19:08:23 +00:00
pq 440ea59ee0 enable flutter_style_todos in server
Change-Id: I4921d538e1498e66c8cab2d84dfcad21d1a7b555
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335952
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-14 21:08:12 +00:00
Brian Wilkerson 4963955276 Finish converting the KeywordContributor
Change-Id: Ifa5100c6458f1a91f492223b261bcd53f23e847f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327560
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-09-25 22:07:56 +00:00
Danny Tuppeny ec0dc8fe55 [analysis_server] Handle annotations + default to new protocol for completion metrics tool
Change-Id: I57c8f077ccc853ae7ece44c776e16e0f30401a66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-09-13 17:47:35 +00:00
Konstantin Shcheglov ec330b47de Deprecate 'DartType.isDynamic', use 'is DynamicType' instead.
Change-Id: Ia3660a0d38f01a590dd3e034f40dbdb5a432638a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/300042
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-05-01 16:09:08 +00:00
Konstantin Shcheglov 4756d077ed Update NamedType to use ImportPrefixReference and name token.
Using Identifier expression inside NamedType does not make sense.

Change-Id: I4a61d2b472fd66fb7c5e6e92a80cccb391b06d49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-28 17:31:46 +00:00
Konstantin Shcheglov 40db70d5fd Deprecate 'Directive.keyword', use specific 'xyzKeyword'.
Change-Id: I66ab521df857de07343205aed6335e6d3566eafb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-07-07 19:55:21 +00:00
Sam Rawlins 7e95dc1335 completion_metrics: add a 'prefix-length' option
This option allows the completion position to be an offset from the
start of each token, and plays well in each overlay mode. For the
original content:

```dart
void main() {
  foo();
}
```

In OVERLAY_NONE mode, completing on `main`, with `--prefix-length=2`,
we complete at:

```dart
void main() {
       ^
  foo();
}
```

In OVERLAY_REMOVE_TOKEN mode, completing on `main`, with
`--prefix-length=2`, we complete at:

```dart
void ma() {
       ^
  foo();
}

In OVERLAY_REMOVE_REST_OF_FILE mode, completing on `main`, with
`--prefix-length=2`, we complete at:

```dart
void ma
       ^
```

Change-Id: Id2493777cb38f147f7a2c401a9e53e17561516bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241982
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-04-21 21:05:01 +00:00
Konstantin Shcheglov 60b428e2b1 Deprecate superclass2, mixinTypes2, etc.
Change-Id: Ieaaeab57930cb93f5b6b1323efe63c3395b79993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232742
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-17 02:20:42 +00:00
Konstantin Shcheglov e1b5db7478 Deprecate getters that return TypeName, replace with returning NamedType.
Change-Id: I13764db3da27d5eabe972aab32cdf587a7de53e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214220
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-22 21:01:58 +00:00
Brian Wilkerson 804109b3c6 Add documentation to completion metrics and clean up a bit of code
Change-Id: I612b5f5953bc0f8d94ad9976e55590097389c62e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-08-23 18:26:57 +00:00
Brian Wilkerson 1a7895f56f Fix metrics for built-in identifiers outside directives
Change-Id: I285199b8dd168215a1a41de9de77a83ddfa57d10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203665
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-06-15 00:40:59 +00:00
Brian Wilkerson 7acd2e7635 Improve metrics tool to group failures
This causes completion failures to be split into two groups: those for
which there was no suggestion and those for which the name was suggested
but the wrong element was selected (as in the case where the correct
element shadows the one that was suggested.

In addition, the both groups of failures are now further grouped by the
location in which they occur.

Finally, failures to complete in hide and show combinators are temporarily
ignored until we can figure out how to complete as if the target identifier
wasn't already in the list.

Change-Id: I1515ad5a8862132b1b77287af45a638649cef7a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203082
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-06-09 22:35:19 +00:00
Brian Wilkerson d08c65be05 Migrate the completion metrics tool
Change-Id: I6d66ebd2d5cbb32147252927819f9d6533cb4012
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194882
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-10 04:15:23 +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 4643444205 Add map/reduce functionality to the completion metrics tool
Change-Id: I69d206fa7d817b022eedac01a13355a14a09a650
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188002
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-02-26 20:45:17 +00:00
Brian Wilkerson b23be6b8ee Update the completion metrics measurement tool
Change-Id: I8e67d138e60e0e226cef87e9efd35088526dec72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-01-26 23:54:15 +00:00
Brian Wilkerson 8fee2b96af Rename the tool/completion_metrics directory
The directory contains tools related to code completion that are not
used to measure completion metrics, so the old name was too specific.

Change-Id: Ie8745901655df6e7b29da645b3b0a48011ca9f10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174483
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-11-30 23:57:44 +00:00