Commit Graph

475 Commits

Author SHA1 Message Date
FMorschel f2776dfab1 [DAS] Fixes no parenthesis when inlining variables in literal expression
Fixes: https://github.com/dart-lang/sdk/issues/60761
Change-Id: Ide0f446712e5cda235e82bf69030bdc24c1441fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430001
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-21 10:13:31 -07:00
Sam Rawlins b40b806bee DAS: enforce unnecessary_async lint rule
Change-Id: I05c6fbcc5ea7dea37bb7a01a3492e5cd842d11ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428923
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-16 13:37:53 -07:00
Sam Rawlins bd700772ff analyzer: move testing utilities to analyzer_testing package
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: Iae062d95e5cf3b94b540496242b3627268ac2612
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428844
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-15 16:28:50 -07:00
Konstantin Shcheglov 05da3e1f22 Elements. Deprecate Element.enclosingElement2, use enclosingElement.
Change-Id: I055b1f9dd1c00605d813effcbbadb9cea874129a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-15 13:47:32 -07:00
Sam Rawlins 3021cc4913 analyzer: Move PackageConfigFileBuilder to public API.
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: I3df2cd374f6b3ef9e027f0e07c748be6ea21ebb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427586
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-09 10:57:55 -07:00
FMorschel 576668104d [DAS] Adds test for renaming parameter parameter name
Fixes: https://github.com/dart-lang/sdk/issues/60578
Change-Id: Ie940bebc36e6d37875d7972df56d4c673747df60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-05-02 15:01:04 -07:00
Konstantin Shcheglov 2cf84f8053 Elements. Rename most XyzElementImpl into XyzFragmentImpl.
Change-Id: I7902ccedd9d3e9ccde1091eb28aad98591791b6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-28 08:35:25 -07:00
Konstantin Shcheglov b2fdd8a345 Elements. Rename XyzElement2 into XyzElement.
The CL was done with rename + adding typedef for each class.

Change-Id: Ia25cc581d2e42cf7d12a85a3579af952d5c232ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424687
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-25 13:27:18 -07:00
Konstantin Shcheglov 49599e06cc Elements. Deprecated element2.dart library.
Change-Id: I2be38df49e6f242d9fe59f34164549da4a0f41b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424683
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-25 11:23:18 -07:00
Danny Tuppeny 226ec8413e [analysis_server] Pre-emptively opt some tests out of newline normalization
Currently newline normalization is opt-in for server tests because there are many tests that fail when the newlines are normalized to the current platform. This change pre-emptively opts-out a number of tests that fail so that the default can be flipped, and then these tests could be worked through.

See https://github.com/dart-lang/sdk/issues/60234

Change-Id: I19f5121612fbc9da18ad0edbe631549e04553e6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423800
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-04-22 10:21:00 -07:00
Sam Rawlins 5eef8e4ebe analyzer etc: move analysisOptionsContent function to be shared
This function was defined once in analyzer testing code, once in
linter testing code, and once in analysis_server testing code. In this
change, all three are combined into one function in analyzer_utilities.

Change-Id: Ib2daa7b3d14aae6ca2aa09f6f9bdeaf76bc72d10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423068
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-04-21 13:01:36 -07:00
FMorschel 725553b5b9 [DAS] Fixes renaming error and stack in try-catch
Fixes: https://github.com/dart-lang/sdk/issues/60345
Change-Id: I8dc4741f30ed17499b834d857043824fa1c25ad0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416440
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-03-27 13:55:38 -07:00
Brian Wilkerson 1d99b136d4 [cq] Cleanup extract_widget_test
This also removes some unused code in the assist processor test
framework.

Change-Id: I07fce90d2cc099f11a22fbaa66d2ed9a3b589af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417883
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-03-25 14:05:43 -07:00
FMorschel dc2b368732 [DAS] Fixes refactor rename wrong conflict error
Fixes: https://github.com/dart-lang/sdk/issues/60315
Change-Id: I1974580be8805dd83c9d2895860fb6eed825ccca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415941
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-03-25 13:50:32 -07:00
Brian Wilkerson d37521aad7 [cq] Clean up one server test class
This change converts all of the tests to use the `TestCode` approach to
marking positions and ranges, which makes them more consistent and more
readable. It also means that offset-based tests can now be run on the
Windows bot without failure (though this CL doesn't change which tests
are run there and which aren't).

In the process I combined `indexTestUnit` into `_createRefactoring`,
removing one line of code from each of the tests, reducing the visual
clutter.

Change-Id: I02f0d0f46f3965b243abea01828f61a19d276aba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417300
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-03-21 10:50:22 -07:00
FMorschel f276d3c65b [cq] Using TestCode and normalizeSource for quick-fix tests
This change introduces `TestCode` and `normalizeSource` into the tests for quick fixes. The goal is to add these capabilities to `AbstractSingleUnitTest`, allowing a future update to replace offsets in tests with markers.

Bug: https://github.com/dart-lang/sdk/issues/60234
Change-Id: I760e6b5fb13b37d4e35278073a78f4d755deda64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415260
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-03-19 17:35:20 -07:00
Konstantin Shcheglov bb676ba1f5 Elements. ElementImpl is not Element2.
Change-Id: Ia8885018d3e23875e53dfa0d3cf470bdd28eef29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-03-17 08:46:49 -07:00
Brian Wilkerson 38d8834c07 [cq] Reduce assignments to testCode to 1
The purpose for this change is to make it easier to use `TestCode` to
parse the code under test. This, in turn, will allow us to use the same
markdown in all of our test code, making it easier to write and read
our tests. This biggest blocker to that goal is the fact that we assign
to `testCode` in several places, and that's the problem solved by this
change.

Change-Id: Id88463925587ff0839fe75faf6a1d083a1b3320c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415700
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-03-15 07:34:29 -07:00
FMorschel fcf79e06ce [DAS] Adds working rename when shadowing global variable is assigned
R=srawlins@google.com

Bug: https://github.com/dart-lang/sdk/issues/59954
Change-Id: I39417d9e712a40b6992fbad86180c257e782e04a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/414200
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-03-14 07:38:48 -07:00
FMorschel 1ce0b0e7ec [analyzer] Adds new warning for multiple combinators
Fixes: https://github.com/dart-lang/sdk/issues/56879
Change-Id: Ifd53878e3603090efa7905b3cd021b8a63344c26
Tested: trybots
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-03-10 15:43:12 -07:00
FMorschel 82c3d74505 [DAS] Renaming positional parameters to rename hierarchy equivalent
Fixes: https://github.com/dart-lang/sdk/issues/53187
Change-Id: Ie0aaea2e24667ad04a95ce6522fd687710501230
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-03-07 10:29:44 -08:00
FMorschel 83a16ea8a7 [DAS] Fixes renaming fields at constructor parameters
Fixes: https://github.com/dart-lang/sdk/issues/52305
Change-Id: I39a547c391ffd3538b3ccaafeab3af65bb4088b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413340
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-03-07 09:27:32 -08:00
FMorschel 50ff1c349c [DAS] Fixes rename field add this to fix shadowing
R=srawlins@google.com

Fixes: https://github.com/dart-lang/sdk/issues/59954
Change-Id: I860e48989566a09ea09092ddd1771be61f89121b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413901
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-03-06 10:15:43 -08:00
Konstantin Shcheglov 4bd9df1e2b Elements. Remove support for augmentations and methods.
We don't support augmentations feature yet, and it turned out to be
complicated finishing migration while keeping the current implementation.

Change-Id: I035ecfa74cc107bd9d21a935f76d92987835f542
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413940
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-03-06 09:26:29 -08:00
FMorschel f7d62a5ec6 [DAS] Fixes rename FieldFormalParameter outside library
Fixes: https://github.com/dart-lang/sdk/issues/60182
Change-Id: Ic833f07f2158bedcd196e06a7feebc761109fdef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-03-04 14:24:29 -08:00
Brian Wilkerson e8e56ff2f5 Cleanup declarations in server with trailing digits
There are still lots of declarations whose name ends in a trailing
digit, but most of them are unrelated to the migration, and some
are required in order to not break internal code.

I'm happy to break this up into smaller CLs if it's hard to review.
Mostly it's just renaming some declarations, although there are one or
two places where I did a little more clean-up.

Change-Id: I50d32316e82e48c6a5a47aec630b4ffee2ead2c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410922
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-02-23 08:17:36 -08:00
Brian Wilkerson 0ebec968c9 [migration] rename.dart
This also migrates all of refactoring.dart except for one getter that's used internally.

Change-Id: If11f30d740c02509e3eeeac90268b14540e3e0a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-20 13:40:40 -08:00
FMorschel 8f79645456 [DAS] Fixes closure cases for inline method refactor
R=scheglov@google.com, pquitslund@google.com

Fixes: https://github.com/dart-lang/sdk/issues/60160
Change-Id: Ie6313a92d5e4326b81ad0f277c5a8ff2c264ca39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410603
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-02-19 10:24:07 -08:00
Brian Wilkerson c38b8bb007 [migration] abstract_rename.dart
Change-Id: I90dc69640a15a8cdf14dc7fa2fb486f30e547445
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410181
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-14 14:38:29 -08:00
FMorschel 1a0b1fe496 [DAS] Fixes renaming closure parameter
R=scheglov@google.com

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

Change-Id: I24b62213c6ef81e76603e7bffabe463c9ca96dcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408140
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-02-12 12:48:28 -08:00
Konstantin Shcheglov 6e17841614 Macro. Remove tests from analyzer/ and analysis_server/.
Change-Id: Iabe04d7ff8fe0cc9b605d0c18fd47591fd02d6bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406681
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-29 14:58:19 -08:00
Konstantin Shcheglov 8bbe6fbdfe Elements. Report analyzer_use_new_elements without any txt file, add file ignores.
Change-Id: I13125f93a6633563ed6853a622bd9fec045bfc0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403923
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-10 15:20:59 -08:00
Konstantin Shcheglov 810eeb4465 Elements. Migrate lib/src/dart/ast/element_locator.dart
Change-Id: I7b57a239cd21737292224d05b38b86a0dbd4643c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403642
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-08 13:21:29 -08:00
pq a1f5ee9861 [element model] migrate abstract_single_unit
Change-Id: I6d717985cb6d8ddafb0f7d8b9e1428f1c5f1fa21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403484
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-01-07 14:23:57 -08:00
Konstantin Shcheglov 2d23904694 Issue 57018. Fix for inlining a getter when it is the target of a prefixed identifier.
Bug: https://github.com/dart-lang/sdk/issues/57018
Change-Id: I5a421d21e12b6b830796383a5dcb97dd01f3dac1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-03 08:35:48 -08:00
Konstantin Shcheglov 5dc0e3cd3d Issue 57019. Fix for inlining method expression into interpolation.
Bug: https://github.com/dart-lang/sdk/issues/57019
Change-Id: Ib69093db3fdfb6e8f4cf3d7a8e6036fda59faf97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402587
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-02 16:25:58 -08:00
Konstantin Shcheglov 9f82b8595d Elements. Migrate Change Method Signature refactoring.
Change-Id: I909adf258183d56be98895e07585ab079feafe6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401940
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-12-19 14:06:50 -08:00
Konstantin Shcheglov 6494efb192 Elements. Use identical() to compare ElementImpl(s).
Change-Id: Idbe935bc6ae333d9940d8ea53ad44011eff237ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401384
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-12-18 14:25:00 -08:00
Keerti Parthasarathy 023473dc6c [Element model] Migrate rename_import_test.dart
Change-Id: I5ef2722b095f4bbda6598e69c459c011e5005ae3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-12-13 08:42:23 -08:00
Brian Wilkerson ae0ffeecf9 Migrate 3 rename refactor tests
Change-Id: I3c7943d4219ae5a228e0cb022d319ef3ec38803c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400001
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-12-10 22:51:20 +00:00
Danny Tuppeny 91c05b2bbb [analysis_server] Use generic function syntax for function parameters in "Extract Method"
This fixes an issue where parameters that used the new function syntax and had no parameter names would produce code like `void f(String )` where the type would be interpreted as a parameter name and typed `dynamic`.

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

Change-Id: Ifcbe64dadb88cc0fd9b4fa3637045bcdc343f3f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-12-02 18:26:34 +00:00
Brian Wilkerson b49464c885 Migrate inline_method
Change-Id: Iff0d8dac16c0ea8ede807a393276b980d4d5a7f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397101
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-11-22 19:43:19 +00:00
Brian Wilkerson cc99ae937a Migrate convert_getter_to_method and convert_method_to_getter
Change-Id: I550022d206f0043789551280b35a1768557cfe61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396625
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-11-21 23:11:16 +00:00
Brian Wilkerson 34d945cb7c Migrate more server tests
Change-Id: Iee3e6b6db9c58e9fcf790e2874f73c8eac6e660d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395404
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-11-15 21:57:47 +00:00
Konstantin Shcheglov 359aa743ff Elements. Add LibraryElement2.uri
We used it often enough, and the question "what is the URI of the library" makes sense.

Change-Id: I58baebd7b32154ae7a2f90770e4edcade8a49a63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-15 21:52:00 +00:00
Brian Wilkerson 843c47b9a1 Migrate more tests in analysis_server
Change-Id: I14885a2b5ea4fd89b14ae52124d800a2b24ccad0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395401
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-11-14 21:45:50 +00:00
Sam Rawlins fbf331e0dd DAS: reformat source code with tall-style
Change-Id: I42b4a44fd6a2197e499e8623274b3cd1a4b5556f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394003
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-06 23:04:00 +00:00
Robert Nystrom 732b07a42b Roll dart_style into the SDK.
I'm still chasing down a couple of google3 failures, but this is ready for review so that I can get it approved and land it once the last couple of failures are fixed. Here is who I think should review what:

athom@ for:

- DEPS

johnniwinther@ for:

- pkg/_fe_analyzer_shared
- pkg/front_end
- pkg/kernel

brianwilkerson@ for:

- pkg/analysis_server
- pkg/analyzer_plugin
- pkg/analyzer_utilities

kenzieschmoll@ for:

- pkg/dartdev

pquitslund@ for:

- pkg/linter/lib/src/lint_codes.g.dart

If you're not the right person, feel free to summon someone else.

Most of the changes here are re-running code generators that auto-format the code they generate. The changes are:

Roll in the latest dart_style commit:

- DEPS

Manually updated these test expectations to expect the new style:

- pkg/analysis_server/test/lsp/format_test.dart
- pkg/analysis_server/test/services/refactoring/agnostic/change_method_signature_test.dart
- pkg/analysis_server/test/src/domains/flutter/set_property_value_test.dart
- pkg/analysis_server/test/src/services/flutter/container_properties_test.dart
- pkg/analysis_server/test/src/services/flutter/widget_descriptions_test.dart
- pkg/analysis_server/test/src/services/refactoring/convert_selected_formal_parameters_to_named_test.dart
- pkg/analysis_server/test/src/services/refactoring/move_selected_formal_parameters_left_test.dart

This was auto-generated by something, but I'm not sure why it thinks there is a diff:

- pkg/analyzer_plugin/doc/api.html

Updated to require a version of dart_style that accepts a language version in DartFormatter():

- pkg/analyzer_plugin/pubspec.yaml

Updated to always use the latest language version (and thus new style) when invoking the formatter:

- pkg/analyzer_utilities/lib/tools.dart

Manually updated the formatting in the code templates so that they matched the formatting expected by the tests, which implicitly format using the latest language version:

- pkg/dartdev/lib/src/templates/...

The rest are all generated files that are formatted so re-generated using the new style:

- pkg/_fe_analyzer_shared/lib/src/experiments/flags.dart
- pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
- pkg/analysis_server_client/lib/handler/notification_handler.dart
- pkg/analysis_server_client/lib/src/protocol/...
- pkg/analysis_server/lib/protocol/protocol_generated.dart
- pkg/analysis_server/test/integration/support/integration_test_methods.dart
- pkg/analysis_server/test/integration/support/protocol_matchers.dart
- pkg/analyzer_plugin/lib/protocol/...
- pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart
- pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
- pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart
- pkg/analyzer/lib/src/dart/error/...
- pkg/analyzer/lib/src/error/codes.g.dart
- pkg/analyzer/lib/src/manifest/manifest_warning_code.g.dart
- pkg/analyzer/lib/src/pubspec/pubspec_warning_code.g.dart
- pkg/analyzer/lib/src/summary/format.dart
- pkg/analyzer/lib/src/wolf/ir/ir.g.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_000_1.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_001_0.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_010_0.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_100_0.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/simple/...
- pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart
- pkg/front_end/lib/src/codes/cfe_codes_generated.dart
- pkg/front_end/lib/src/util/parser_ast_helper.dart
- pkg/front_end/test/parser_test_listener.dart
- pkg/front_end/test/parser_test_parser.dart
- pkg/front_end/testcases/...
- pkg/kernel/lib/src/coverage.dart generated
- pkg/kernel/lib/src/equivalence.dart generated
- pkg/linter/lib/src/lint_codes.g.dart

Change-Id: Ice0141b763e63b84f54692cd19a442a0719673c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391263
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-11-06 18:42:25 +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
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