Commit graph

43825 commits

Author SHA1 Message Date
Johnni Winther 0d47ba6890 [_fe_analyzer_shared] Remove RecordStaticType.isSubtypeOfInternal
This method caused invalid exhaustiveness checking by seeing
record types as related based solely on the structure.

The original purpose of the methods has been removed in the mean time
by the change to restrict the created spaces by the matched value
type.

Closes #52800

Change-Id: I8fb581374a4813dc63261d9e1354c4eea94f212c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312982
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-07-11 12:19:39 +00:00
Martin Kustermann 81df36216f Make utf8.encode() have Uint8List return type
Right now `utf8.encode()` has a static return type of `List<int>`
due to extending `Encoding` (which extends `Codec<String, List<int>>`).

We cannot easily change `Encoding` to extend `Codec<String, Uint8List>`
because that would also change `utf8.decode()` to require `Uint8List`
which would be a breaking change.

So instead we override `utf8.encode()` to have more precise return type.

Some parts of our SDK are run using the checked-in SDK, so it cannot
rely on the changed return type yet (until checked-in SDK is rolled).

So we use `const Utf8Encoder().convert()` as a temporary change, as
that already has `Uint8List` return type.

Issue https://github.com/dart-lang/sdk/issues/52801

TEST=ci

CoreLibraryReviewExempt: More precise return type for existing API
Change-Id: I2861d1f0eb3d292d8e3ec8437c0d441a2d2bd193
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254903
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-07-11 08:54:33 +00:00
Daco Harkes e1c12b3ab2 [cfe/ffi] Fix Finalizable non-nullable variables
TEST=pkg/vm/test/transformations/ffi_test.dart
TEST=pkg/vm/testcases/transformations/ffi/regress_52596.dart
Contains
`throw "Attempt to execute code removed by Dart AOT compiler (TFA)";`
without the fix.

Closes:https://github.com/dart-lang/sdk/issues/52596
Change-Id: I5de819afcf6f70be037b60432ea016bc281b742e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312909
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2023-07-11 07:53:47 +00:00
Konstantin Shcheglov 2c97bd7801 Remove duplicate getters from ClassDeclaration and MixinDeclaration.
Change-Id: I69440dd7b1911db6616dc500d82b7b9c3e996529
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313083
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-11 05:47:30 +00:00
Konstantin Shcheglov 7a258fa43b Add NotAugmentedXyzElementImpl implements AugmentedXyzElement.
So, that we don't have to copy all class members for 99% cases when
there are no augmentaitons.

Change-Id: I5c225905a0460ce5162543553e207a2d4412ecb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313082
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-07-11 02:22:35 +00:00
Kallen Tu 8be3439ce3 [analyzer] Make InstanceCreationEvaluatorTest consistent with other const tests.
Print type in `dart_object_printer.dart`.
Use `assertDartObjectText` instead of whatever was being used before.

Change-Id: Ifdfb6343013bb5fe654bcff870a9ff83b155402f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312885
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-10 22:20:22 +00:00
Helin Shiah 2094a733aa Add URI converter method that can be overridden
This is for an internal debug adapter to extend the test debug adapter and provide a custom URI converter to provide internal local paths during breakpoints.

Change-Id: I3b61b70fe07e14f08ff37443ef87facc523bf7fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313000
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-07-10 21:30:51 +00:00
Konstantin Shcheglov 3bb4d7d0d4 Parse mixin augmentations, build element model.
Change-Id: Ie1bdb6d47b31c527546f62abf65d19a4a4e50ee7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312924
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-10 20:48:32 +00:00
Danny Tuppeny 95e6f1e110 [dds/dap] Use Isolate numbers as DAP thread IDs
We used to generate our own thread ID starting at 1 and counting up. There was always a 1:1 mapping from a DAP thread to a VM Isolate. With this change, we always use the Isolate number as the thread ID which makes it easier for tools using both VM Service and DAP at the same time.

Change-Id: Id8d82f6fd5134987f2ecfeaa761765d55999405d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312906
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-07-10 20:14:58 +00:00
Brian Wilkerson edb8d33c8e Start converting portions of the KeywordContributor
Change-Id: I9423ae6e50eec95ba3e5212529f4f3635d2f76d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312940
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-10 19:51:33 +00:00
Joshua Litt 50c810e12c [js|dart2wasm] Add JS backed subtypes of Dart typed array classes.
Change-Id: I19a6d47bf857969abe2205e6b505b3a1dead5e3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310480
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-07-10 18:11:02 +00:00
Ryan Macnak 99ef36064f [infra] Make the sanitizer a first-class status variable.
Makes the TSAN skips apply to
 `test.py -mrelease --sanitizer=tsan`
and not just
 `test.py -n vm-tsan-linux-release-x64`.

Also makes the timeouts agree.

Change-Id: I10315e754a4ebb3020f3c2f6cecfac6b77e77a9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311828
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-10 17:46:31 +00:00
Sam Rawlins fab30a7a73 Bump linter to e8c878360595c1d268d93f54c09bc843815a42d7
Change-Id: I8ab5b3de76d2e498185135660aae1875326f8a8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-07-10 16:20:18 +00:00
Kyle Turney e826300560 add fix for removing the leading underscore from local function names
Closes https://github.com/dart-lang/sdk/pull/52822

GitOrigin-RevId: 1e97f3fde70079ea47a4bb8f8f58db341ae26fdc
Change-Id: Iec46cca3532789b4fb338d73cdbb946a0d383845
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-10 14:18:08 +00:00
Martin Kustermann daa35fd4fd [gardening] Restore timout multiplier in test runner for linux-arm64
The timeout multipiler for linux-arm64 was originally 4, then lowered to
1 (see [0]), then increased again to 2 (see [1]).

Though it seems that service tests are still flakily timing out, so
let's try restoring the original multilier.

[0] https://dart-review.googlesource.com/c/sdk/+/306662
[1] https://dart-review.googlesource.com/c/sdk/+/307972

Also special case `ia32` in timeout calculations due to not using
an AppJIT trained `kernel-isolate` snapshot and therefore being
very slow, especially in ia32-debug mode.

Issue https://github.com/dart-lang/sdk/issues/52589
TEST=ci

Change-Id: Iab8c768866aec9e77bb83c7a3242cc5de8fb4e2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312905
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-07-10 12:02:16 +00:00
Jake Macdonald 1a13ea6c05 Add a disposeMacro api, with TODOs in the implementations to call it.
Change-Id: I38049ca8b851c2203ddaaa729ef651e7802a1d2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312860
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-10 12:01:49 +00:00
Johnni Winther 911b376f7e [cfe] Handle inline class representation field in object pattern
Closes #52667

Change-Id: I9c6d51597ff27ae3a7cdeed29d75755c18a2d530
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311742
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-07-10 11:02:50 +00:00
Chloe Stefantsova b36fbaef2c [cfe] Update both sides of intersection types in GUB
In computation of GUB both the left-hand and the right-hand sides of
the intersection should be updated as nullable when the other operator
to GUB is Null.

Closes https://github.com/dart-lang/sdk/issues/50431

Change-Id: I4b616a94a3e7bf149205ba1b90732453c19ace47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311845
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-07-10 09:51:56 +00:00
Konstantin Shcheglov 4d4eefa956 Compute 'mixins' and 'interfaces' for ClassElement.augmented
Change-Id: I7514576ada4a5dcd048a2c399d5bfe11169f3394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312887
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-07 21:39:41 +00:00
Konstantin Shcheglov 884116a83b Move 'constructors' getter into NamedInstanceOrAugmentationElementMixin.
Remove extra looping detection.

Change-Id: Ifdd7f4729930b3022a8b04f8143d714298acf8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312884
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-07 20:34:39 +00:00
Konstantin Shcheglov aad361b31e Link augmentations and targets during building.
We walk augmentations in the right order, so can update update
necessary data structures as we go.

Change-Id: Ibf3409658009b82a960caaacd538fcd6c779b007
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-07 19:14:25 +00:00
Konstantin Shcheglov 553c804eb5 Don't use LinkedData type parameter.
Change-Id: I2afa126856f05072cb5e796b4f47d64e61284b96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-07 18:29:37 +00:00
Konstantin Shcheglov ac0fc3c11c Print augmentation libraries after the defining unit.
So, we can read it more naturally, first the declaration, then its
augmentations.

Change-Id: I21805969bff6874660500d4477b39ce5aba7484a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312880
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-07 17:08:54 +00:00
pq ff8963d1be fix make_final to properly update for loop patterns
Fixes: https://github.com/dart-lang/sdk/issues/52820

Change-Id: If94b56f034bc8c28087251aada59433578ed7a2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312702
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-07 16:23:59 +00:00
Danny Tuppeny 201fb68e64 [analysis_server] Update remaining CodeActions tests to use new expectation format
This is a continuation of a previous change that stops tests from verifying only individual files modified via a `WorkspaceEdit`. All verifications of these edits are done via a single string that includes all changes, with annotations for creates/deletes/renames.

Additionally, it migrates some additional tests to use TestCode instead of the old markers, and removes some extra indenting these tests had.

It also starts changing how capabilities are set for tests from having to nest function calls in `initialize()` calls to instead calling simple helpers prior to initialization.

Change-Id: I35d16a296c2125ab830685437e14eb3b29ea4704
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312841
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-07 16:15:24 +00:00
pq b05282a1e9 @useResult support for pattern variable declarations
Fixes: https://github.com/dart-lang/sdk/issues/52841

Change-Id: I0ce4e8bc7771808fcaacfbfc2b591ab805c74ff4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312711
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-07-07 15:56:28 +00:00
Konstantin Shcheglov fc0e656868 Build ClassAugmentationElementImpl, basic linking.
Change-Id: I18bd3d97ad9fe661d14e3d3d006219ffceedcfc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312349
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-07 14:55:38 +00:00
Tess Strickland 1bdbafff49 [pkg/vm_snapshot_analysis] Allow old 'patched_class_' field.
While in more recent SDK versions the 'patched_class_' field has
been replaced with 'wrapped_class_', this package can still be
used with the earlier SDK versions if we fall back to checking it.

Issue: https://github.com/flutter/flutter/issues/130009
Change-Id: Ifb1250393b72e58bbdc0764c7e2ce96269e659ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312802
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-07-07 11:36:59 +00:00
Tess Strickland 1133598168 [pkg/vm_snapshot_analysis] Don't assume Code objects have an owner.
For regular stubs, the owner will be null.

Issue: https://github.com/flutter/flutter/issues/130009
Change-Id: I8c85e3130128af79c596f381869d61631221cf9e
Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312660
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-07 09:52:50 +00:00
Nicholas Shahan 5ca83258ef [ddc] Fix default type args signature on native classes
- They should match the calling convention and use the "dartx" symbol.
- Skip adding signatures for static methods since they can't be
  called dynamically anyway.

Issue: https://github.com/dart-lang/sdk/issues/48585
Issue: https://github.com/dart-lang/sdk/issues/52867
Change-Id: If5a76f52163b2267129880dbfe8d145a3fd93408
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312204
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-07-06 23:34:20 +00:00
Alexander Aprelev e62748f3e1 [gardening] Make info_macos_test resilient to snapshots running.
Align info_macos_test with info_linux_test in this regard: fix is similar to how https://github.com/dart-lang/sdk/issues/50583 was addressed.

BUG=https://github.com/dart-lang/sdk/issues/52658
BUG=https://github.com/dart-lang/sdk/issues/52402

TEST=ci

Change-Id: If7ab54990069c86eb5c0348e20086254818da839
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312705
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-07-06 22:57:13 +00:00
Kallen Tu a2cdf8e96d [analyzer] Refactor const evaluator visitBinaryExpression and tests.
Made more of the tests consistent in `evaluation_test` (slowly, but surely).

Change-Id: I515c4d6d81cedcc1d8d20080e231ac1e0afb5ec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-07-06 21:48:07 +00:00
Konstantin Shcheglov 98e6322086 Fix another TODO in elements printer, use 'name'.
Change-Id: I6696a4b559072b064ee16d22b8aad528b52eb6a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312704
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-06 21:47:21 +00:00
Jake Macdonald 658de58b4f move the majority of the client bootstrap code into a real library to make it more maintainable
Change-Id: Id84981b236176c7831cece61692ec895ba2ac1e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312723
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2023-07-06 21:12:58 +00:00
Brian Wilkerson a510e60dbf Simplify the keyword contributor to make it easier to port to the new framework
Change-Id: I29d0bdc2d798adc3b39718fabba893456495dce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312703
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-06 21:03:37 +00:00
Nicholas Shahan 420b551d54 [ddc] Fix missing type tags in new type system
The types implemented transitively through mixins were missing from
the tags we manually attach. 

Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: I7fa00fd79963914cd25c2f87f52d8acc76c9c359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312202
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-07-06 20:27:24 +00:00
Nicholas Shahan 1199dc09b7 [ddc] Support extractTypeArguments in new types
Inline calls to the extract function directly with the type arguments
inserted as extractions from the instance.

Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: I6b791c59478c2e609df30163835e3fd0863a2d94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307514
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-07-06 19:24:54 +00:00
Konstantin Shcheglov 4169196834 Use NodeTextExpectationsCollector to collect and update element expectations.
This code was older, and was a prototype of NodeTextExpectationsCollector,
but we have it now, it is better, and we can de-duplicate.

Change-Id: I428abb04687f2e3ff5142907a71fcf80e460b830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312700
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-06 17:50:59 +00:00
Nicholas Shahan be6a560ca1 [kernel] Fix record type equivalence
- Increment index to avoid infinite loop when the first named elements
  in the two record types are equivalent.
- Add some test cases for record types.

Fixes: https://github.com/dart-lang/sdk/issues/52817
Change-Id: Ifbf3505c74a1f130c9c90ddbb6b1d96d9641e51e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311929
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-07-06 16:37:49 +00:00
Konstantin Shcheglov eaed1fbaff Fix a couple TODOs in the element model printer.
We can use ElementPrinter now for printing elements as references.

Change-Id: Ie75dc96940cf3a1e60f87e34801494f55145901f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312350
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-06 15:45:57 +00:00
Ben Konyi ea1a6a66b8 [ DDS ] Set minimum SDK bound to 3.0.0
Allows for use of new language features.

Change-Id: Ic66cb6d2e8bfbf5ff505cc72c0a23deb32026bbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312601
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2023-07-06 15:39:35 +00:00
Danny Tuppeny 7c2ee2222f [dds/dap] Improve stack frame rendering + fix bad paths in tests
This fixes a bug where we'd produce the wrong absolute path for stack frames that had absolute paths (because `package:stack_trace` uses `path.absolute()` on them).

It also adds support for making stack frames in printed stack traces faded if they are not part of the users own code. This is something the legacy DAPs did. I've also made it possible to perform this stack parsing on non-error events because I'd like to use it on Flutter structured errors (again, something we supported in legacy adapters and was missing here).

Fixes https://github.com/Dart-Code/Dart-Code/issues/4573,

Change-Id: I6c1c3ab69915eca9a1eeef5dcba7f1eb558086de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311842
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-07-06 15:01:21 +00:00
Danny Tuppeny c81b2bac1b [analysis_server] Enable calling LSP handlers over the legacy protocol
This currently only allows "textDocument/hover". Handlers may need some tweaks to remove any dependencies on LspAnalysisServer before they can be enabled.

Capabilities and config are hard-coded to a very basic set (which I suspect will expand as new handlers are added). Reverse requests and notifications are not currently supported (I suspect these will be added when there are more concrete use cases for them because they may need to be conditional based on real client capabilities/needs).

Change-Id: I8a096f9530ad1518ac5ee876aea2560d269a27ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312303
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-06 14:15:16 +00:00
Danny Tuppeny 0d3e76c8e6 [analysis_server] Modify code action/refactor tests to verify whole set of edits
The goal here is to ensure tests can't accidentally check only a subset of edits made during the command execution.

Not all tests have been migrated (only refactorings and a few that happened to use some of the same methods for verification).

Change-Id: I5589e8e667e957aee3ea55f741b1b49a3859d6bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312304
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-06 14:05:09 +00:00
Nate Biggs 924a33c0f5 [dart2js] Fix valid/invalid refinement logic.
The issue here was that isInMask does not hold inversely. The key is that we want to verify which refinements to skip, therefore we want to calculate *in*valid refinements. We want to skip refines where the new type is a Union AND the old tpye is a supertype of the new type. after.isInMask(before) gives us that but !before.isInMask(after) does not.

I've renamed isValidRefinement to isInvalidRefinement to more accurately capture this distinction.

Change-Id: I0d99479357a140095a5d0dfb7e2f987556097891
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312160
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-07-05 20:56:28 +00:00
Konstantin Shcheglov ec893a4d8f Rework ElementImpl and AugmentationElementImpl hierarchies to use XyzOrAugmentationElementMixin(s).
Add ClassAugmentationElementImpl, no any tests yet because it
required parsing, AST, etc. And it is also not ready yet.

Change-Id: I601141545e9bf0638771f28bb9498be9de664659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312345
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-05 20:03:47 +00:00
Konstantin Shcheglov c4cbc7042f Add ClassAugmentationDeclarationImpl, parse into it.
Change-Id: I2461cffa76f31079e52f9877b9fe35668811191b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312346
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-05 20:03:37 +00:00
Jake Macdonald f254c8a4ba Add library macro definitions and support for executing them.
These are intended to be applied by annotating a library directive.

Note that some parameter types had to be widened since `Library` is not a subtype of `Declaration`. Ultimately I think that is fine though.

Bug:https://github.com/dart-lang/language/issues/2839
Change-Id: Ia1311c8aea729f2bd8b76173ce4c7595a6a37a42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312140
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-07-05 18:56:53 +00:00
Danny Tuppeny 1c4ad79985 [analyzer] Include trailing commas in display strings for single-positional-field records
See https://github.com/Dart-Code/Dart-Code/issues/4624

Change-Id: Iac2f061c11ffdb95917329465307abc8e92b6ba3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312421
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-05 18:56:36 +00:00
Danny Tuppeny 28ea45c05c [analysis_server] Handle hovers for identifiers declared in for loops
Fixes https://github.com/Dart-Code/Dart-Code/issues/4627

Change-Id: Idcff9a6e87929ef6ceb0cbed5b44a493bb6a8260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-05 18:12:21 +00:00