Commit graph

395 commits

Author SHA1 Message Date
Chingjun Lau 0024349fb3 Avoid unnecessary calls to isExternalPackageLibrary and resolveUrisToPackageLibPaths.
Only try to resolve the uri when `debugExternalPackageLibraries` is
false, which is when it is actually needed.

Change-Id: I5aade6214657eccbdb5e294a8bfb5e2968aa6b3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349631
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Auto-Submit: Chingjun Lau <chingjun@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-02 20:40:59 +00:00
Tim Maffett cc309f25d5 change 'appsize' url to correct 'app-size' - Fixes #54724
Closes https://github.com/dart-lang/sdk/pull/54725

GitOrigin-RevId: a5b77575f45296e08707e3eca9701a5916419aa1
Change-Id: I6748c19578797443b83ef78fc9ca8d348066a131
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348187
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-29 14:23:28 +00:00
Ben Konyi d48a76e988 [ DDS ] Migrate DDS specific tests from service/ and update package:dds_service_extensions to 1.7.0
TEST=migrated tests

Change-Id: Id77f46c7e348614f707fc4d50d8a3101120b48ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347941
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-26 22:45:14 +00:00
Oleh Prypin 0da8f7a7b4 Remove unnecessary imports of 'package:collection' IterableExtension
* Replace `.whereNotNull()` with `.nonNulls` which is now in Dart core.
* `.firstOrNull`, `.lastOrNull`, `.singleOrNull` and `.elementAtOrNull(i)` are also in Dart core and even under the same name, so simply drop the import of 'package:collection' whenever possible.

Bug: b/322159291
Change-Id: I81eb93426680dc78a608bbcc714eb26c0eca5c62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348260
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Oleh Prypin <oprypin@google.com>
2024-01-25 11:07:28 +00:00
Danny Tuppeny 728e8fdd0c [dds/dap] Fix flaky detach test
This test is to check the output contains "Detached" but didn't account for "Hello" appearing based on timing (during detach, we resume the isolate and depending on timing, we may or may not get the OutputEvent for the `print` in the test application).

This change switches from `emits` to `emitsThrough` so that the "Hello" event is ignored rather than a failure.

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

Change-Id: Ie624ba06e9f70dcbc887b2c280a3d2eb19dee29c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348162
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-24 20:38:59 +00:00
Danny Tuppeny 2b1d407ea6 [dds/dap] Use pause-on-exit for attach tests
This should prevent the app from terminating but the debug adapter gets the output events via the stdout stream.

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

Also updated the expected output based on the fix for https://github.com/dart-lang/sdk/issues/54582.

Change-Id: Iec878132e407956d427826f466e3e3fc60d041f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347660
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-01-23 18:10:56 +00:00
Danny Tuppeny a95b584101 [dds][dap] Fix global evaluation inside package: files
The initial global evaluation support only worked when the open script was loaded into the VM as a `file:///` URI (eg. things in a `bin/` folder, and not a `lib/` folder). This is because we short-cut resolving file paths to `package:` URIs for most VM functionality (for example setting breakpoints) because it's unnecessary (the VM supports setting breakpoints with file:/// URIs even for `lib/`).

This change forces us to resolve paths to their resolved URIs (eg. `package:` where applicable) in the case where we're looking up a script for global evaluation.

We could enable this lookup for all cases (to remove the additional `force` flag here), but since it's called much more from the other path (breakpoints) we should add caching (which was more than I wanted to change for this fix).

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

Change-Id: I57a99ec3b7c726d9d120e6cda7d0b938fec397bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346400
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-23 16:38:32 +00:00
Ben Konyi 8db4393f1e [ CLI ] Start DDS instance if VM service URI passed to dart devtools doesn't have a DDS connection
This is can happen if a Dart or Flutter application is started in a
non-standard way (e.g., not through the `dart` or `flutter` CLI
tooling). Developers using custom embedders need to use `dart devtools`
to start a DevTools instance, so it's a good opportunity to check for a
DDS instance and launch DDS for the target application if one isn't
found.

Change-Id: I817ca0951c7839e8e9a0d1c78756caa45381cea1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346820
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-18 16:28:37 +00:00
Alexander Thomas e609c8232b [dds] Remove copy of dap tool
Cq-Include-Trybots: luci.dart.try:flutter-linux-try,flutter-web-try
Bug: b/286184681
Change-Id: I408d36a10dde43e3e182d57685f7d8423124461b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344021
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2024-01-09 10:45:30 +00:00
Ben Konyi 527cc7df50 [ DDS ] Reland 3.1.2 pubspec and CHANGELOG after 3.1.0+1 hotfix release
Change-Id: I2e451d3300c0c6a67f5559de4f361ffe54ea8f9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344761
Commit-Queue: Christopher Fujino <fujino@google.com>
Reviewed-by: Christopher Fujino <fujino@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-01-04 19:31:04 +00:00
Ben Konyi 5362a20f27 [ DDS ] Create 3.1.0+1 patch release
Reverts vm_service major version bump (13 -> 14) from 3.1.1, but is
otherwise identical to 3.1.2.

Change-Id: I9e6595a4a4565586284d7ab4601fd9e49711d87d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344760
Reviewed-by: Christopher Fujino <fujino@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-04 18:39:29 +00:00
Danny Tuppeny 0a2c58e51c [dds/dap] Add missing awaits when resuming
These were lost in 35b560e289 and could result in an unhandled error when there's a race during shutdown if a request had been trying to resume an isolate.

Fixes https://github.com/flutter/flutter/issues/139181

Change-Id: Ie683f5afa801e8d05e15d93a0e2008cd0f74fe5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344521
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-03 20:48:29 +00:00
Danny Tuppeny cd7bf37c1b [dds/dap] Don't throw errors for StackTrace requests on exited Isolates
I noticed a race while running from source today.. If you run a Dart CLI app we add --pause-isolates-on-exit to allow sending async output events before exiting, then we resume.

The stopped event is still propagated to the client (since there can be a delay between the stop and the resume while we wait for output events) and the client may ask for a StackTrace. If this arrives just after we resume the isolate, we would generate an error that could be shown to the user.

This adds a check that the thread ID is really invalid before throwing an error, and if it's valid (eg. it belongs to an earlier isolate) we just return an empty stack trace instead of an error.

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

Change-Id: I0a3241ffd634acea49b4d1dc7b3cd6b6b1c8d2d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342585
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-03 20:48:29 +00:00
Danny Tuppeny 793755f2c1 [dds/dap] Don't show stack traces in error messages from DAP
We accidentally started showing the stack traces in all errors rendered in VS Code. This changes the format of the message to not include the stack - although it keeps it in the payload to aid debugging when capturing logs.

It also slightly tweaks the error message for global eval to be less cryptic for VS Code.

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

Change-Id: Id4a0c4e6ef26065059e3becec62bab5d873e7be3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342621
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-01-03 20:48:29 +00:00
Elliott Brooks af8d70367d [DAP] Catch any errors for getObject when requesting getters for a class
Bug: https://github.com/dart-lang/webdev/issues/2297
Change-Id: Id7234e7dd758e16ea05fb4b4ccab1593f3ca5ea8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342704
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
2024-01-03 19:43:42 +00:00
Danny Tuppeny 821bdb6535 [dds/dap] Improve the error message when lookupResolvedPackageUris returns an invalid response
+ add a failing test for https://github.com/dart-lang/sdk/issues/52632 / https://github.com/flutter/flutter/issues/137163

This does not resolve the issue, it only makes it clearer from the error message what the problem is. Unfortunately there is no good workaround when we hit this bug because we can't tell which items in the response are valid/invalid. If we treat them all as invalid (eg. complete all of the completes with null), many things that involve mappings of URIs<->files won't work correctly (breakpoints, opening the right file when we break, etc.).

A workaround is for users not to have commas in their filenames, although it's not clear if there may be other characters triggering this right now.

Change-Id: I6ac7cbd82b726fac76c27d1e00a06f2a07d4757f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342800
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-02 21:09:23 +00:00
Kenzie Schmoll c680feedaf Improve error handling for serving static DevTools assets.
Change-Id: I2b62461a64ef6aa8b544b4ace894d7b5ded0912e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343000
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-12-20 21:07:39 +00:00
Chingjun Lau 846b23f3ca Use the provided UriConverter to resolve uri in DAP isolate manager.
Change-Id: I1a708417bdb923823a581a9cdc158b0c35b02cd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342484
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
Auto-Submit: Chingjun Lau <chingjun@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2023-12-20 16:32:38 +00:00
Kenzie Schmoll a86eb8bd11 Bump devtools_shared dependency to ^6.0.3
Change-Id: I611457fec4032e06cb5456020e884530e42f0b78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342720
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2023-12-19 21:27:33 +00:00
Dan Chevalier e58efcb049 Connecting DTD and DTD_impl together.
This change adds the happy path for DTD_impl and DTD being able to:
- register streams
- register serviceMethods
- postEvents to streams
- call serviceMethods

Change-Id: I73865071745ef19a4493f86714e0855930243dd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341700
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2023-12-19 15:36:22 +00:00
Derek Xu 53be2cb558 [package:dds] Prepare to publish version 3.1.1
Change-Id: I56132705e10657a3210f9b9938744fb2ce3e8bbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341502
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-12-15 15:32:18 +00:00
Chingjun Lau b08ab6541a Always specify showUser: true when responding an error message in DAP.
The DAP spec[1] does not specify what should happen when showUser is not
specified, and VSCode chooses to default it to true[2][3].

This is inconsistent with some other tools which uses false as the
default value[4].

Always pass `showTrue: true` to make it consistent in different systems
that use DAP, and be compatible with VSCode.

[1]: https://microsoft.github.io/debug-adapter-protocol/specification#message
[2]: https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/debug/browser/debugService.ts#L631
[3]: https://github.com/microsoft/vscode/issues/128484
[4]: https://github.com/google/go-dap/issues/87

Change-Id: I8e0147044060dfdbb23c69029ca9708d578844bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339741
Commit-Queue: Helin Shiah <helinx@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-12-07 05:19:39 +00:00
Danny Tuppeny 5fde2e1534 [dds/devtools_server] Add support for finding VS Code extensions defined in packages
See https://github.com/Dart-Code/Dart-Code/issues/4705

Change-Id: I724c039cd6940dd5939330a6f91f38567db9a179
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337781
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-12-06 20:56:11 +00:00
Lasse R.H. Nielsen 5543293a16 Reland "Expire 3.0.0 experiment flags."
This is a reland of commit 6f29e7fce4

Original change's description:
> Expire 3.0.0 experiment flags.
>
> TEST=Existing tests covers.
> Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

TEST=Existing tests covers.
Change-Id: I384e77744c74774a250be413358a7fa176117167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332684
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-11-17 13:10:01 +00:00
Danny Tuppeny c74ea634cb [dds/devtools] Prevent DevTools server reusing clients that aren't fully initialized
It's only valid to reuse a client that is not showing an embedded page, however we only get the embedded flag when a client sends a "currentPage" event.

There is a period between a client connecting and sending this event where we would consider it reusable when it's not. This fixes that by keeping a flag to indicate if a client has completed initializing (that is, it has sent its initial page).

See https://github.com/Dart-Code/Dart-Code/issues/4832

Change-Id: I9f2d43d1537ee97e4e231a844831e7548cf07beb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336041
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-11-14 20:47:43 +00:00
Devon Carew 6917656134 [pkg] remove duplicate config from the analysis options files
Change-Id: I149a97bbe260600a3de664b28c4d212dd9adb889
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335862
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-11-14 00:37:53 +00:00
asiva 4e3b28368a [DDS] - Adjust expectation of dds test.
Should fix https://github.com/dart-lang/sdk/issues/53954

TEST=ci

Change-Id: I959db84add2ec3a014c04df78ed78b8a210ce77d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334002
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-11-06 22:59:24 +00:00
Ben Konyi 9b17a1b703 [ package:dds ] Prepare for 3.1.0 release
Change-Id: Ie1d19e45ae60ed5ced0a49a3b9b04848ffe661a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332183
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2023-11-06 18:50:51 +00:00
Danny Tuppeny 8a5e6d135f [dds/dap] Always expect uppercase drive letters from DAP
Some of these tests failed if `Directory.systemTemp` had a lowercase drive letter because DAP always normalises outbound paths to uppercase and we were comparing them directly.

This updates offending tests to compare with uppercase drive letters as is expected, regardless of the original temp directory (used for "cwd" and "program").

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

Change-Id: Ibaa6b6ecfe3d77aeff5b806174167c9452167db6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334160
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-11-06 17:59:48 +00:00
Alexander Aprelev 6a464c9dee Revert "Expire 3.0.0 experiment flags."
This reverts commit 6f29e7fce4.

Reason for revert: broke g3 bot

Original change's description:
> Expire 3.0.0 experiment flags.
>
> TEST=Existing tests covers.
> Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Change-Id: Ied6f612dc922824ffdadc4660898f3b859922ff5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332582
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-10-27 16:50:09 +00:00
Lasse R.H. Nielsen 6f29e7fce4 Expire 3.0.0 experiment flags.
TEST=Existing tests covers.
Change-Id: I161eefdc28c74f63ba1ee926800a01eea03d9930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331960
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-10-27 13:57:00 +00:00
Danny Tuppeny 5e255e0110 [dds/dap] Switch to using isGetter isntead of checking _kind
Both VM and DWDS populate isGetter now so we don't need to check this internal field.

There are existing tests verifying this behaviour.

Change-Id: Ia0f0d74167c718ec66a692523c1f255d63eed654
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330784
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-10-24 17:39:36 +00:00
Danny Tuppeny c5f60241a8 [dds/dap] Don't provide DAP sourceReferences for non-existing scripts
This adds a check that scripts exist before we create a sourceReference to assume we can download them.

I don't have a good way to test this (in the Dart SDK) because this never happens for Dart - we can always download the scripts. However this code is triggered in Flutter because of https://github.com/flutter/flutter/issues/128880 - we can't find the source so we will try to set it up for downloading.

Fixing that would avoid the need for this change (and make the behaviour more consistent with Dart), but in the meantime I think it's better that we don't produce sourceReferences for sources that don't exist.

Change-Id: I4de3f6e87fe3ff867a1ff7e6d3a5d79f7bf9fa1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330780
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-10-24 17:35:42 +00:00
Kenzie Schmoll 549c1eea11 Roll DevTools into SDK and bump to devtools_shared 5.0.0
Change-Id: I9c38d6be70816de14bb6b9818e6aa550b11c1a34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331748
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-10-24 17:09:20 +00:00
Ben Konyi 51dde069b2 [ package:dds ] Prepare for 3.0.0 release
- Fixes typo in CHANGELOG.md
- Reverts vm_service version bump to ^12.0.0 as it's not needed for this
  breaking change

Change-Id: Ib9251dac0af4958d72fcb341490643bfe0f7a21a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331800
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-10-23 19:38:33 +00:00
Ben Konyi 08b4f49249 Split package:vm_service into package:vm_service and package:vm_service_interface
To reduce the headache associated with adding parameters to VM service
APIs, VmServiceInterface has been removed from package:vm_service and
pulled into its own dedicated package:vm_service_interface. This will
help reduce the need for major version bumps of package:vm_service,
which requires manual version bumps through >8 packages in order to make
the latest version available to flutter_tools and DevTools.

This separation of the VmService client from the interface will reduce
the frequency of major version bumps to `package:vm_service` as adding
optional parameters to existing APIs would cause implementers of the
interface to break.

package:vm_service continues to expose a copy of the contents of package:vm_service_interface to avoid breaking google3 rolls until package:dwds can migrate to package:vm_service_interface. package:vm_service will not be published until this copy is removed.

This change also includes:
 - some code cleanup and modernization to both the code generator and
   generated code
 - >=3.0.0 SDK version requirement to allow for new language features

Change-Id: Ib1859c1b4e153fef7ee1f91e67e881bbf42652c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330500
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-10-23 17:00:10 +00:00
Danny Tuppeny 59294606cf [dds/dap] Expand truncated strings and suppress quotes when copying to clipboard + using repl
Normally in the debugger we return truncated values, but there are some cases where the user expects the full value. The legacy DAP handled these, but the new DAP did not.

With this change:

- "Copy Value" (context: clipboard) actions will always copy the full string (and without quotes)
- the REPL/Debug Console will include the full untruncated string

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

Change-Id: I6e43f8e21ca606d4ea1e9f1c30a111d7a4d82f20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326642
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-10-18 17:34:59 +00:00
Danny Tuppeny b706bfcd1f [dds/dap] Don't require a VM Service connection to map file:// URIs in stack traces
We only need a VM Service / thread to map dart/package URIs. We should always map file:// URIs.

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

Change-Id: I19c1fdeae9c9ef66e276121bba22504e8bc9d094
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330140
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-10-12 17:45:26 +00:00
Danny Tuppeny a949bbf145 [dds/dap] Fix evaluation of lists containing nulls
The `elements` field of a list can contain `null`s if the list contains nulls (not a Response that represents a null) so this needs to be handled.

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

Change-Id: I3f135b802919da610827b2a80236c8d4830c4228
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330280
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-10-12 16:50:50 +00:00
Jens Johansen 73466729f3 [vm] Pass offset and script uri for expression compilation
This CL passes the offset and uri of the file (here called a script uri
as opposed to a library uri, the two will be different if we're in a
part) when doing expression compilation.

This CL only passes the data, but doesn't actually use it.
Future CL(s) will use this data to calculate the static type of
available variables which is needed for an upcomming feature.

TEST=Existing tests.
CoreLibraryReviewExempt: Not changing SDK APIs.
Change-Id: I67ead461ab4bb9341424e693946f3e4afe35ce92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329322
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-10-12 10:22:38 +00:00
Ben Konyi ebd669a0d4 Update package:dds and package:dds_service_extensions to vm_service
^12.0.0

Change-Id: I4430112a027c281b87c4360de419110c5e10c453
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329180
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-10-02 17:51:35 +00:00
Danny Tuppeny 35b560e289 [dds/dap] Add support for "restart frame"
Fixes https://github.com/Dart-Code/Dart-Code/issues/4359

Change-Id: I92d5a13313b97c6bb911d2ef68cf396730272091
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324281
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-10-02 15:45:07 +00:00
Devon Carew 3b0b1bd863 Bump package:lints to the latest; address instances of new lints.
Changes:
```
> git log --format="%C(auto) %h %s" 8d5f750..b044aca
 https://dart.googlesource.com/lints.git/+/b044aca add several rules to core and recommended (150)
 https://dart.googlesource.com/lints.git/+/81100a2 fix a dangling table link (146)
```

Diff: https://dart.googlesource.com/lints.git/+/8d5f7500024320654adb1e799e49fc10c5304ae7..b044acab9f6669b3d8e781923a8ff86877801177/
Change-Id: I031333ade99af700a7009b14a36d3aadba12fc94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327321
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-09-25 21:15:15 +00:00
Danny Tuppeny a780653606 [dds/dap] Use function locations if frame has no location itself
Some functions when debugging tests have tokenPos=-1 which results in the debugger jumping to the top of the file. If the function has a location, this seems to be more appropriate to use.

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

Change-Id: I7a800de4f9ce94deb5d35919cab658dee881d439
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324522
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2023-09-22 21:33:39 +00:00
Kenzie Schmoll 0054a68cc3 Update DevTools rev to 2a1d1975d7ad8773a3e2590d10636432775f23a1
Change-Id: I5072fe1be9255f2eacda45db93dcc639ddfd8e42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326804
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-09-19 18:17:22 +00:00
Kenzie Schmoll 83b27b8bcf Add a retry to the DevTools handler for static files
Change-Id: Iced8093f894afd5574e3ae898e07f237e02002bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325323
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-09-12 18:52:01 +00:00
Kenzie Schmoll 2ed87ffb02 Update DevTools rev to adfb08c95c626248b28cc60df3b085c12ad8758e
Change-Id: Ieda1de59dec0ba68b01ec0893c43c6c4015fe58e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324770
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-09-08 18:32:51 +00:00
Sam Rawlins e6ac464ff0 Avoid passing a nullable value to Completer<nn-type>.completer.
This is cleanup work required to start enforcing this with static analysis, as
per https://github.com/dart-lang/sdk/issues/53253.

Real quick this issue is that this code is unsafe:

```dart
void f(Completer<int> c, int? i) {
  Future<int>.value(i); // Ouch!
  c.complete(i);        // Ouch!
}
```

Change-Id: Ia4d83719c425601b24e8ae6e305c88c95cba8b20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324640
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2023-09-07 21:48:26 +00:00
Polina Cherkasova eaf4c2c6eb Bump DevTools DEP to 2.27.0 and devtools_shared to ^3.0.1
Change-Id: I389800b160d6edfe89a7bda45963ff10a96c9e8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323302
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Polina Cherkasova <polinach@google.com>
2023-08-30 16:35:40 +00:00
Alexander Thomas d12904f278 [dds] Fix sse_smoke_test on Windows
Cq-Include-Trybots: luci.dart.try:pkg-win-release-try
Change-Id: I8993ee16a23bfbaeffaf48f6ef5906a4e90f11fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322703
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-08-30 14:13:37 +00:00