Commit Graph

50728 Commits

Author SHA1 Message Date
Danny Tuppeny 25bd38bbe2 [dds/dap] Enable verbose logging for debug_test
I'm struggling to reproduce the flakes noted in https://github.com/dart-lang/sdk/issues/60187 so hopefully verbose logs will help understand what's wrong.

Change-Id: Id76b30b4efc9fb63cfacd01d2df6dc5a8ea4c7eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411681
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2025-02-24 09:19:29 -08:00
Konstantin Shcheglov 617e0e1815 Elements. Migrate ResolverVisitor.
Use the return type of the method element, not a fragment, as a result
report BODY_MIGHT_COMPLETE_NORMALLY in invalid fragments.

Change-Id: I5a07fcc21695695cf9aeacaf6d35949c69b4c817
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411480
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-24 08:54:20 -08:00
Konstantin Shcheglov d070ea7181 Elements. Fix a TypeImpl cast in BinaryExpressionResolver.
Change-Id: I2618b45d89aec3962afef17a5db9c7e387bd56d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411500
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-24 08:32:34 -08:00
Konstantin Shcheglov efd357fdff Elements. Return XyzImpl from 'declaration'.
Change-Id: I29ae5383aa583f18d31eabb827e6b1aedd43b430
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411520
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-02-24 07:35:09 -08:00
Paul Berry 62dd31e8af [analyzer] Allow developer experience team to approve message-only CLs.
Change-Id: Icb52e0f35f92ff36734917a4693fffe5e811e8e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-02-24 06:08:05 -08:00
Jens Johansen 7d954e54f7 [CFE] Weekly leak tester should accept first compile too
This should fix the leak found by the weekly bot.
https://dart-review.googlesource.com/c/sdk/+/411580 should fix the leak
too, but we really should always have run accept here.

Change-Id: I223e03e3ddf90b0c8f08e77da17000ecec60f173
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411601
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-02-24 06:00:19 -08:00
Vyacheslav Egorov 9475d56e17 [infra] Support Mac in pkg/dart2wasm/tool/run_benchmark
R=kustermann@google.com

Change-Id: I4f0604468402437a3361269a244f9b32dd8969f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411302
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2025-02-24 02:12:01 -08:00
Jens Johansen 7a672b40f4 [analyzer] Sort input for analysis_options signature calculation
This, too, would have fixed the issue fixed in
https://dart-review.googlesource.com/c/sdk/+/410700.

This CL furthermore means that changing the order of the "analyzer:
errors:" entries (or "plugins:" entries) doesn't change the signature.

Change-Id: I6439f985260545dfc2c7e0a75b353b5324ef8f88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411040
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-02-24 00:58:48 -08:00
Jens Johansen 3df3d4fab4 [analyzer] Remove unnecessary line in test file introduced in cl/410700
Follow up to https://dart-review.googlesource.com/c/sdk/+/410700

Change-Id: Ia284b95615bf001950b1755c81d001b0df6490f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411241
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-02-24 00:23:59 -08:00
Chloe Stefantsova a004960960 [analyzer] Add occurrences tests for null-aware elements
Part of https://github.com/dart-lang/sdk/issues/56989

Change-Id: Ic6e48f1579b60a59ddb17c08202232081cbd3bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411243
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-02-23 23:09:40 -08:00
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
pq 2227249c2b [PE] [linter] don’t report require_trailing_commas if language >=3.7
Fixes: https://github.com/dart-lang/sdk/issues/60119

Change-Id: If4821300dcae05cd1283558a87481d2bad7dae9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411182
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-21 14:09:47 -08:00
Konstantin Shcheglov 3a8ff1083e Elements. Migrate LabelScope.
Change-Id: I9891142ba33ea4d5bca1842ab8414dd89b4142eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-21 14:01:40 -08:00
Konstantin Shcheglov c604aa2e77 Elements. Migrate PatternVariableDeclarationImpl.elements
Change-Id: I0b7cafe4d1def187bbebdb6d694fab56a9d24a7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411441
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-21 13:54:21 -08:00
Frankdroid7 3c792ec8d0 Modify error message for const (ASSIGNMENT_TO_CONST)
Closes https://github.com/dart-lang/sdk/pull/56953

GitOrigin-RevId: 5452a16747b9c536ae8dfe6d4a9f6a195d53e3d2
Change-Id: Icc1811b39a10cd0fe5b9155c52ef4f133cfc7f14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391489
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-02-21 13:16:59 -08:00
Brian Wilkerson 115dcc9609 [migration] constant/value.dart
Change-Id: Id1ed8bd41b8efb34124ddda93f1039215caf0651
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411362
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-21 12:48:48 -08:00
Konstantin Shcheglov b4194ea6fb Elements. Migrate InvocationInferrer.
Change-Id: I55fc394c06669e7d8c0d1ffb1449dd73aa6b4bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411363
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-21 11:54:08 -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
Moritz c4c805da60 [native assets] Single SoT for package name on Dart build
Do not use the folder name as a proxy for the package name.

Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Change-Id: I17664ea88a4e317d994d93ae84a5584078e5f94d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410360
Commit-Queue: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Moritz Sümmermann <mosum@google.com>
2025-02-21 08:30:28 -08:00
Konstantin Shcheglov 1c8007dbcd Elements. Migrate BlockScope.
Change-Id: I5f536b2622ce1a2a300e383c88487bdb527a8b8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411088
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-21 08:09:39 -08:00
Konstantin Shcheglov 0b10797968 Elements. Migrate TypeSystemImpl.
Change-Id: Ib76d1de117b717ee434177bc85851d8c05a3f54a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-21 08:08:50 -08:00
FMorschel bbb4a1b4e7 [DAS] Adds base tests for auto-complete on dart docs
R=srawlins@google.com

Bug: https://github.com/dart-lang/sdk/issues/59724
Change-Id: Ia2345c77371a58ad0be402daa93642a3f0e53dc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410461
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-02-21 07:57:09 -08:00
Derek Xu 2c790d3823 [VM/Service] Fix get_perfetto_cpu_samples_rpc_test
My change
https://github.com/dart-lang/sdk/commit/f3536c5c4211479918c9de34c9e74d866dd31c52
has made the test start failing on more configs, because now the `fib`
computation isn't lasting long enough for any samples to get collected.
This change makes the `fib` computation take longer.

Issue: https://github.com/dart-lang/sdk/issues/54401
Change-Id: I0f038df21bb116f97a5093e7d2e58ccda7447977
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411161
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2025-02-21 07:37:23 -08:00
Jens Johansen fb3f2633ba [linter] lines_longer_than_80_chars and document_ignores shouldn't read files
* document_ignores read each file once
* lines_longer_than_80_chars read each file for every line > 80 chars (!).

This follows the approach in
https://dart-review.googlesource.com/c/sdk/+/401424 where the same
pattern was identified as bad.

Before this CL, if a file had, say, 1000 lines > 80 chars (and having
the lint enabled), the lint would read the file - from disk - 1000
times. A somewhat saving grace is that for open files - which I guess is
where it's normally run a lot - it normally reads from an overlay file
and thus not from disk.

Except if you are editing a part in which case the open part is an
overlay, but the "parent" (which is for whatever reason also linted) is
read from file. So if you have 1000 lines > 80 chars in the "parent"
file, and is typing in a part file you're in for a really bad time.

This CL should reduce the number of reads in the lint to 0.

Change-Id: Iac6c78f50add1bc7a411c0c244a181f5ca2ea25b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411300
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-02-21 06:40:12 -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
Brian Wilkerson a039f8818f [migration] diagnostic_factory.dart
Change-Id: I45da294d218329f312f3f30bfa64d4089b7017fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411181
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-02-20 16:14:08 -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
Konstantin Shcheglov d82c467851 Elements. Rename to VariableFragment.initializer
Change-Id: I00e27d560d2b5aaa87db89626c5679aa04b2065a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411083
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-20 15:27:59 -08:00
Ben Konyi 11ab2dfe2f Revert "[SDK] Switch dds and dtd to use an AOT snapshot"
This reverts commit 6450d76f1f.

Reason for revert: Breaking Flutter G3 roll

Original change's description:
> [SDK] Switch dds and dtd to use an AOT snapshot
>
> TEST=ci
>
> Change-Id: Ib65ca1d1a05d3bc7b5f5cab25d90fc459ec8d853
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387133
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

Change-Id: I9985919063cacfc8673b3e2946eaa163e90c9cc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411200
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2025-02-20 15:17:16 -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
Konstantin Shcheglov 292e00610f Elements. Migrate AstRewriter.
Change-Id: I111acffc6a74ee72e371bcdad2f0db2f1d4b0d20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411100
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-20 14:49:31 -08:00
Srujan Gaddam c957483693 [ddc] Initialize and link the necessary library in debugger APIs
Closes https://github.com/dart-lang/sdk/issues/60109

Both getClassMetadata and getClassesInLibrary can be called before
main is called. In order to support this, libraries should be
initialized so that these debugger APIs can inspect them. Similarly,
SDK libraries that are needed before any code can run should be
initialized. In order to support this, they are initialized on the
first initializeAndLinkLibrary call and reinitialized during a
hotRestart (since the libraries are recreated).

Tests are added to evaluate these methods before main is called.
The debugger test helpers are amended to:
- Support breakpoints within the bootstrap script. This is done by
caching the script and querying to see if it has the breakpoint if
the input sources do not.
- Refactor shared test expectation logic.
- Remove an unused method.

Change-Id: I5534d7008436a51243cf51dba01bb8ad06adca69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410602
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2025-02-20 14:15:06 -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
Kallen Tu d5981addc0 [linter] Issue 60136: Update strict_top_level_inference to ignore wildcard variables.
Avoid linting on wildcard variables. Wildcard variables won't be used, so it's okay that the type will be `dynamic`.

Fixes: https://github.com/dart-lang/sdk/issues/60136
Bug: https://github.com/dart-lang/sdk/issues/60136
Change-Id: I6bc0543bfbd3b8eac09ca934fc5098b6c825e1d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410940
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2025-02-20 13:24:39 -08:00
pq 7ca8660229 [element model] migrate error_verifier (_enclosing{Class,Extension})
Change-Id: I36ffcb401da8448f1a1df7791af0a0974a0d0d75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411082
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-02-20 12:50:23 -08:00
Derek Xu f3536c5c42 [VM/Service] Fix get_perfetto_cpu_samples_rpc_test
This test recently flipped back to flaky on vm-linux-debug-ia32. I
believe the problem is that calculating `fib(44)` takes a long time on
less powerful machines, which can cause enough samples to get collected
to fill up the sample buffer and cause data to get overwritten.

Issue: https://github.com/dart-lang/sdk/issues/54401
Change-Id: I63b0bdca5b04b066db098c12cfc22845a9b3c9dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410781
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2025-02-20 12:26:03 -08:00
Konstantin Shcheglov 808911bfec Issue 60172. Fix for resolving metadata with extension types.
Bug: https://github.com/dart-lang/sdk/issues/60172
Bug: https://github.com/dart-lang/sdk/issues/60174
Change-Id: I0e4fb54fdc8419cf0eef7fd095a94fc10e5ec9dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411081
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-20 12:17:32 -08:00
pq 2aa4dadb58 [element model] migrate error_verifier (EnclosingExecutable)
Change-Id: I919fc8b7e4ad76d39c6dfdb163bc17370c259423
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-02-20 12:09:32 -08:00
Konstantin Shcheglov 7ff66f4cd9 Elements. Implement returning ConstantInitializer.
Change-Id: Ib0f3d569b28396cee2633630d8fc968c4fd822e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410900
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-02-20 12:09:29 -08:00
Konstantin Shcheglov 2f2c079a03 Issue 60168. Set enclosingFragment for JoinPatternVariableElementImpl when merging LogicalOrPattern.
Bug: https://github.com/dart-lang/sdk/issues/60168
Change-Id: Id77cd5975c6a090237eb011bb4eca91e18fedf2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410840
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-02-20 11:54:39 -08:00
Kallen Tu ba2c26bf21 [cfe] Internal ASTs for dot shorthand exprs and head with no arguments.
Two new internal ASTs for the CFE representing the entire dot shorthand expression (DotShorthand) and the dot shorthand head (DotShorthandPropertyGet) without arguments.
Static method invocations/constructor calls will be handled later.

Setting up the ASTS first, there's no tests yet. I'll use these in the upcoming CLs.

Bug: https://github.com/dart-lang/sdk/issues/59758
Change-Id: I91a052a3c954a00a424426d3be5c3007aaebc775
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410902
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-02-20 09:44:03 -08:00
Danny Tuppeny 7ec6bdc336 [dds/dap] Provide reason/message for unverified breakpoints
This adds some additional information to breakpoint response/events so that in VS Code a grey breakpoint has a tooltip that explains the reason.

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

Change-Id: I1defdbc9b62b8536b81efbe3f01626e6faf8db50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409280
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2025-02-20 09:37:29 -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
Tess Strickland eff0832b0f [dart2native] Remove unnecessary error in PE creation.
After writing the new PE header and original section contents of the
dartaotruntime PE executable, pad to the expected file offset of the
new section being added, not just to file alignment.

Also fixes a case where the new section's file offset returned from appendSnapshotAndWrite could be incorrect if the header size changed, which causes the file offsets for all sections, including the new one,
to be updated.

TEST=pkg/dartdev/test/commands/compile_test.dart

Change-Id: I060176f6771e9138f8d1a99590d455fc76bb573e
Cq-Include-Trybots: luci.dart.try:pkg-win-release-try,pkg-win-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410720
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2025-02-20 08:09:53 -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
Jens Johansen 6be50a489f [analyzer] Fix signature calculation when merging yaml files with "error" keys
**TL;DR**
In certain situations a new signature was created for every
analyzer start causing more work than needed to be done and filling up
the cache for no reason. The fix can cause the startup cost to improve
significantly.

**Details**
When merging analysis options yaml files (when one file includes
another), and both include data under "analyzer: errors:" we get
inconsistent signatures because of ordering issues. This causes "old
work" to be redone and more files to be written.

This CL fixes the issue by not introducing a semi-random order when
merging.

For the contexts I have open, the following files gives (gave) a bad
(inconsistent) signature:
pkg/analyzer/test/analysis_options.yaml
pkg/front_end/analysis_options.yaml
pkg/analysis_server/test/analysis_options.yaml

Looking at the time it takes from the first read/write until the last:
Before:
37.148419
37.273016
36.807384

Now:
14.164655
15.251373
15.108677

While the difference is easily visible, for good measure:

```
Difference at 95.0% confidence
        -22.2347 +/- 1.0223
        -59.9702% +/- 2.7573%
        (Student's t, pooled s = 0.45103)
```

And from the column "time" in top (note that I'm running from source so
that this includes the initial dart compile of the analyzer):
Before:
1:10.84
1:09.81
1:26.98

Now:
0:38.03
0:38.72
0:37.79

Again the difference is easily visible, but for good measure:

```
Difference at 95.0% confidence
        -37.6967 +/- 15.4529
        -49.6815% +/- 20.3658%
        (Student's t, pooled s = 6.81767)
```

If clearing the cache and opening (waiting for writes to complete),
closing and repeating, before this CL I got this with the contexts I
have open:

After 1st open:
```
$ du -chs ~/.dartServer/
186M    total
```

After the 2nd open:
```
$ du -chs ~/.dartServer/
212M    total
```

 => +26MB

After the 3rd open:
```
$ du -chs ~/.dartServer/
247M    total
$ find ~/.dartServer/ | wc -l
25713
```

 => +35MB

After the 4th open:
```
$ du -chs ~/.dartServer/
272M    total
$ find ~/.dartServer/ | wc -l
27769
```

 => +25MB; +2056 files

After the 5th open:
```
$ du -chs ~/.dartServer/
297M    total
$ find ~/.dartServer/ | wc -l
29825
```

 => +25MB; +2056 files

After the 6th open:
```
$ du -chs ~/.dartServer/
321M    total
$ find ~/.dartServer/ | wc -l
31881
```

 => +24MB; +2056 files

And we seem to have reached a point where we can guess the 7th if we want to.

And with the fix in this CL:

After 1st open:
```
$ du -chs ~/.dartServer/
186M    total
$ find ~/.dartServer/ | wc -l
20816
```

After 2nd:
```
$ du -chs ~/.dartServer/
186M    total
$ find ~/.dartServer/ | wc -l
20816
```

After the 3rd:
```
$ du -chs ~/.dartServer/
186M    total
$ find ~/.dartServer/ | wc -l
20816
```

And it seems that it's stable.

We might also want to sort the strings as ordering (probably?) doesn't
matter, but I'll leave that for another CL.

Change-Id: Id06ca84e8b063bb31a261753f56620443f341a2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410700
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-02-19 23:12:17 -08:00
Nate Bosch 3702cbe573 Remove since annotations for 2.12 and earlier
The earliest supported language version in current SDK releases is 2.12.
Information about the first version supporting an API is not useful for
that or any earlier language versions. Remove the annotations to reduce
noise in API docs.

R=lrn@google.com

Change-Id: Ide0b2a7f02bba6f9c261a01c7b9d4a48f5c71c2b
CoreLibraryReviewExempt: No behavior changes.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405821
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2025-02-19 20:07:15 -08:00
pq 278002029c [element model] migrate error_verifier (more checks)
Change-Id: I2f5e4a337d89df4c593b1ff1dcd408e8c0a25116
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410920
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-02-19 15:02:40 -08:00
Konstantin Shcheglov c9a3dd76f7 Elements. Use getLinkingNode2(Fragment)
Change-Id: I977e38bca5bc6393747ab5e51061423fbc572c32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410880
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-02-19 14:44:12 -08:00