Commit graph

45229 commits

Author SHA1 Message Date
Nicholas Shahan 30b530bce7 [ddc] Handle Object members on extension types
Erase extension types when deciding to dispatch directly or to a helper
method for Object members.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: I31081bf4ec64a0f667c8d40b08b94773e229ebe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335601
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-11-17 22:24:37 +00:00
Nate Biggs 2b4b9cb753 Reland "[dart2js] Move Dart2js const conditional simplifier to phase 0b, the CFE linker."
This is a reland of commit fdfca11d39

Original change's description:
> [dart2js] Move Dart2js const conditional simplifier to phase 0b, the CFE linker.
>
> Change-Id: I9ed7f46c5641c28dc71b7712dbd4e8d2062b1f4d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332820
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Mayank Patke <fishythefish@google.com>

Change-Id: I0ddf00c551196085e2a17936d15d6bc46c76efad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336580
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-11-17 21:46:02 +00:00
Nate Biggs 193db9b70e [dart2js] More lenient source code handling for diagnostic reporting.
Should avoid exceptions as thrown in https://github.com/flutter/flutter/issues/138326

Only register source code if there is content in the byte array so we know when we should try to read from file. And when trying to read contents of a file for diagnostics, if we fail to read the file then fail gracefully by using position information.

Change-Id: Ic7e2bdcba0b093a48735aa26670509354f953861
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336480
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-11-17 21:40:42 +00:00
Konstantin Shcheglov e6b02b5895 Extension type. Update nullability, remove implied interfaces.
2edfa84697

Change-Id: I108d57aa2b601ccc3de0e7097507f6115b430d94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337000
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-17 20:59:48 +00:00
Nate Biggs 1941a8f463 [dart2js] Manually add braces for dangling else.
Rather than emit a different node than what is expected (the Block rather than the enclosed statement), we can manually emit the necessary braces.

Change-Id: I0bf2a27a56828cb6d292479c73fdaec8f4072116
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336980
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-11-17 20:48:27 +00:00
Robert Nystrom 2ee771a4f6 Remove the legacy "_2" tests. \o/
I also cleaned up a bunch of places that referred to them.

Change-Id: I45f68818c892f8620ea04257885ffa3763374bb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335863
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-11-17 20:17:23 +00:00
Stephen Adams 87d9b9d946 [js_ast, dart2js] Unwrap trivial blocks in the compiler, not printer
Simplify the js_ast printer - it should not transform the program
while printing.

js_ast:

- Don't skip blocks containing a single statement.

- Don't rewrite arrow functions.


dart2js:

- Fix rewrite_async.dart to avoid a few singleton blocks.

- Static initializer thunks are transformed in arrow functions with expression bodies.

Change-Id: I4ab75c6ca7f580835a6c9d4eb45240d76df9d895
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336820
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-11-17 19:23:27 +00:00
Brian Wilkerson d86a114d49 Move the generation of type parameter suggestions
Change-Id: I3ab850747ab9c12360ffcccd80120b7723af8420
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336840
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-17 17:26:38 +00:00
Konstantin Shcheglov d2c7d9d412 Macro. Support for Diagnostis, without target yet.
Change-Id: I8a3cf3cae193bd3da07afa20e48a408ad3c45ea2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336802
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-11-17 17:12:13 +00:00
Parker Lougheed 4f0417d8cc [analysis_server] Don't offer convert_to_if_case_statement_chain assist when body is empty
Fixes https://github.com/dart-lang/sdk/issues/54077

Bug: https://github.com/dart-lang/sdk/issues/54077
Change-Id: Id0efda426308d5eb42564c696f52a21fa0d62a55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336783
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-11-17 16:26:25 +00:00
Keerti Parthasarathy 5ed46e624e Fix exception when running dart fix against flutter examples.
Ran against the code used in flutter customer_testing.

Change-Id: I330e528b3184c7a05ab34f9040a802dc06146b97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-11-17 15:56:20 +00:00
Johnni Winther ced5b4e25d [cfe] Ensure nullable result type for ??= for effect
Closes #54069

Change-Id: I4caaad1b86f9ef68f1d36d7b2f9afc92364ce83c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336662
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-17 14:06:50 +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
Dan Chevalier 272b9d28a8 Improve DSPS Readme and remove todos.
Change-Id: Id82ad846dd566306d41db211d9ae9a9370192306
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336540
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-11-16 21:00:29 +00:00
pq 07c77f59a2 Final todo updated format fixes
This should tidy up the last ones. 🤞

Sorry for the noise!

Change-Id: I7104fc33282184acb0c843eae6e73f6fcc77d892
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336723
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-11-16 20:18:32 +00:00
Konstantin Shcheglov c2e3f9dfa9 Augment. Support for constructor elements.
Change-Id: Id9a44580fc6c13cfa6c2af6a0783a92be662ac57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336722
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-16 19:21:40 +00:00
pq 4aefa448c2 fix todos in analyzer
Change-Id: Ib5b5351637a07d1530eb96e100613de4fcabe6f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336720
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-16 19:03:58 +00:00
Brian Wilkerson c7458baa7a Add tests of shadowing in code completion
I'm fairly sure the failing tests are recent breakages. I was only able
to break it without noticing because we didn't have adequate testing.

The next CL should fix the tests.

Change-Id: I69f5fde6e7cd2e872b2ffab38905467d366caa9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336625
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-11-16 17:45:09 +00:00
Ben Konyi f039d50437 [ package:vm_service ] Fix flakiness in should_pause_on_exit_test.dart
This test would sometimes fail when trying to resume the main isolate in
the target program when it was not yet runnable. Waiting for the main
isolate to pause at start before resuming should fix this.

Change-Id: Ie242a222199a01e2c84d7c7be56376e616f9989e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336700
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-11-16 16:24:11 +00:00
Aske Simon Christensen 4b880aec60 [dart2wasm] Avoid using _Closure as a type
`_Closure` is the implementation class for function objects. When used
as a type, it translated to the same Wasm type as the `Function` type,
but in the type system it missed the special property of `Function`
that it is a supertype of all functions. Instead, it was translated
into an interface type, leading to incorrect type check results.

Thus, we must always use the `Function` type when referring to any
function.

The problem was hidden by the type check specialization for simple
interface type checks and exposed by `--verify-type-checks`.

Change-Id: I384d35506c0c8cd932ba789e977f8257e684b8d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336423
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2023-11-16 15:04:58 +00:00
Aske Simon Christensen 80a69223e0 [dart2wasm] Add option to verify type check implementations
This adds a `--verify-type-checks` option to dart2wasm to instrument
the code such that whenever we are able to generate specialized code
for a type check, we generate both the specialized code and also call
the general fallback path, then compare the results.

This can be used to expose bugs in the type check specializations, or
in the reference implementation, as it may be.

Change-Id: I081540a8eedc7d029b332919283810220b21b3ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336023
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-11-16 15:04:58 +00:00
Johnni Winther 1e981c48a2 [cfe] Add test for issue 54070
Closes #54070

Change-Id: Ib3f081e0bb5c8d7fea16f30752a7e7a7bd6b339d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336640
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-16 14:52:29 +00:00
Johnni Winther 346662457d [cfe] Handle extension type constructor access through typedefs
Closes #53531
Closes #53563

Change-Id: Ibaf99f4255547d17545223ded58eba9e31d30175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336421
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-16 11:47:57 +00:00
Johnni Winther 56a86e599e [cfe,ddc] Add tests for scopes in extensions, extension types and mixins
This adds support using experimental features in id testing in DDC and
uses it to add tests for scopes in extensions, extension types and
mixins.

The tests show that the DartScopeBuilder and DartScopeBuilder2 differ
on the scope on instance members in extensions and extension types for
the synthetic #this variable.

Change-Id: Iec0f3b938da567578b1245ada885370fb2a8b33f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335824
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-16 09:37:31 +00:00
pq fe6950eceb enable flutter_style_todos
Change-Id: Ic82963b754404d54e37f5fb03819aebc3fa67954
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336502
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-15 23:04:19 +00:00
Brian Wilkerson 974b97ca3f Fix the semantic highlighting for both extension types and mixins
Change-Id: Ie64494adbe9d54810b0b156b4884734bdb801309
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336601
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-11-15 23:01:13 +00:00
Konstantin Shcheglov c06f69c442 Macro. Introspection for constructors.
Change-Id: I4589bd9b3eb152427360818e4ba2fac7540dcf46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-15 21:59:35 +00:00
Konstantin Shcheglov 5dbb5960ef Extension type. Issue 53918. Fix type literal constant type.
Bug: https://github.com/dart-lang/sdk/issues/53918
Change-Id: I941332f30bdc681dd10c8471e1710f2e9dde4c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336501
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-15 21:10:48 +00:00
Konstantin Shcheglov 0bc4cfdeb0 Macro. Use shared _getMacroCode(), single introspect macro, file.
Change-Id: Ie54453dd3432889254823670716fb3d181069662
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-11-15 19:45:09 +00:00
Nate Biggs d7fa5f3d89 Reland "[dart2js] Evaluate CFE consts as part of phase 0b (CFE linker)."
This is a reland of commit bebd08746b

Original change's description:
> [dart2js] Evaluate CFE consts as part of phase 0b (CFE linker).
>
> Constants are current evaluated in a few places during closed world generation, primarily as part of the ScopeModelBuilder. The scope visitor was modifying the AST which meant we had to emit a new dill with these evaluated constants along with the closed world results.
>
> This change instead evaluates the constants directly after linking the Kernel as part of the global transformations. This means we can update the ScopeModelBuilder to not mutate the AST at all as all constants are already simplified.
>
> A potential follow up here is to simplify the ScopeModelBuilder since all nodes should already be simplified if they can be, we should be able to avoid visiting some children.
>
> After this change we only directly create a single ConstantEvaluator, the one in `load_kernel`. The const simplifier also creates one and a follow up CL moves this to to run right after this new transformation.
>
> Note: Alternate versions of this CL tried to make the global transformation simpler by either:
> 1) Running the const evaluator indiscriminately on all expressions. This didn't work because it lead to exponential computation on constants set up as a DAG (see tests/language/const/constant_dag_test).
> 2) Only evaluating ConstantExpression nodes to update UnevaluatedConstants. This does not cover all the cases where the ScopeModelBuilder is modifying the tree and lead to a different compiler output.
>
> Change-Id: I746d889b37feddc9ab6c386c6252016dec745e6e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332601
> Reviewed-by: Mayank Patke <fishythefish@google.com>

Change-Id: I53871a57144a3a1bd363af141d8f31c8ffa5ca6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336221
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-11-15 19:15:29 +00:00
Dan Chevalier cb5c3b6617 Small improvements to dart_service_protocol shared.
These are small changes that got missed in https://dart-review.googlesource.com/c/sdk/+/335244

Change-Id: Icfebf3fe538d0c07e435d86f1812d430ffd86c04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336090
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2023-11-15 18:19:39 +00:00
Danny Tuppeny be709b288c [analysis_server] Ensure exclude folder paths are always normalized
Workspace folder paths were normalized but these ignore paths are not.

Change-Id: Idc6197b04d740e473bc3f3fede1d7798f5b94944
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336364
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-15 18:08:32 +00:00
Devon Carew 09de61569c [analyzer] upstream minor changes to the analyzer's display_string_builder.dart
Change-Id: Ia8885c674f5f35854a090e15d5dbe8b1989aeb0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335304
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-11-15 17:24:20 +00:00
Keerti Parthasarathy 99bbf8d67e Revert "Reland adding a pass to fix pubspec during dart fix runs."
This reverts commit 9186eb1b94.

Reason for revert: https://github.com/flutter/flutter/issues/138485
Flutter roll failure

Original change's description:
> Reland adding a pass to fix pubspec during dart fix runs.
>
> The regressions were fixed with changes to MisssingDependencyValidator in previous CL's.
>
> Change-Id: Id8418811c067535e44fc58c1d2d47afb1c30716f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335864
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Keerti Parthasarathy <keertip@google.com>

Change-Id: I68cd6640b0620c24e02b9a5f8c0d659481146541
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336460
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-15 17:08:22 +00:00
Konstantin Shcheglov 444ad4daae Include 'localVariableDistance' feature into relevance.
Bug: https://discord.com/channels/608014603317936148/1174045252164796566/1174149206571753594
Change-Id: Id3aed7cc67194a5efdbfbf1851c132b8e7b933e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336320
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-15 17:08:10 +00:00
Johnni Winther 3c456ccbd2 [cfe] Report error on constructor/static member conflict
Change-Id: I30c939e2d1dfe6e814b08e6ceac0bbb27af56f93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336400
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-11-15 16:30:30 +00:00
Paul Berry 75d943bf97 Reland "Add support for non-late local variables to the Wolf analysis prototype."
This is a reland of commit b76d60340d

Original change's description:
> Add support for non-late local variables to the Wolf analysis prototype.
>
> The AST-to-IR conversion stage now handles function parameters, local
> variable declarations, `this`, and reads and writes of local
> variables. In order to make this easier to test, support was also
> added for block function bodies, expression statements, and return
> statements.
>
> This required adding the following instruction types: `alloc`, `br`,
> `drop`, `dup`, `readLocal`, `release`, and `writeLocal`. To allow for
> thorough testing, support for these instruction types was added to the
> interpreter and validator.
>
> Change-Id: Iedef6aa75297081d128e89a2ac24019a198cf948
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335505
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Phil Quitslund <pquitslund@google.com>

Change-Id: I660947ff7adc6173508dcd69f625ced7e1d35721
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336202
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-11-15 14:55:05 +00:00
Chloe Stefantsova c6b0e218c7 [cfe] Make extension type non-nullable only if it implements Object
Part of https://github.com/dart-lang/sdk/issues/49731

TEST=existing

Change-Id: I397bbd5ca7868a9fb344286c910536c6ac341222
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333500
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-11-15 14:02:35 +00:00
Johnni Winther 000e67bb20 [cfe] Add test for Object member access
Change-Id: I3b9138a48878110f1af42afe8eee7a5338766378
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335823
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-11-15 12:47:23 +00:00
Johnni Winther 4eed065859 [cfe] Add CFE test for DartScope
This adds a CFE test for DartScope that shares the data with the
corresponding DDC test. The CFE test uses the DartScopeBuilder2
which is currently in development to replace the DartScopeBuilder.

Change-Id: I0d6c76957e7a5d28babab14110d430935e686b22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335821
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-15 10:17:23 +00:00
Johnni Winther 3e89b9b04e [cfe] Include const extension type constructors in outline
Closes #54008

Change-Id: If5135111760fdab7009d97aeda7cd65c93001d74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336022
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-11-15 10:10:58 +00:00
Konstantin Shcheglov 0fa6a6b8b7 Set 'CompilationUnit.declaredElement' when resolve for completion.
Change-Id: I8cb475af4400380c8859c1d1ae179a3db3a3850f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336241
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-15 02:57:59 +00:00
pq bec6e82853 migration to driver.getAnalysisOptionsForFile (continued)
Change-Id: Ia22286786febe7e915df0d7e7b18b9657fef2b07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-14 22:41:28 +00:00
Danny Tuppeny 4dddc98fc6 [analysis_server] Include 'required' keyword in closure completion text
This adds missing 'required' keywords when completing closures. The keyword is only added to the completion text and not the displayed label because there's limited space for completions and seeing the end of the completion (for example `=>` vs `{}` is more useful.

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

Change-Id: I3cb791bcd84533e9bc3819d8a527233f026849bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-14 22:38:39 +00:00
Danny Tuppeny 28d9ac03ef [analysis_server] Fix missing closure completions in LSP
Closure completions disappeared in eb73dba14d because we ended up wiping our the filterText/label when trying to clean them up for functions.

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

Change-Id: I61976734356117aa1ec0fae81c8a56245f2b35c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-11-14 22:33:01 +00:00
Nicholas Shahan 385c0063af [ddc] Cleanup extension type erasure helper
A better API is now available from the kernel nodes directly.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: I1b4b36e44292cadc3f9d6c495ae93ae20e0db970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335944
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-11-14 22:26:39 +00:00
Nicholas Shahan f1219f2956 [ddc] Make equality optimizations aware of
extension types. This ensures the same optimizations are applied to
extension types and the representation type they are erased to.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: I630fc8b68e6e86b81ec85495286719ca39f89d14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335943
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-11-14 22:26:39 +00:00
Dan Chevalier 275aa86331 Rename service_extension_router to dart_service_protocol_shared
Change-Id: I14621db0faa7d472b2cd54f2e91a727f936be271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336089
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
2023-11-14 21:34:28 +00:00
Ben Konyi 39e60fa3fc [ package:vm_service ] Enable more lints
Change-Id: I1a7548297fa8562ea81f3d4e32db2aba53661189
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335960
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-11-14 21:26:31 +00:00
Nicholas Shahan 60b90b296c [ddc] Add more context to error messages
Some SDK only inline helper methods expect specific types passed to
them. These expectations can't be enforced by the type system and
everything is currently working properly. Extension methods may cause 
confusion in the future so this change adds a bit more context to
the error messages just in case.

Issue: https://github.com/dart-lang/sdk/issues/49735
Change-Id: Idc620993d1a240fa5aaaccd4519433b04f0ba9ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335942
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-11-14 21:13:49 +00:00