Commit Graph

24 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
Danny Tuppeny 24bc4f1ed2 [analysis_server] Update recorded scenarios to match new normalized log format
The previous CL changes from just replacing paths, to handling URIs + filePaths separately.

This updates the committed scenario files so:

`file://{{workspaceFolder-0}}` becomes just `{{workspaceFolder-0}}` (since this token implies the file URI), and `{{workspaceFolder-0}}` (without the prefix) becomes `{{workspaceFolder-0:filePath}}` (to signify it was a file path).

Even with these changes, they fail for different reasons (invalid git hashes, mismatches in expected vs actual requests) so I there is still more work to do here.

Change-Id: Ic1543ab96ca002073540ef034adecb4c9ea57e58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-05-07 11:49:53 -07:00
Danny Tuppeny 11b1da577f [analysis_server] Handle URIs/filePaths separately in log normalization/replay
For posix paths, replacing the file path during normalization and then swapping it back later works for both paths and URIs, because a file URI just contains the file path verbatim:

file:///foo/bar/baz

However that's not the case for Windows:

C:\foo\bar\baz
file:///c:/foo/bar/baz

So when normalizing, we need to know if we normalized a URI or a file path, so that we can reverse it later.

With this change, we'll use `{{workspaceFolder-0}}` for the URI, and `{{workspaceFolder-0:filePath}}` for the file path. Then when reversing, we can easily put the correct one back.

This also updates the log replace/scenarios to use the LogNormalizer to perform the denormalization so they don't have to have duplicated logic about what to restore.

I've also updated the existing committed scenarios (EDIT: moved this to a separate CL because Gerrit is falling over) - although even with those changes, they all fail for different reasons (invalid git hashes, mismatches in expected vs actual requests) so I think there is still more work to do here.

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

Change-Id: Ib4c4aabe2c7c0d089bd620bdf00de37acde25f52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501600
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-07 10:03:24 -07:00
Danny Tuppeny 8d983debe0 [analysis_server] Update call hierarchy for factory keyword
+ fix some typos

Change-Id: Ic4f05cc57130657445f3c2f5312998d018f56a8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483540
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-02-25 08:59:41 -08:00
Keerti Parthasarathy c284947183 Look at root when running pub in project generator.
Not doing this was giving analysis errors at startup.

Also included a log for the test case on flutter/packages/pigeon. Had to trim it a lot, the actual session log was 13 MB.

Change-Id: I69c0e6111ea01fc21e4acd7751d91db78b513896
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Keerti Parthasarathy <keertip@google.com>
2026-02-20 07:04:19 -08:00
Keerti Parthasarathy 89859e5fa7 Keep track of all congiguration messages
Change-Id: I4c546fc13d10adf969a3903b42ea863f0e0cf875
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481181
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-02-17 13:48:42 -08:00
Keerti Parthasarathy ead50eae61 Add a scenario/log with multiple contexts
Change-Id: I515cd736461e099a9af2e6c89354204d508700d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/479340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-02-10 14:20:09 -08:00
Jake Macdonald dea5b5c3aa Support initializing projects with multiple package configs, as well as
flutter projects more broadly.

Also added some TODOs for future work that needs to happen.

Change-Id: Iffad6f30f2df6a8e76a1aa179c2711105207470a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476880
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2026-01-30 12:43:38 -08:00
Cory R e76c7d64cd Fixing path issue on windows, adding new scenario for testing (also fixing formatting issue).
Change-Id: I2557542b76aaf1a7a50ec7ae1e7ecc59771cb910
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475125
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2026-01-22 12:05:41 -08:00
Jake Macdonald 5b501e97a3 add readme for recording and creating scenarios
Change-Id: Id37f157896dfec9c7741e0a0079878c5287d9349
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/473560
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-01-15 16:03:28 -08:00
Jake Macdonald ba183805c9 Small improvements/fixes for analysis server scenario replay
- Return messages that fail to parse with the error response.
- Add support for open subdirs to projects, speeds up SDK replays.
- Fix up normalize script when package deps are subdirs of the project.
- Re-record the sdk scenario with only pkgs/analysis_server open.
- Fix some bad hard coded responses that were failing to parse.
- Add extra context (extra messages recieved) when scenarios fail.

Change-Id: Idfdcde70776967c2d419e76a21a6c6d1c59902f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2026-01-13 13:51:26 -08:00
Jake Macdonald 4066e5b64c Get a working public github repo scenario.
- Adds support for normalizing package dependency roots using the
  package config
- Updates the project generator so it can handle multiple project roots
  and analysis contexts, as well as package configs.
- Handle sending watcher messages to the analyzer.

Removes the basic "initialization" scenario that didn't have any real
value other than being an example github project scenario.

Change-Id: I5b49effe524d325360a754296f4cc3578ad49527
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471360
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-01-07 15:26:12 -08:00
Jake Macdonald 1a0371034b Additional fixes for scenario replays
- Skip notifications from analyzer
- Hard code responses to certain startup logs if they are unexpected
- Use cli_util to show loading spinner and get sdk location
- Update normalize to substitute the sdk location
- Make id field optional on message (notifications don't have ids)

Change-Id: Ia5276eef554a3afefeae227fa7351f902d21131e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471060
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-01-06 13:34:56 -08:00
Jake Macdonald c2dc8f62a3 Add current directory project generator
This makes iterating on things faster, with the downside of requiring a clean git tree
to avoid bashing over pending changes.

Change-Id: I5725c288f6f4f4665e9cd8cc8d91cb77d214df2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2026-01-05 09:08:53 -08:00
Jake Macdonald db06bb7f13 Initialize SDK and regular projects on creation
Runs either `dart pub get` or `gclient sync`, based on project type.

For the SDK, copies the .gclient and .gclient_entries files as well
into the parent dir.

Also adds a `--timeout` argument, controls how long to wait for analyzer messages.

Change-Id: Id2c28e6d0251e94914bb0650be104c1f90a66651
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2025-12-16 12:30:25 -08:00
Jake Macdonald 42e7de8f6c add the ability to run a single scenario, fix results getter
Change-Id: I74e0e0ddb20a2182d4dc4f5e37ffb6c1925ee4f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468360
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-12-15 13:51:30 -08:00
Jake Macdonald dadbd93260 change the log file format to be newline separated objects
Change-Id: I2257b2af5e28ac50b47b9a6cfe688abb7c9e8ac1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/466401
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2025-12-09 14:51:16 -08:00
Jake Macdonald 307948681c match up actual analysis server request ids
Change-Id: I20b67c18c6d531cd378c27cc3b73a1bbf3e6908a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/466260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2025-12-08 10:48:45 -08:00
Jake Macdonald d58a6ee53c Start on a log normalization tool
For now this just takes the workspace root and replaces all occurrences of it with {{workspaceRoot}}.

Change-Id: I14af057ddd4e20f002499670effb6f9e7101fce6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2025-12-02 13:47:26 -08:00
Brian Wilkerson 7bbf6f9a7a Add the ability to generate export directives
This was used to test the timing of export cycles.

Change-Id: Ib7ddb6b46639f196e8db30039d25e64e8dc5f662
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464462
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2025-11-26 07:29:09 -08:00
Jake Macdonald 4c7f0c1f41 Add some real scenario logs and get them running successfully.
- Move analysis server startup into log_player.dart, parse the protocol
  from the arguments.
- Add {{workspaceRoot}} and {{dartSdk}} root placeholder support to log
  files.
- Create logs of a real sdk scenario (rename the analysis server class),
  anonymize the logs using the placeholders.

Future work:

- We should add support for mutating a log to put in these placeholders.
- Figure out how we want to support package dependencies in a similar way.
- Implement the matching for server responses so the scenarios don't just complete early.

Change-Id: Ic0f6ac9c26da9d0a4473d08709aa05e9ff1e8536
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/462620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2025-11-18 10:11:36 -08:00
Jake Macdonald 5436fcde7d add analysis server scenarios, project generators, and a simple runner script
Currently supports a "git worktree" mode for running on local directories, as well as a "git clone" mode for cloning remote directories.

You can execute the script, but it will fail when it gets to replaying the logs due to the empty Json file, but this is a good start.

I think the next step here is to have some way of normalizing the logs so they are portable across machines/directories.

Change-Id: I8de5defe81c76f18c3bf3220e2a517a4247d4641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/462260
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-11-17 09:01:58 -08:00
Konstantin Shcheglov e0d12a8d00 Fine. Use 'withFineDependencies: true' in analysis_server/.
Change-Id: I13fb9e2e8dfaca2e6eeca286e415c6df4bc10094
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/462240
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-11-14 15:07:31 -08:00
Brian Wilkerson 5f2c686c27 Add utilities useful for profiling
These are some simple utilities I wrote in order to do some performance
profiling. They aren't very polished, but hopefully they'll be a good
starting point for other work in this area.

Change-Id: I05dfddd3e51986f2b65cdb5726b349be743f017b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/454400
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-10-10 09:50:30 -07:00