Commit graph

82955 commits

Author SHA1 Message Date
Konstantin Shcheglov b34f399859 Cache Element.hasDeprecated
We use it quite often during computing relevance of completion
suggestions. This brings the cost of ElementImpl.hasDeprecated from
7.55% to 0.77% during large completions.

Change-Id: Ie6d2b9ef6a825920a926711b5c3f75430e98af58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219904
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-10 20:38:34 +00:00
Stephen Adams 8bbf5c9586 [js_runtime] Use Symbol for identityHashCode
Partial mitigation for #47595

Change-Id: I35bc2b80e5b85af5da0707577e4f67434e4b597f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219843
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-11-10 20:30:34 +00:00
Nate Bosch ac78f99883 Update to the latest pub_semver
Fixes a bug where version strings with arbitrary characters are accepted as
digit separators.

Change-Id: I273f242155e421d994d324fce339e2f9889bc1fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219920
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2021-11-10 19:12:19 +00:00
Nate Bosch 0224c65f0a Update to the latest bazel_worker
Expands package docs to improve pub score.

Change-Id: I04cc44df8b7636b55863672f80a4ab5248f57d4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219902
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-11-10 18:46:43 +00:00
Lasse R.H. Nielsen cb4c4f9ea9 Document isValidKey for {Linked,}Hash{Map,Set}.
Closes #26498, #26499

Bug: https://dartbug.com/26498
Change-Id: I9041d4f511d0a4dc8d1315d5c434c2975a43e619
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219780
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-11-10 18:39:27 +00:00
Sam Rawlins 7fabfa7efd Add strict-casts language option for analysis_options
The implementation is extremely simple: wire strict-casts right
alongside implicit-casts in AnalysisOptionsImpl, AnalysisSession, and
TypeSystem. The flag is separate from implicit-casts because it is
_slightly_ stricter. The implicit-casts flag has some gaps in coverage
(like for-each iterables, and yield-each expressions). Filling these
gaps in implicit-casts would be expensive (requiring cleanup), and the
short-term goal is to deprecate the flag, so it is not important to
tidy it up.

A few extra bits are then added which are specific to strict-casts,
which improve the coverage.

Most of this change is the tests: tests are added for (theoretically)
each error code which could be reported as a result of strict-casts. The
test model using WithStrictCasts follows the model of WithStrictCasts,
which couples two tests into one assertion, ensuring the state of each
example code before and after strict-casts.

Bug: https://github.com/dart-lang/sdk/issues/36267
Change-Id: I52b2fc831fac3a5467ec7164df8fc1a1109e42ef
https://github.com/dart-lang/sdk/issues/33749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219847
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-11-10 18:37:35 +00:00
Siva Annamalai 6ae2506f18 Revert "Add a lock mechanism for quick fixes"
This reverts commit 6732808c40.

Reason for revert: Causes breakage in flutter framework tests, please see https://github.com/flutter/flutter/pull/93406 under the checks section.

Original change's description:
> Add a lock mechanism for quick fixes
>
> I'm not fond of this approach, so if you have alternative suggestions
> I'd be very interested in hearing them.
>
> Change-Id: I9646d564b63d921f5eed77bdfa4de082b65d9148
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219126
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I6d6fd2511a80e5fd457eed234baa4eb41210467e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219901
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-11-10 18:15:03 +00:00
Vyacheslav Egorov 8bdae002f1 [vm] Fix symbolization of future listener frame.
For future listener frames async unwinding produces frames with
`pc_offset` set to 0, because this frames correspond to closures
which will be invoked once the future completes. Such frames
are different from most other frames which correspond to real
call or yield locations within native code and have non-zero
`pc_offset`.

Because there is no call-/yield- site at 0 compiler does not emit
any source location information into CodeSourceMap and consequently
runtime can't produce much beyond file name in the stack trace for
these special frames.

To make matters worse ordering of code objects in the AOT snapshot
could affect symbolization of such frames - sometimes resulting in
an arbitrary token position being attached to the symbolized frame.

This CL adds more special handling of these frames into
StackTrace::ToCString and changes compiler to emit a dummy source
position descriptor for the start of every closure function.

This descriptor is encoded as

    ChangePosition function.token_pos()
    AdvancePC 0

in the CodeSourceMap. This entry is then handled specially when
generating DWARF.

This is reland of https://dart-review.googlesource.com/c/sdk/+/219781 with
fixes for ARM build.

TEST=vm/dart{,_2}/causal_stacks/async_throws_stack_lazy{,_lazy_non_symbolic}_test

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try
Change-Id: I06f80c1125422675758917ea12cdf2c70a2f6deb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219795
Auto-Submit: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-11-10 17:52:03 +00:00
Konstantin Shcheglov c6fe2b6f6a Evaluate dependencies in LinterContext.evaluateConstant()
Change-Id: Iac48757b4136ecd039619c280d1dac8ca394b2d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218983
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-11-10 17:05:03 +00:00
Keerti Parthasarathy f322513baa Add a check for local elements to find references
Change-Id: Id90f719172270aa9b213af09efcdd113381ae6cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219800
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-11-10 17:03:23 +00:00
Slava Egorov df38f320ee Revert "[vm] Fix symbolization of future listener frame."
This reverts commit 64d30f848b.

Reason for revert: breaks ARM build.

Original change's description:
> [vm] Fix symbolization of future listener frame.
>
> For future listener frames async unwinding produces frames with
> `pc_offset` set to 0, because this frames correspond to closures
> which will be invoked once the future completes. Such frames
> are different from most other frames which correspond to real
> call or yield locations within native code and have non-zero
> `pc_offset`.
>
> Because there is no call-/yield- site at 0 compiler does not emit
> any source location information into CodeSourceMap and consequently
> runtime can't produce much beyond file name in the stack trace for
> these special frames.
>
> To make matters worse ordering of code objects in the AOT snapshot
> could affect symbolization of such frames - sometimes resulting in
> an arbitrary token position being attached to the symbolized frame.
>
> This CL adds more special handling of these frames into
> StackTrace::ToCString and changes compiler to emit a dummy source
> position descriptor for the start of every closure function.
>
> This descriptor is encoded as
>
>     ChangePosition function.token_pos()
>     AdvancePC 0
>
> in the CodeSourceMap. This entry is then handled specially when
> generating DWARF.
>
> TEST=vm/dart{,_2}/causal_stacks/async_throws_stack_lazy{,_lazy_non_symbolic}_test
>
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try
> Change-Id: I80740dd2c3cb03d6c03c35e1b3bde2cacbe033e0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219781
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Clement Skau <cskau@google.com>

TBR=vegorov@google.com,cskau@google.com,sstrickl@google.com

Change-Id: I134ed9e5ccd1dbf3f7c07d046d92be298fe96eb3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219794
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2021-11-10 16:35:36 +00:00
Alexander Aprelev 8f864523ff Reland "[vm/concurrency] Remove --(no-)enable-isolate-groups flag in Dart VM"
This reverts commit 6828fd752e as
internal use of flag that forced the original revert has been removed via 408658160 and
408425059 cls.

TEST=ci

Change-Id: I9d4ae3c01bef938ce6e111afedfdb1ca6525bdac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219840
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-11-10 15:29:13 +00:00
Vyacheslav Egorov 64d30f848b [vm] Fix symbolization of future listener frame.
For future listener frames async unwinding produces frames with
`pc_offset` set to 0, because this frames correspond to closures
which will be invoked once the future completes. Such frames
are different from most other frames which correspond to real
call or yield locations within native code and have non-zero
`pc_offset`.

Because there is no call-/yield- site at 0 compiler does not emit
any source location information into CodeSourceMap and consequently
runtime can't produce much beyond file name in the stack trace for
these special frames.

To make matters worse ordering of code objects in the AOT snapshot
could affect symbolization of such frames - sometimes resulting in
an arbitrary token position being attached to the symbolized frame.

This CL adds more special handling of these frames into
StackTrace::ToCString and changes compiler to emit a dummy source
position descriptor for the start of every closure function.

This descriptor is encoded as

    ChangePosition function.token_pos()
    AdvancePC 0

in the CodeSourceMap. This entry is then handled specially when
generating DWARF.

TEST=vm/dart{,_2}/causal_stacks/async_throws_stack_lazy{,_lazy_non_symbolic}_test

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try
Change-Id: I80740dd2c3cb03d6c03c35e1b3bde2cacbe033e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219781
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-11-10 14:50:23 +00:00
Alexander Thomas 4ff053b8b7 [infra] Support macOS SDKs > 11
Inspired by https://crrev.com/cdd96213435c7cb21042e84720d9343ca35b37cf

Cq-Include-Trybots: luci.dart.try:dart-sdk-mac-try,vm-kernel-mac-release-x64-try,vm-kernel-mac-release-arm64-try
Change-Id: I209b279ca2066c8597170f552e9a5e98a4daf1b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219790
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-11-10 13:46:34 +00:00
Alexander Thomas 55134ad5c8 Bump SDK version to 2.16
TEST=Standard CQ
Change-Id: I8598e2102df2990396afa3e56ad4a41120c5dee0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219787
Auto-Submit: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-11-10 12:51:46 +00:00
Jukka-Pekka Siitonen 8c74f563e0 Documentation update for JsonEncoder and JsonDecoder class
Added example codes for classes: JsonEncoder and JsonDecoder.
Added example codes for functions: jsonEncode and jsonDecode.

Closes https://github.com/dart-lang/sdk/pull/47430
https://github.com/dart-lang/sdk/pull/47430

GitOrigin-RevId: c3015fb09cd72a3441b338a3266886ed262b03b3
Change-Id: I0a58c95e43421efca34ccda9d776454fddfbdb9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216200
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-10 10:49:24 +00:00
Jukka-Pekka Siitonen 3dd93b705a Documentation update for HtmlEscape and HtmlEscapeMode
Added examples for HtmlEscape and HtmlEscapeMode usage.
Small fixes to texts in file

Closes https://github.com/dart-lang/sdk/pull/47599
https://github.com/dart-lang/sdk/pull/47599

GitOrigin-RevId: c6daa7477982d5a37cfe155780b4f00f8c688748
Change-Id: I82737c8570e31c8e39022c66636282ca776823be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218989
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-10 10:31:14 +00:00
Jukka-Pekka Siitonen 6e59dbc33a Documentation update for Base64Encoder and Base64Decoder
Added example codes for Base64Encoder and Base64Decoder

Closes https://github.com/dart-lang/sdk/pull/47620
https://github.com/dart-lang/sdk/pull/47620

GitOrigin-RevId: 0e1825ea9d07e97e31db5946acf52548094acb0f
Change-Id: Id4ede13732bc8b9d334a3acaed50d48f2bee22e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219261
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-10 09:36:03 +00:00
Tess Strickland fea71f432f [gardening] Use const variable to guard separate init and use blocks.
TEST=Builds on vm-kernel-gcc-linux trybot.

Cq-Include-Trybots: luci.dart.try:vm-kernel-gcc-linux-try
Change-Id: I089f01434cfffa8389a9b46f3d25acf13454833d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219786
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-11-10 09:30:03 +00:00
Konstantin Shcheglov 7ff9282868 Precompute FileState.uri properties.
Working with Uri, in form of _SimpleUri, was taking about 11%.
Now it _PubFilter is about 1%.

Change-Id: I35cd426d9c79e57cf85dcfe751ac57556f1a8b42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219849
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-10 05:29:14 +00:00
Konstantin Shcheglov 97649d23b3 Unwrap try/finally in OperationPerformanceImpl.
Otherwise it looks weird in Observatory, as if `Stopwatch.stop()`
uses all the time consumed by the awaited operation.

Change-Id: Ic33ab18ac7fc2d19f221d659d8b7989ed0d54a98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219848
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-10 02:09:13 +00:00
Konstantin Shcheglov a2fd0da4f9 Use synchronous getLibraryByFile() for not yet imported.
This cuts the time to produce not yet imported suggestions 2x.

We don't check for abort anymore, will use the given budget.

Change-Id: Id02b0dcd894f89affa00e4a67fc1e93dc7745215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219845
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-10 01:25:13 +00:00
Keerti Parthasarathy 93ac98d662 Change find refernces to accept an Element
Change-Id: I3d9f6456fe352ca423d63cd71d9408ce678066b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219821
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-11-10 00:35:04 +00:00
pq b403d4bf73 Reland "hints for text_direction_code_points"
This is a reland of 39008c8243

Original change's description:
> hints for text_direction_code_points
>
> Fixes: https://github.com/dart-lang/sdk/issues/47611
>
> Related: https://github.com/flutter/flutter/pull/93034
>
>
> Change-Id: Ia6bac44e1c9a7ef25f01683b8414b9818822cb7f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219123
> Commit-Queue: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Kathy Walrath <kathyw@google.com>

Change-Id: Ib200aa2e6f1a323a6d01cc3c051657fd48f41251
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219750
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
2021-11-10 00:09:33 +00:00
asiva 304330b6fd [VM/Runtime] Add more shutdown logging to debug occasional delay in shutdown.
TEST=cq

Change-Id: Id663e03c38a8380320982ddd8fd328b38896baf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219125
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-11-09 21:50:34 +00:00
Michael Thomsen 916a43a1c8 Initial 'dart doc' developer command
Initial 'dart doc' command for the unified 'dart' developer tool,
over time replacing the exiting 'bin/dartdoc' tool.

Change-Id: Ib5639f9329bf5ed86375c97c5e485471934c56ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217980
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-11-09 21:27:53 +00:00
Joshua Litt 489ac923e2 [dart2js] Add a bit more error checking to the constraint builder.
Change-Id: I78eaea1163860a71245e7879b7b47bd3443ab34c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219502
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-11-09 21:01:53 +00:00
Konstantin Shcheglov 20c379ebe3 Use AnalysisDriver.resolveForCompletion() for getSuggestions2.
Change-Id: Ibc751b1c5315c5f16e25d2135d02d5f94d0c5bf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219360
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-11-09 18:52:26 +00:00
Siva Annamalai 8b14aba413 Revert "Reland Support overlapping deletions in quick fixes"
This reverts commit c1d4af3049.

Reason for revert: Broke Flutter, see https://github.com/flutter/flutter/issues/93206 for more details.

Original change's description:
> Reland Support overlapping deletions in quick fixes
>
> This relands both
> - https://dart-review.googlesource.com/c/sdk/+/217280, and
> - https://dart-review.googlesource.com/c/sdk/+/217287
>
> Change-Id: Icd32df8e5bdc64514e4383f2e5625c0b093f862c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219285
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I282a7ea79777ca257333bb3c4b97d780695df902
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219820
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-11-09 18:05:03 +00:00
Danny Tuppeny c224cc2e0d Update LSP docs to use the "dart language-server" command
Change-Id: Ia8c948e088c2fe8c8f4fa79e43859aa4755f0bab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219784
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-11-09 17:31:32 +00:00
Danny Tuppeny 445ac5d803 [analysis_server] Improve handling of library-target annotations when organizing imports
+ handle comments between the last annotation and the directive code.

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

Change-Id: I868c832c8fcb2bf67aab83400ef2e57a5f14ce45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219783
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-11-09 17:16:52 +00:00
Devon Carew a88c010f2c Update docs/process/breaking-changes.md.
Change-Id: I9f0313b0cc088fac982f058adbdb423f5fd93659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219745
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-11-09 16:53:12 +00:00
Konstantin Shcheglov 5ffec0e46e Create DartCompletionRequest with values, currently using forResolvedUnit() constructor.
Change-Id: Ie3db8617ed882d9561f9ea49b23dd5f8d3b4cf5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219753
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-09 16:17:55 +00:00
Jukka-Pekka Siitonen 428d3e83a2 Documentation update for Latin1Encoder and Latin1Decoder
Example codes of usage added

Closes https://github.com/dart-lang/sdk/pull/47616
https://github.com/dart-lang/sdk/pull/47616

GitOrigin-RevId: fcb498e68c2eda793dbec80f50809d1537f688de
Change-Id: I660191b7825d171617c7d27e42d8189c673da38e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219400
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-09 16:09:52 +00:00
Jonas Finnemann Jensen 109c317ac1 Bump pub to [cherry-pick-for-2.15.0].
This adds [96404e0749864c9fbf8b12e1d424e8078809e00a] which fixes issue
where `pub publish` and `pub token add` hangs after reading from
`stdin`.

[cherry-pick-for-2.15.0]: https://github.com/dart-lang/pub/compare/cherry-pick-for-2.15.0
[96404e0749864c9fbf8b12e1d424e8078809e00a]: 96404e0749

Change-Id: I49dcafdcabc002568cb9d9fc6268ebdd0de1af10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219782
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-11-09 15:37:33 +00:00
Michael Thomsen f7af5c5256 Deprecate dartanalyzer command
Change-Id: I8d2fb8a5dbac0f81c8cad770ccfb2e3bbf2b0880
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219702
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-11-09 13:23:42 +00:00
Jukka-Pekka Siitonen 07cd8ddd5a Documentation update for AsciiDecoder and AsciiEncoder
Example codes added for AsciiDecoder and AsciiEncoder

Closes https://github.com/dart-lang/sdk/pull/47619
https://github.com/dart-lang/sdk/pull/47619

GitOrigin-RevId: fd3a4cfb1ea92c9c47815fcad688da965496cc61
Change-Id: I63c685013edc913c0783621bfe53635e35e741b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219260
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-09 11:59:15 +00:00
Jukka-Pekka Siitonen 93c2aad57d Documentation update for LineSplitter
Adding example of usage

Closes https://github.com/dart-lang/sdk/pull/47621
https://github.com/dart-lang/sdk/pull/47621

GitOrigin-RevId: e2509b50cf4a7285a2ad1aa4435ab5dc178eb634
Change-Id: I1cd79309799d8361c359c4e5194473bc4e46463b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219280
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-09 11:45:13 +00:00
Jukka-Pekka Siitonen 56035a7df0 Documentation update for Utf8Encoder and Utf8Decoder
Examples for Utf8Encoder and Utf8Decoder usage.
Some small text updates done.

Closes https://github.com/dart-lang/sdk/pull/47622
https://github.com/dart-lang/sdk/pull/47622

GitOrigin-RevId: 8fa368882dc4ebcea69faae86bada1fe0ad77fa5
Change-Id: I5fa545128bdbec7b27a1bc35c01d5764ddd2a432
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219281
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-11-09 11:30:33 +00:00
Konstantin Shcheglov 9703f4ae9f Fix the failing isA test.
TBR

Change-Id: I0582a5c39356a9b5f099b1cb438dd230eec0485e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219754
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-09 06:31:13 +00:00
Konstantin Shcheglov f7d5061350 Create CompletionTarget with AstNode entry point.
When we resolve a file partially, there is no fully resolved
CompilationUnit. So, anything we create for completion should be
based on element models and a resolved, or unresolved AstNode.

In a following CL I will make it possible to create instances of
DartCompletionRequest based on such element models and node.

Change-Id: Ief7e376588bb63f4d898e33299a9fd2014c88843
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219748
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-11-09 02:49:23 +00:00
Stephen Adams 0afb365804 [dart2js] Fix #47566 by disabling optimization
The JavaScript-to-JavaScript async transform had an inconsisent
handling of switch statements that contained an await, but only in the
expression.

For now the special handling of the expression-only case is disabled.

Change-Id: Ia79ff3951d681ba933df638da7e0e518d401ed9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219746
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-11-09 00:43:02 +00:00
Riley Porter b97737c3b5 [package:js] Update changelog to reflect js_util optimizations
Change-Id: I51d6f6759520fb5703065f9b223a65e47bed56f4
Bug: https://github.com/dart-lang/sdk/issues/39627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219560
Auto-Submit: Riley Porter <rileyporter@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-11-09 00:33:12 +00:00
Konstantin Shcheglov aaeb9e7acf Use check() and extensions for SourceChange/SourceFileEdit.
Change-Id: I7372fa152aa78fc6db01a11306a903e0ce38463e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219742
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-08 23:07:43 +00:00
Siva Annamalai 90749574b6 Revert "hints for text_direction_code_points"
This reverts commit 39008c8243.

Reason for revert: breaks G3 builds please see https://ci.chromium.org/p/dart/builders/ci.sandbox/google

Original change's description:
> hints for text_direction_code_points
>
> Fixes: https://github.com/dart-lang/sdk/issues/47611
>
> Related: https://github.com/flutter/flutter/pull/93034
>
>
> Change-Id: Ia6bac44e1c9a7ef25f01683b8414b9818822cb7f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219123
> Commit-Queue: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Kathy Walrath <kathyw@google.com>

TBR=lrn@google.com,brianwilkerson@google.com,pquitslund@google.com,sra@google.com,kathyw@google.com

Change-Id: I82c2b471bc9566222db4616bba501534c35b4f9e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219747
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-11-08 22:48:43 +00:00
Sam Rawlins 714560de7f analyzer: Erase much bool-checking code from checker.dart
This code is effectively dead. The code used to report invalid cast
errors, but these have 100% been replaced by non-bool errors
(NON_BOOL_OPERAND, NON_BOOL_EXPRESSION, NON_BOOL_NEGATION_EXPRESSION)
which are reported in resolution.

The (bizarre, in my opinion) exception of implicit casts for
instance creation expressions had to be moved to
bool_expression_verifier. This is to satisfy an existing test case:
tests/co19_2/src/Language/Expressions/Booleans/Boolean_Conversion/definition_t02.dart

Adds many implicit casts to pre-null safety tests to ensure test
coverage; there were no tests of the old "implicit cast" errors.
Removes one old test from checker_test.

Removes checkForCast, refactoring the method it calls, which
simplifies both null safe and pre-null safe checking.

Removes an unused parameter in _checkFunctionTypeCasts.

I did not add tests for &&= or ||=, which are still not part of the
language.

Change-Id: I64c95aa7b05fff352e85c4a54fd2dd836864de83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219721
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-11-08 22:37:03 +00:00
Konstantin Shcheglov c0aeb94e6b Remove CompletionTarget.unit, parts of OpType.
Change-Id: Ibf39abd01c7fa743944064e288588e66daf6f881
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-11-08 20:02:42 +00:00
Danny Tuppeny 00ca3283c0 [analysis_server] Correct sorting of fixes, inverting priorities to maintain order
Fixes https://github.com/Dart-Code/Dart-Code/issues/3646.

Change-Id: I9784bbda8aa62d3506810fc7768d58a4cd2bf064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219706
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-11-08 19:55:02 +00:00
Siva Annamalai 6ac890503b Revert "[VM/Service] Restructure the timeline flag setting code a bit to make it"
This reverts commit aed481664d.

Reason for revert: breaks build

Original change's description:
> [VM/Service] Restructure the timeline flag setting code a bit to make it
>              convenient for adding a Dart C API function for enabling
> 	     timeline streams.
>
> TEST=cq
>
> Change-Id: I885288914e700bfd91605d3d04bba3c0c217656d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219620
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

TBR=bkonyi@google.com,asiva@google.com

Change-Id: Ic2ec6094268f7e6c7a2892c9604dc7ca63603190
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219741
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-11-08 19:35:43 +00:00
asiva aed481664d [VM/Service] Restructure the timeline flag setting code a bit to make it
convenient for adding a Dart C API function for enabling
	     timeline streams.

TEST=cq

Change-Id: I885288914e700bfd91605d3d04bba3c0c217656d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219620
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-11-08 19:15:03 +00:00