Danny Tuppeny
75d15bbfa3
[analysis_server] Support formatter page width from analysis_options in legacy protocol
...
This adds the same support previously added to LSP to the legacy protocol.
As with LSP, the value in analysis_options overrides the explicit argument (since the expectation is that the user has not specifically chosen this value for this file, but rather as a default for the project/globally).
See https://github.com/dart-lang/sdk/issues/56864
[analyzer] Add support for "formatter" in analysis_options + use page_width in LSP
This adds support for validation + completion for `formatter/page_width` in analysis_options, and uses this value in preference to the client-supplied value in the LSP server.
It does not yet add support for the legacy protocol, and there are a few questions in https://github.com/dart-lang/sdk/issues/56864#issuecomment-2399289974 .
See https://github.com/dart-lang/sdk/issues/56864
Change-Id: Ic2be00087f78eb62c409dbc8f558d2f24b521f78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2024-10-08 17:31:46 +00:00
Danny Tuppeny
5d84439f5d
[analyzer] Add support for "formatter" in analysis_options + use page_width in LSP
...
This adds support for validation + completion for `formatter/page_width` in analysis_options, and uses this value in preference to the client-supplied value in the LSP server.
It does not yet add support for the legacy protocol, and there are a few questions in https://github.com/dart-lang/sdk/issues/56864#issuecomment-2399289974 .
See https://github.com/dart-lang/sdk/issues/56864
Change-Id: I7844e3abd1191beb9cc24197bbc8aa7c9e9ad4fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388822
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2024-10-08 16:37:54 +00:00
Alexander Thomas
d4aa30a3ba
Revert "analyzer: Write out qualified extension names in error messages"
...
This reverts commit 10c1d883df .
Reason for revert: g/dart-sdk-rolls/MOLCzv4S-kQ
Original change's description:
> analyzer: Write out qualified extension names in error messages
>
> Fixes https://github.com/dart-lang/sdk/issues/56269
>
> Change-Id: I025966fd4aa3d7c5b71175321f21f95e8c41f086
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388580
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
> Commit-Queue: Samuel Rawlins <srawlins@google.com >
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Change-Id: I613695e90c96e5ffdb4dc56e729dc34be385f5fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388823
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Auto-Submit: Alexander Thomas <athom@google.com >
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Alexander Thomas <athom@google.com >
2024-10-08 15:07:38 +00:00
Sam Rawlins
10c1d883df
analyzer: Write out qualified extension names in error messages
...
Fixes https://github.com/dart-lang/sdk/issues/56269
Change-Id: I025966fd4aa3d7c5b71175321f21f95e8c41f086
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388580
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2024-10-07 18:01:54 +00:00
FMorschel
3dc879f166
[DAS] Fix go to type definition for formal parameter
...
R=paulberry@google.com
Fixes https://github.com/dart-lang/sdk/issues/56844
Change-Id: Idb5c9420ecd9fda1d961c7211758721c4c4c7522
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388660
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2024-10-07 17:38:19 +00:00
Sam Rawlins
1fbeaa0d19
DAS: offer to import extension on null-aware access and unary op
...
Fixes https://github.com/dart-lang/sdk/issues/56328
Change-Id: I144d9ca92a93bcc72c2cdd2016fcb2784f2858ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388067
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2024-10-04 21:45:29 +00:00
FMorschel
79c0c75053
[DAS] Fix add type annotation assist for parameter types
...
R=srawlins@google.com
Fixes https://github.com/dart-lang/sdk/issues/37918
Change-Id: Iecf667e48cc42b06ea62c052c136b6f717657396
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388281
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2024-10-04 20:55:48 +00:00
FMorschel
9a23a0cad6
[DAS] Fixing swap with single Widget on children
...
R=pquitslund@google.com
Fixes https://github.com/dart-lang/sdk/issues/55940
Change-Id: I5cad91a97dcd9fe7b550b3661e8a46a301cbb558
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387862
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Auto-Submit: Felipe Morschel <fmorschel.dev@gmail.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2024-10-04 18:10:35 +00:00
Simon Binder
f58e0ed8aa
Don't suggest references to private enum fields
...
Some Dart code defines enums with private fields. This is useful to
indicate that the represented values might change in the future, and
should not considered to be exhaustive. Take this enum as an example:
```dart
enum ProtocolVersion {
v1,
v2,
_upcoming,
}
```
When code in a different library is switching over that enum, it can't
use the private member:
```dart
import 'protocol_version.dart';
ProtocolImplementation findImplementation(ProtocolVersion version) {
return switch (version) {
ProtocolVersion.v1 => LegacyProtocol(),
ProtocolVersion.v2 => NewProtocol(),
// Missing default case
};
}
```
At the moment, the analysis server would suggest adding a reference to
`ProtocolVersion._upcoming` to fix the switch expression, which is
invalid. The only way to fix the switch is to add a default expression,
which this change introduces instead.
Change-Id: Id38dbf206a25c11dcc53af50e19ac5dd1287637e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388005
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2024-10-03 23:45:06 +00:00
Parker Lougheed
a409a1c07d
[analyzer/linter] Use shared enumeration for lint names
...
This helps to avoid any accidental mispellings, enables find usages, and potentially makes future renames easier.
The primary goal is to make future work in https://github.com/dart-lang/sdk/issues/56835 easier.
Change-Id: I684630a4d6cb145031de0dabc221f247246ea00c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Auto-Submit: Parker Lougheed <parlough@gmail.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
2024-10-03 21:36:49 +00:00
FMorschel
2fd313b62a
fix renaming prefix
...
Fixes https://github.com/dart-lang/sdk/issues/56809
R=srawlins@google.com
Change-Id: I3df1f42923e7cb6382f7d6ad9875af6bb91a62a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Auto-Submit: Felipe Morschel <fmorschel.dev@gmail.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2024-10-02 20:58:13 +00:00
Konstantin Shcheglov
4fe2944776
Parts. Consider 'part' of 'part of lib.name' as an error.
...
Maybe? https://github.com/dart-lang/co19/issues/2907
Change-Id: If64ba74bf8d3ad3f5e1b926f19705ae469c76a5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387820
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2024-10-02 18:16:14 +00:00
Danny Tuppeny
927f2b7eb2
[analysis_server] Return empty document highlights instead of null when no matches
...
This partly fixes https://github.com/Dart-Code/Dart-Code/issues/5294 , in that it prevents VS Code falling back to a text search which gives confusing results.
However, because we don't produce any occurrences for record field names (because they are built on `Element`s which don't exist here), it also doesn't highlight the complete symbol name under the cursor like it would for other symbols (not does it highlight other references to the same record field in surrounding code). I'll follow up on the issue about this because it would also be nice to handle them.
Change-Id: I11f89d222d727cf73adf4a067ac00ca0cb5b1ebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2024-10-02 16:02:38 +00:00
Fedor Shcheglov
4366f822b6
Issue 56558. Fixed encapsulate_field to work with dynamic and prefixed types.
...
Bug: https://github.com/dart-lang/sdk/issues/56558
Change-Id: I59cce649a2f7989804e4dfd580cf2041c89fbe3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385322
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2024-10-01 16:43:49 +00:00
FMorschel
480756dad3
[DAS] Test for aliased import add show
...
Fixes https://github.com/dart-lang/sdk/issues/45993
Since the recent change in this class the behaviour is working as intended. Simply added a test to make sure future changes don't break this by mistake.
R=srawlins@google.com
Change-Id: Ie978690ecad0731ace001d74c6ab2dd623681aa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387529
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Auto-Submit: Felipe Morschel <fmorschel.dev@gmail.com >
2024-10-01 00:34:43 +00:00
FMorschel
7b502b1e63
Fix extension type import library
...
Closes https://github.com/dart-lang/sdk/pull/56781
Fixes https://github.com/dart-lang/sdk/issues/55443
GitOrigin-RevId: b6d7b3dab49964bb0fc6e2a3abdc643df5023d97
Change-Id: I708da5d01ccae45cc7d143e4fac365fb2c84e31e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386701
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2024-09-30 19:44:57 +00:00
FMorschel
6298d95a51
Invert conditional expression assist
...
Closes https://github.com/dart-lang/sdk/pull/56714
Fixes https://github.com/dart-lang/sdk/issues/45853
GitOrigin-RevId: 7afb370aee8cabaac337ffaaa08248df6d2e1570
Change-Id: I86730c45f2025653bca013f4a81d6ebab06bad3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384960
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2024-09-30 19:36:55 +00:00
FMorschel
83c26333a2
[DAS] Consider two lint rules when offering "add import" refactorings
...
Taking into consideration `prefer_relative_imports` and `always_use_package_imports` for adding import options to the assists list.
When neither is set, both will appear always showing package imports first. If both are set we will treat this as if only `always_use_package_imports` is and show only package imports.
Fixes https://github.com/dart-lang/sdk/issues/56800
R=scheglov@google.com
Change-Id: If2353479de91f50c6c44eb7a17487fb6d0d6f681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Auto-Submit: Felipe Morschel <fmorschel.dev@gmail.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-09-30 19:17:36 +00:00
Konstantin Shcheglov
e3e0275e2c
Elements. Migrate DataDriven.
...
Change-Id: I355e846224549ca2795fee9f9d2b8ae7a4be32e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387351
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-09-30 00:48:03 +00:00
Konstantin Shcheglov
4f1161e1d9
Elements. Migrate AddRequiredKeyword.
...
Change-Id: I82165c4afbade8430e97ef00c1b89181f6de3f6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386979
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2024-09-28 16:32:41 +00:00
Konstantin Shcheglov
7d6d5448dc
Elements. Migrate AddExplicitCall.
...
Change-Id: Idccff2640ec19806cfd3231c5c618c5b84950ad8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386972
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
2024-09-27 18:59:58 +00:00
Konstantin Shcheglov
c58d9319be
Completion. Issue 56783. Suggest non-assignable members when not in LHS of assignment.
...
Bug: https://github.com/dart-lang/sdk/issues/56783
Change-Id: I5e190bd0ebf59e5771d394eb5a72600d40a02a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386683
Reviewed-by: Keerti Parthasarathy <keertip@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2024-09-27 17:55:31 +00:00
FMorschel
30a57b2b47
Fix convert to cascade
...
Closes https://github.com/dart-lang/sdk/pull/56788
GitOrigin-RevId: 7e35273490dd1c99275251577f8a715957170806
Change-Id: I49af5c39267d6b91cfca40b4feb42e1d921a4eeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
2024-09-27 16:16:09 +00:00
Konstantin Shcheglov
86c5a93832
Elements. Migrate AddAsync.
...
Change-Id: I46cc11d3db84b53d873cbf366ccd3db8cbc1f153
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387143
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2024-09-26 20:24:52 +00:00
pq
13d84fea3f
(new) formatter language version-aware migrations
...
(Testing to follow.)
See: https://github.com/dart-lang/sdk/issues/56685
Change-Id: I9da0e3868cd3c873c41e8a19a77fad58b9b8dea0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386901
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2024-09-26 18:30:41 +00:00
Ben Konyi
12d9f40961
Reapply "[ CLI ] Don't disable DDS when --disable-dart-dev is provided"
...
This reverts commit 9f5246e8c6 .
TEST=Existing tests
Change-Id: I658290f248d8b26c05f24b7125c3ba71de318bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385121
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Ben Konyi <bkonyi@google.com >
2024-09-26 15:29:05 +00:00
Sam Rawlins
f84a81002c
linter rules: tidy up test support
...
Just little things:
* Convert the class AnalysisOptionsFileConfig and it's `toContent`
method into a single function.
* Convert the class PubspecYamlFileConfig and it's `toContent` method
into a single function.
* Privatize ExpectedDiagnostic fields `diagnosticMatcher`, `offset`,
`length`, `messageContains`,
ExpectedError field `codes`,
ExpectedLint field `lintName`,
LintRuleTest field `collectionIncludedPaths`,
_ContextResolutionTest field `sdkRoot`.
* Privatize `writeTestPackageAnalysisOptionsFile` and
`writeTestPackagePubspecYamlFile`
* Start doc comments with a single-sentence summary (https://dart.dev/effective-dart/documentation#do-start-doc-comments-with-a-single-sentence-summary and https://dart.dev/effective-dart/documentation#do-separate-the-first-sentence-of-a-doc-comment-into-its-own-paragraph )
* Document with third-person verbs (https://dart.dev/effective-dart/documentation#prefer-starting-function-or-method-comments-with-third-person-verbs )
Change-Id: I7d584810cd339f8184fe14c3151b55988bf2cfff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2024-09-26 14:33:04 +00:00
FMorschel
dbf87d8644
Improving string conversion
...
Closes https://github.com/dart-lang/sdk/pull/56723
GitOrigin-RevId: 802fda7efeace66f33a82fa939a3efac11064390
Change-Id: I6d4d3931e62b89265eb1d324856bed5b9febfe8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384962
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2024-09-25 21:11:17 +00:00
FMorschel
a0374dd70c
Fix create method/function inside conditional operator
...
Closes https://github.com/dart-lang/sdk/pull/56722
GitOrigin-RevId: 9a861d4078b326754b8855e833c52ede03f0e28d
Change-Id: Ia7535ff48c16836b0e7d3a32005051c7defc3766
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384941
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2024-09-25 20:51:54 +00:00
Danny Tuppeny
c8adf3da3f
[analysis_server] Update color handling for recent Flutter Color class changes
...
In https://github.com/flutter/engine/pull/54714 the "int value" that was used for storing the color values for a Flutter color was removed and replaced with `double red, double green` etc.
The color computer used the `value` field so this stopped it from computing any colors for previews in LSP clients. No tests broke because the tests here use a mock version of the Color class that still had `value`.
This change updates the mock Color class to match the new Flutter implementation, and updates the computer to use the red/green/blue doubles instead of parsing from an int.
It also adds support for the new `Color.from()` constructor that was also recently added.
Fixes https://github.com/Dart-Code/Dart-Code/issues/5289
Change-Id: I3ff20bda0cc848e028822cfcb5a14e6a8f6934d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386802
Commit-Queue: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
2024-09-25 16:27:51 +00:00
Parker Lougheed
46cd8b627c
[linter] Move old lint details out of source
...
- Makes way for slowly replacing them with new "why" docs.
- Slightly reduces snapshot size of analysis server
- Colocates docs in the new linter/messages.yaml file.
Change-Id: I8708b8b55455a183ccfa5c9d8c21098ae0655b51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385304
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Auto-Submit: Parker Lougheed <parlough@gmail.com >
2024-09-24 23:06:34 +00:00
Fedor Shcheglov
9f4bb0d654
Issue 56559. Remove @override from private field, add to getter/setter.
...
Bug: https://github.com/dart-lang/sdk/issues/56559
Change-Id: I57e9c5e286af520499ddddeee5818f1c22a94ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2024-09-23 18:13:45 +00:00
pq
2c73635d00
[wildcards] fix ConvertToWildcardVariable to convert variable references
...
Change-Id: Ie9b9d03adf11bf2e18d5a3da6e28be8abf4eb53d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384943
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2024-09-23 16:53:11 +00:00
FMorschel
26a035d692
Fix remove-unnecesary-parentheses quick-fix false negative
...
Closes https://github.com/dart-lang/sdk/pull/56746
GitOrigin-RevId: 3e296b4b88b91d671e4e061ae8613f9b09d7f2f5
Change-Id: Ib174df2b3d825129c22eab71f2c7f38d88a66781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2024-09-23 15:04:44 +00:00
Lasse R.H. Nielsen
f24162c8bc
Let unintended_html_in_doc_comments ignore DartDoc links.
...
A link of `... [List<int>] ...` is now considered non-HTML,
and doesn't trigger the lint.
This is how DartDoc interprets the text.
Change-Id: I974e0ace31c3d7bf5f57b854c7b887a95684158d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384840
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Kallen Tu <kallentu@google.com >
Commit-Queue: Lasse Nielsen <lrn@google.com >
2024-09-18 14:22:11 +00:00
FMorschel
00a1608bd8
Add fix for use_colored_box
...
Closes https://github.com/dart-lang/sdk/pull/56702
GitOrigin-RevId: 1e043e03da0b43f7f7ab3365f16fe557689a712c
Change-Id: I7fff9c1d0f7c479890625b16b3beed449d504436
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384662
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2024-09-17 18:37:54 +00:00
Parker Lougheed
4819bd09aa
[analyzer/linter] Deprecate LintRule.details to avoid new usages
...
Change-Id: I3d03d5f06901e0a548020522387e8984507a7f4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
2024-09-13 18:13:26 +00:00
pq
86306b194e
fix test expectation doc typo
...
Change-Id: I57aeac20269a2527e81822a550d483ab34064c6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
Auto-Submit: Phil Quitslund <pquitslund@google.com >
2024-09-12 22:18:46 +00:00
Sam Rawlins
b1416116b7
analyzer: rename most API references to 'plugins' to 'legacy plugins'
...
Change-Id: I56217045ff9d4da8a5a556cd709e0f63a507884f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384964
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2024-09-12 21:25:56 +00:00
pq
9d1c3c9d42
[parts] enable experimentsForTests for all LSP server tests
...
Change-Id: I213292c4392a1c54f4ecfa059033d405d2d7b73a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384826
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Auto-Submit: Phil Quitslund <pquitslund@google.com >
2024-09-12 16:18:20 +00:00
Ben Konyi
9f5246e8c6
Revert "[ CLI ] Don't disable DDS when --disable-dart-dev is provided"
...
This reverts commit 81b9957bdd .
Reason for revert: Breaking multiple configurations.
Original change's description:
> [ CLI ] Don't disable DDS when --disable-dart-dev is provided
>
> Fixes https://github.com/dart-lang/sdk/issues/56605
> Fixes https://github.com/dart-lang/sdk/issues/54841
>
> TEST=N/A
>
> Change-Id: I6a13afe5f51fe67d2366c6d87ae74473651e24c8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383780
> Commit-Queue: Ben Konyi <bkonyi@google.com >
> Auto-Submit: Ben Konyi <bkonyi@google.com >
> Reviewed-by: Johnni Winther <johnniwinther@google.com >
> Reviewed-by: Phil Quitslund <pquitslund@google.com >
Change-Id: I5c6cb302d8160f19bad437341cdcd80bcc08d921
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384881
Reviewed-by: Siva Annamalai <asiva@google.com >
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com >
Reviewed-by: Derek Xu <derekx@google.com >
Auto-Submit: Ben Konyi <bkonyi@google.com >
Commit-Queue: Siva Annamalai <asiva@google.com >
2024-09-12 01:15:27 +00:00
Ben Konyi
6f1887a1f2
[ DDS ] Fix tests broken by https://dart-review.googlesource.com/c/sdk/+/383780
...
TEST=N/A
Change-Id: I50e12596ebb7dc687e4c3d408104e450c3e91c3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384900
Commit-Queue: Ben Konyi <bkonyi@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
2024-09-11 21:08:58 +00:00
Danny Tuppeny
0ed690798d
[analysis_server] Replace URI fields in tests with getters to avoid having to set all paths twice
...
This is a minor refactoring to swap some fields for URIs to getters so that any tests that modify them don't have to set both a path and URI (or risk them being out-of-sync).
Change-Id: Ic3776d250f4cfd9b0f16a7fc578ab5e7f19e52a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2024-09-11 20:14:23 +00:00
Danny Tuppeny
e7442b7066
[analysis_server] Add a semantic token modifier to wildcards
...
Also fixes top-level variable declarations to be treated as variables and not properties (see https://github.com/dart-lang/sdk/issues/55956 ).
Fixes https://github.com/dart-lang/sdk/issues/56567
Change-Id: I899ce4fc5950369acae70517d76a2830fe082731
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384746
Commit-Queue: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
2024-09-11 18:59:55 +00:00
Ben Konyi
81b9957bdd
[ CLI ] Don't disable DDS when --disable-dart-dev is provided
...
Fixes https://github.com/dart-lang/sdk/issues/56605
Fixes https://github.com/dart-lang/sdk/issues/54841
TEST=N/A
Change-Id: I6a13afe5f51fe67d2366c6d87ae74473651e24c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383780
Commit-Queue: Ben Konyi <bkonyi@google.com >
Auto-Submit: Ben Konyi <bkonyi@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
2024-09-11 18:01:25 +00:00
pq
c386f13a83
[enhanced-parts] Code Folding tests
...
Fixes: https://github.com/dart-lang/sdk/issues/56696
Bug: https://github.com/dart-lang/sdk/issues/56696
Change-Id: I20011f1c60bab29d8ed6e78be70b6f807dce03f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2024-09-11 17:33:51 +00:00
Sam Rawlins
5ee4eb52e6
DAS plugins: Add plugin package generator
...
This generator will be used create shared plugin package entrypoints from
plugin configurations.
Work towards https://github.com/dart-lang/sdk/issues/53402
Change-Id: If5c6aeb7bc7845311975928fba1cb9c8d273423c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384681
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2024-09-11 16:54:29 +00:00
Paul Berry
cda2815bb1
Add UNREACHABLE_SWITCH_DEFAULT warning to the analyzer.
...
This warning is similar to the existing `UNREACHABLE_SWITCH_CASE`
warning, except that it warns if the `default` clause of a switch
statement is unreachable due to all the `case` clasuses fully
exhausting the switched type.
To make the implementation easier, I changed the API for the
`reportExhaustiveness` method in `_fe_analyzer_shared` (which is the
primary entry point to the shared exhaustiveness checker). Previously,
this method returned a list of `ExhaustivenessError`, where each list
element was either an `UnreachableCaseError` (indicating that a
certain case was unreachable) or a `NonExhaustiveError` (indicating
that the entire switch statement was not exhaustive). If the caller
passed in `false` for `computeUnreachable`, `UnreachableCaseError`s
would not be returned, so the returned list would either be empty or
contain a single `NonExhaustiveError`.
The new API renames the types for clarity:
- `NonExhaustiveError` becomes `NonExhaustiveness`, to highlight the
fact that it's not necessarily an error for the switch's cases to be
non-exhaustive; it's only an error if the scrutinee's static type is
an "always exhaustive" type and there is no `default` clause.
- `UnreachableCaseError` becomes `CaseUnreachability`, to highlight
the fact that it's not an error for a case to be unreachable; it's a
warning.
Also, the new API adds instances of `CaseUnreachability` to an
optional user-provided list instead of returning a newly created list;
this allows callers to communicate that they don't need to see
`CaseUnreachability` information by passing `null`. This frees up the
return type to simply be an instance of `NonExhaustiveness` (if the
cases are not exhaustive) or `null` (if they are exhaustive). This
makes it easier for the analyzer to decide whether to issue the new
warning, because it doesn't have to dig around the list looking for an
instance of `NonExhaustiveness`.
The new warning has an associated quick fix (remove the unreachable
`default` clause). This quick fix uses the same `RemoveDeadCode` logic
in the analysis server that the existing `UNREACHABLE_SWITCH_CASE`
warning uses.
Fixes https://github.com/dart-lang/sdk/issues/54575 .
Bug: https://github.com/dart-lang/sdk/issues/54575
Change-Id: I18b6b7c5249d77d28ead7488b4aae4ea65c4b664
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378960
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Erik Ernst <eernst@google.com >
2024-09-10 19:13:12 +00:00
pq
1bdb366d4d
[enhanced-parts] test “Organize Imports”
...
Fixes: https://github.com/dart-lang/sdk/issues/56683
Change-Id: I6b6aae385d4313e551f7c110e1e2544cc418a5a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384308
Commit-Queue: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Auto-Submit: Phil Quitslund <pquitslund@google.com >
2024-09-10 17:23:40 +00:00
pq
ecbf9ee568
[enhanced-parts] test "Sort Members" in a part w/ imports
...
Fixes: https://github.com/dart-lang/sdk/issues/56684
Change-Id: I259090327e82926d1c01dae1ce11b328e3f2e7cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384309
Commit-Queue: Phil Quitslund <pquitslund@google.com >
Auto-Submit: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2024-09-10 16:57:11 +00:00