Commit Graph

5124 Commits

Author SHA1 Message Date
Samuel Rawlins 5050f31b29 Revert "analyzer: Mark implicit-casts and implicit-dynamic as deprecated"
This reverts commit 6a54fdd46e.

Reason for revert: broke flutter-analyze

Original change's description:
> analyzer: Mark implicit-casts and implicit-dynamic as deprecated
>
> Also add a fix which replaces 'implicit-casts' with 'strict-casts' and
> a fix which replaces 'implicit-dynamic' with 'strict-raw-types'.
>
> Fixes https://github.com/dart-lang/sdk/issues/47902
>
> Change-Id: I293c3c1fd671ac85c12f9c050465b4d77632f241
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224800
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>

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

Change-Id: Ib2e9492716d3ff6da4fa4e1c64fd658451b16d88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239008
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-03-27 16:56:01 +00:00
Daco Harkes 532c116cd2 [vm] Implement NativeFinalizer
This CL implements `NativeFinalizer` in the GC.

`FinalizerEntry`s are extended to track `external_size` and in which
`Heap::Space` the finalizable value is.

On attaching a native finalizer, the external size is added to the
relevant heap. When the finalizable value is promoted from new to old
space, the external size is promoted as well. And when a native
finalizer is run or is detached, the external size is removed from the
relevant heap again.

In contrast to Dart `Finalizer`s, `NativeFinalizer`s are run on isolate
shutdown.

When the `NativeFinalizer`s themselves are collected, the finalizers are
not run. Users should stick the native finalizer in a global variable to
ensure finalization. We will revisit this design when we add send and
exit support, because there is a design space to explore what to do in
that case. This current solution promises the least to users.

In this implementation native finalizers have a Dart entry to clean up
the entries from the `all_entries` field of the finalizer. We should
consider using another data structure that avoids the need for this Dart
entry. See the TODO left in the code.

Bug: https://github.com/dart-lang/sdk/issues/47777

TEST=runtime/tests/vm/dart(_2)/isolates/fast_object_copy_test.dart
TEST=runtime/vm/object_test.cc
TEST=tests/ffi(_2)/vmspecific_native_finalizer_*

Change-Id: I8f594c80c3c344ad83e1f2de10de028eb8456121
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64c-try,dart-sdk-mac-arm64-try,vm-kernel-mac-release-arm64-try,pkg-mac-release-arm64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-nnbd-win-release-ia32-try,vm-ffi-android-debug-arm-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-mac-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,benchmark-linux-try,flutter-frontend-try,pkg-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-gcc-linux-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236320
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-03-26 09:41:21 +00:00
Ahmed Ashour f1ab934eaf Add fix for cascade_invocations lint.
Fixes #47957

Change-Id: Ic6bcbe86c7c9bf4434cef7eec0f2f4a44897f5c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238581
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-25 17:59:33 +00:00
Ahmed Ashour 59b7b8c818 create_constructor_super to use super initializers
Fixes #47979

Change-Id: Ic6131d43b74a5a48ad901e56c0de474a03e2d552
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-25 16:58:51 +00:00
Sam Rawlins 6a54fdd46e analyzer: Mark implicit-casts and implicit-dynamic as deprecated
Also add a fix which replaces 'implicit-casts' with 'strict-casts' and
a fix which replaces 'implicit-dynamic' with 'strict-raw-types'.

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

Change-Id: I293c3c1fd671ac85c12f9c050465b4d77632f241
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224800
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-03-25 14:58:50 +00:00
Brian Wilkerson 61954676ea Add code style options for code generation
Change-Id: Ibc5087aeb88965488502cca74923df6d7a2b185e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238761
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-25 04:47:31 +00:00
Konstantin Shcheglov ebcf8a37e4 Wait for applyPendingFileChanges() when resolveForCompletion().
Change-Id: I1d2d07f613cfa0221a15e3d7b9873cc3d8564ece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238502
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-24 17:51:01 +00:00
Danny Tuppeny e8837cb1a2 [analysis_server] Enable LSP completion snippets by default, and remove "preview" from flag
Change-Id: I04e656a57aad1cf6ca2e1aea3a378333a1388466
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-24 15:17:34 +00:00
Brian Wilkerson 2d884f89ed Convert two more handlers
Change-Id: I540a40b02c38a2692987f9856a2f9aa73e1199f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238462
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-24 14:11:51 +00:00
Brian Wilkerson 17769033cf Update error_fix_status
Change-Id: Ib99e216ff5fb63291d1b410ce5de6b479c52ad14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238382
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-23 18:11:31 +00:00
Ahmed Ashour 96e38b2618 Associate ConvertToListLiteral with DEFAULT_LIST_CONSTRUCTOR
Fixes #48644

Change-Id: Icf98ba5d5cc6e3be302a8914d4dc4bb24394ad92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-23 16:40:41 +00:00
Danny Tuppeny 13593b9ab4 [analysis_server] Don't include tabstops in parens for LSP completions with 0 parameters
Fixes https://github.com/Dart-Code/Dart-Code/issues/3873.

Change-Id: I66a5b18dcf0674454cfc820d6cdf0d84e4c4f547
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238088
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-03-23 00:09:18 +00:00
Konstantin Shcheglov 4f74a0d076 [analysis_server] Remove pendingFilesToRemoveOverlay when cancelling timer
This prevents an issue where the overlay can be removed unexpectedly because the watch event sees the old (cancelled) timer, and believes there is a pending removal, so removes it.

Change-Id: Ib193ba4d6b4ba3d55a0d793554a19476c8f40e47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238087
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-22 19:49:50 +00:00
Brian Wilkerson 25f309fa54 Extract handlers from CompletionDomainHandler
Change-Id: I2cfbce3cb4d21c145c4d37d909c7ee9a4e967f2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237881
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-22 18:58:48 +00:00
Brian Wilkerson 5b71e48f95 Handle another case of replacing a named constructor
Fixes: https://github.com/dart-lang/sdk/issues/47995
Change-Id: Ic4bc0e33af52cdf27427883faf8b79403038ca38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-22 18:58:08 +00:00
Danny Tuppeny f4b273e782 [analysis_server] Add an LSP refactor.validate command
This allows a client to trigger initial validation of a refactor before prompting the user for options.

Change-Id: I22fec7996c0c86a5245ccb0c41d23964bdb6f967
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-22 17:09:28 +00:00
Brian Wilkerson f6c0660c29 Fix the quick fix for super parameters when a named parameter has a different name than the super constructor parameter
Fixes: https://github.com/dart-lang/sdk/issues/48633
Change-Id: I856631253dda28e0c39ff844e95987bbe8a044b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237934
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-22 16:36:28 +00:00
Konstantin Shcheglov b14c3c3607 Add async methods for Cider.
Change-Id: I8e7ad68af11933748e40899789169fdcf58124e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238003
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-22 00:26:57 +00:00
Konstantin Shcheglov 3d69c3c0c4 Restore sync file methods in AnalysisSession.
There are clients, like `built_value` that cannot be updated.

Change-Id: I27371018039f22cd7ca2cb82b30ec33469aa6e4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238002
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-21 23:27:57 +00:00
Brian Wilkerson ba7c9505c4 Extract handlers from AnalysisDomainHandler
Change-Id: Iab9a0e6493563245a66aea58e16f0b58f3729529
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237854
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-21 21:38:57 +00:00
Brian Wilkerson b53a4982fe Extract handlers from EditDomainHandler
Change-Id: Ib6354c6cd3b983c74fcf1f911d788a38a8762bcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237851
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-21 16:17:37 +00:00
Keerti Parthasarathy a77ee421d9 Add support for documents symbols to Cider
Change-Id: I0fb225a09b4a4f12ee1440dd94ff3dc2d9363a82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237748
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2022-03-18 16:53:58 +00:00
Ahmed Ashour c51b09bd4e [analyzer] fix require_trailing_commas for assertions
Fixes #48605

Change-Id: I62b449b326827e6f289d90f96d8d7658d28d0615
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237694
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-18 15:58:48 +00:00
Konstantin Shcheglov 592bfc0174 Remove newDotPackagesFile(), related from file_paths, context location / manager.
Change-Id: I0f3c067b47e4d0f6171b8a26d34fc173df983c29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237637
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-17 17:40:16 +00:00
Keerti Parthasarathy a73357a995 Add a helper class to use kythe from cider.
Change-Id: I498cc5acc436b319f3b05641b24b37c106a80027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237181
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2022-03-17 17:23:46 +00:00
Ahmed Ashour 3ebb07c016 [analyzer] AddTrailingComma to handle FormalParameterList
Fixes #48578

Change-Id: If3f7d4e407512117729396ca7582f1923f55aab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-17 16:47:47 +00:00
Jens Johansen fd4e41a7af [parser-ish] Better errors on invalid unicode escapes
https://github.com/dart-lang/sdk/issues/48542

Change-Id: Icbdcc939a93c737914091c00aaefa3c4efb2dde0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237364
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-03-17 13:57:45 +00:00
Konstantin Shcheglov b2044efef7 Look for and build package_config.json files in PluginManager.
Change-Id: Iea851a2c773163a274b5ffc7259b2647aaa5099d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-17 03:48:23 +00:00
Konstantin Shcheglov bff94a4c3a Always provide 'isNonNullableByDefault' arguments for ErrorReporter.
Change-Id: If556a25d5ce6d0d33e55d2cf8fb2df950d3959a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237626
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-16 23:53:35 +00:00
Brian Wilkerson 844ca214c4 Correctly handle a trailing comma in convert_to_super_parameter
Change-Id: I8acfe80106666d9105f0c7a4c5e8c6352635e2bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237601
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-16 21:41:44 +00:00
Konstantin Shcheglov 408083ccad Use PluginFiles instead of List<String> in PluginManager.
Change-Id: I517830dfd388af6ac293ff7eea2ea8840c60fc01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-16 18:36:24 +00:00
Brian Wilkerson 519b391291 Do not convert field initializing parameters to super parameters
Change-Id: I2238b49fe9a872d5235108839fa60a98e6de3c09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237600
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-16 18:29:04 +00:00
Brian Wilkerson cd5933c833 Fix a false positive in convert_to_super_parameters
Unlike normal parameters, super parameters are visible in the body of
the constructor. So if the normal parameter is referenced it can't be
converted.

Change-Id: I6a48e0d6de896b25d7a9d25f6d20ae7ad01f82c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237502
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-16 04:19:03 +00:00
Brian Wilkerson 37e67cccfa Add a quick fix for convert_to_super_parameters
Change-Id: Ied50bcd6af6e0cf4871c8810c5b8466fa268bd86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237460
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-15 20:12:26 +00:00
Danny Tuppeny 094c598703 [analysis_server] Change empty linked edit groups to have placeholder text
Change-Id: Id687c4db11a1b43507f61e6d8ff5775ccccc819f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-15 20:03:33 +00:00
Danny Tuppeny 7d6c965fc9 [analysis_server] Handle InconsistentAnalysisException centrally in request handlers
Change-Id: I42de91467ad89e70560e63e27518df2a38ba45f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-15 19:38:53 +00:00
pq c305b6b6f0 bump linter to 1.20.0
Change-Id: I44ca585b3cf3649983955a2202c8fb093677329a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237184
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-03-15 17:09:22 +00:00
Brian Wilkerson aec5b376d8 Fix handling of named constructors in convert_to_super_parameters
Change-Id: If20d797cf8ad0c91d42e4d56e5cf7fecc1124e0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-15 00:35:18 +00:00
Brian Wilkerson 5eba89dc30 Rewrite the assist to convert to super parameters
The assist used to convert one parameter at a time, but now it will
convert all of the parameters that can be converted at the same time.

Change-Id: I862e0f89f55b4a76bb4347a93e8d94fdad556135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236920
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-03-14 20:05:44 +00:00
Konstantin Shcheglov e1e54ef807 Catch InconsistentAnalysisException in getParsedUnit() in server.
I see this exception happening in google3, probably because users
change this or other files, or watch events happening, or open / close
(maybe?) files. Anyway, this something that may happen, and the server
should handle it.

The way this CL handles it maybe not the best. By returning `null` we
basically fail the request - sometimes return `Response.fileNotAnalyzed`,
sometimes return empty results. We could retry, nad hope that no
file changes will happen next time. Or another next time, etc.

Change-Id: If4cc6fb2ea982115454568f36252d38777e69f85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237124
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-03-14 18:57:49 +00:00
Konstantin Shcheglov 6de7ea7432 Don't remove overlays immediately, wait for the next watch event.
Change-Id: Ie3352bf70010de88874aea122d83a5533a00a1ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-14 17:21:28 +00:00
Danny Tuppeny b9a7f00a9a [analysis_server] Add server snippets for classes, and test/groups in test files
Change-Id: I72758dba2967c678d96adbc9f7bbd4bd307caf67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237083
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-14 16:43:38 +00:00
pq 0d130c3148 fix for unnecessary_null_aware_assignments
Fixes: https://github.com/dart-lang/lints/issues/66

Change-Id: Ib14902c76910d550fbf69161a257d59cd268be9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-03-14 16:04:40 +00:00
Brian Wilkerson 2ce7aa3b16 Add a fix for the use_enums lint
Change-Id: I6f3e7b1c3f9b8b4ce7a1737130e3f98896b2123c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236981
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-14 15:58:40 +00:00
Danny Tuppeny 4b0706aec7 [analysis_server] Support multi-group snippets in LSP CodeActions
Fixes https://github.com/Dart-Code/Dart-Code/issues/3869.

Change-Id: Ib1925cc090fe62815c9257c72823c0e84d93efd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-10 20:35:35 +00:00
Konstantin Shcheglov 5fa65048c1 Use file_paths.pubspecYaml instead of 'pubspec.yaml' literal.
WDYT ?

Change-Id: I6677b2237e0558c74bb11073dcfb44d7b672323f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-10 19:03:55 +00:00
Danny Tuppeny 0de43ae5f7 [analysis_server] Make CompilationUnitElement.lineInfo non-nullable
Change-Id: Ia42e2a2fd153b5af167588b9d4d473d1f998a67b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-10 00:19:15 +00:00
Danny Tuppeny dd34c92da0 [analysis_server] Add snippets for for/for-in/while/do-while loops
Change-Id: Ie9f7a73ddf3e9661b91212cdafb95f34a9994cc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236244
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-09 21:44:05 +00:00
Konstantin Shcheglov 5ffba0a660 Remove unnecessary code for enum constants from AstBuilder, completion.
With https://github.com/dart-lang/sdk/issues/48380 fixed, we can simplify.

Change-Id: Ic453fe9e86af2f6cb437ff016a9b3786959b05d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236302
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-09 21:07:44 +00:00
Danny Tuppeny 13a6faf36c [analysis_server] Add snippets for if, if-else, switch, try-catch
Change-Id: I4146cf465817f46ffbec6e32630fd8425dcd0fd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-09 21:00:46 +00:00