Commit graph

8130 commits

Author SHA1 Message Date
Konstantin Shcheglov 57ac271bf1 Verify that 'utf8.encode()' is not used in the analyzer.
To be removed after Dart SDK 3.1 is published, and the analyzer
SDK constraints updated.

See
https://dart-review.googlesource.com/c/sdk/+/254903

Change-Id: I2c3321d991cd3e123f08c5a360487362be16f258
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-07-17 17:28:31 +00:00
Konstantin Shcheglov ed776ebbc6 Simplify class and element hierarchy around augmentations.
Change-Id: If03fdad6891581a75cedaab8171c4626c9211ac7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314001
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-17 16:56:41 +00:00
Danny Tuppeny ea790e901c [analysis_server]/[analyzer] Change package_path alias -> path
Change-Id: Ia4848e6b87433401be95a4e74c7681a1c983c12f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313568
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-17 16:48:36 +00:00
Danny Tuppeny 760c719b97 [analysis_server] Fix missing-drive-letter test on Windows
My previous CL changed too much... This test specifically didn't want a valid absolute path on Windows, it wanted one without the drive letter.

Change-Id: If0812517e506f9960bca7ac99dd713be087b9ad9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314020
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-16 02:45:00 +00:00
eliasyishak 34f0e26d45 Swapping NoopAnalytics for noop from package:unified_analytics
Change-Id: I3419a128830ae434fa37bd10a1fc8a3da146fd89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Elias Yishak <eliasyishak@google.com>
2023-07-14 19:15:20 +00:00
Konstantin Shcheglov d4a70c8423 Support for always-false IfStatement(s) in RemoveComparison.
Change-Id: I14a8dedd6770081fc7fe9ee5c4e53c28e029ac3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313740
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-14 18:39:33 +00:00
Danny Tuppeny 77799f6d6c [analysis_server] Use current path context for path<->uri conversions
This allows changing the in-process tests to use Windows-style paths on macOS for convenience.

Change-Id: I0e85a4f8e831471925b8308ad348f75b6867a53b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313385
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-14 17:30:30 +00:00
Sam Rawlins d3233115c8 Bump linter to aed089e45c35221ce2b82f3757132031f0344b8b
Sync compare URI implementation with linter

Change-Id: I23e14459ac55fef4cec1c0c41341fe6f51b781b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313285
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Oleh Prypin <oprypin@google.com>
2023-07-13 23:43:40 +00:00
Danny Tuppeny 4d34d7aa24 [analysis_server] Remove unused parameters and related TODOs
Change-Id: I5b3fac0efa23c9e535635651a8e8b09398770a40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313504
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-13 15:57:47 +00:00
Danny Tuppeny d718ab5f08 [analysis_server] Extract LSP request helpers to allow reuse in LSP-over-Legacy tests
The mixin `LspAnalysisServerTestMixin` contains a lot of helpers for interacting with the LSP server in tests and is used by both the in-process tests and the out-of-process integration tests.

We now have a third category of LSP tests that would benefit from many of these helpers (such as "getHover()") but are not talking to a native LSP server.

This change splits those helpers out into `LspRequestHelpersMixin` which contains only the request helpers without any code assuming a native LSP server, so they can be used by LSP-over-Legacy tests.

All code in `request_helpers_mixin.dart` was lifted directly from `server_abstract.dart` with no changes.

It also adds a test that error responses in LSP-over-Legacy are handled appropriately.

Change-Id: I847855a5314b5b04d700c6400b67e76e5f0d3402
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-12 15:30:15 +00:00
Martin Kustermann 81df36216f Make utf8.encode() have Uint8List return type
Right now `utf8.encode()` has a static return type of `List<int>`
due to extending `Encoding` (which extends `Codec<String, List<int>>`).

We cannot easily change `Encoding` to extend `Codec<String, Uint8List>`
because that would also change `utf8.decode()` to require `Uint8List`
which would be a breaking change.

So instead we override `utf8.encode()` to have more precise return type.

Some parts of our SDK are run using the checked-in SDK, so it cannot
rely on the changed return type yet (until checked-in SDK is rolled).

So we use `const Utf8Encoder().convert()` as a temporary change, as
that already has `Uint8List` return type.

Issue https://github.com/dart-lang/sdk/issues/52801

TEST=ci

CoreLibraryReviewExempt: More precise return type for existing API
Change-Id: I2861d1f0eb3d292d8e3ec8437c0d441a2d2bd193
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254903
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-07-11 08:54:33 +00:00
Brian Wilkerson edb8d33c8e Start converting portions of the KeywordContributor
Change-Id: I9423ae6e50eec95ba3e5212529f4f3635d2f76d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312940
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-10 19:51:33 +00:00
Kyle Turney e826300560 add fix for removing the leading underscore from local function names
Closes https://github.com/dart-lang/sdk/pull/52822

GitOrigin-RevId: 1e97f3fde70079ea47a4bb8f8f58db341ae26fdc
Change-Id: Iec46cca3532789b4fb338d73cdbb946a0d383845
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-10 14:18:08 +00:00
pq ff8963d1be fix make_final to properly update for loop patterns
Fixes: https://github.com/dart-lang/sdk/issues/52820

Change-Id: If94b56f034bc8c28087251aada59433578ed7a2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312702
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-07 16:23:59 +00:00
Danny Tuppeny 201fb68e64 [analysis_server] Update remaining CodeActions tests to use new expectation format
This is a continuation of a previous change that stops tests from verifying only individual files modified via a `WorkspaceEdit`. All verifications of these edits are done via a single string that includes all changes, with annotations for creates/deletes/renames.

Additionally, it migrates some additional tests to use TestCode instead of the old markers, and removes some extra indenting these tests had.

It also starts changing how capabilities are set for tests from having to nest function calls in `initialize()` calls to instead calling simple helpers prior to initialization.

Change-Id: I35d16a296c2125ab830685437e14eb3b29ea4704
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312841
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-07 16:15:24 +00:00
Konstantin Shcheglov fc0e656868 Build ClassAugmentationElementImpl, basic linking.
Change-Id: I18bd3d97ad9fe661d14e3d3d006219ffceedcfc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312349
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-07 14:55:38 +00:00
Brian Wilkerson a510e60dbf Simplify the keyword contributor to make it easier to port to the new framework
Change-Id: I29d0bdc2d798adc3b39718fabba893456495dce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312703
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-06 21:03:37 +00:00
Danny Tuppeny c81b2bac1b [analysis_server] Enable calling LSP handlers over the legacy protocol
This currently only allows "textDocument/hover". Handlers may need some tweaks to remove any dependencies on LspAnalysisServer before they can be enabled.

Capabilities and config are hard-coded to a very basic set (which I suspect will expand as new handlers are added). Reverse requests and notifications are not currently supported (I suspect these will be added when there are more concrete use cases for them because they may need to be conditional based on real client capabilities/needs).

Change-Id: I8a096f9530ad1518ac5ee876aea2560d269a27ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312303
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-06 14:15:16 +00:00
Danny Tuppeny 0d3e76c8e6 [analysis_server] Modify code action/refactor tests to verify whole set of edits
The goal here is to ensure tests can't accidentally check only a subset of edits made during the command execution.

Not all tests have been migrated (only refactorings and a few that happened to use some of the same methods for verification).

Change-Id: I5589e8e667e957aee3ea55f741b1b49a3859d6bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312304
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-06 14:05:09 +00:00
Konstantin Shcheglov ec893a4d8f Rework ElementImpl and AugmentationElementImpl hierarchies to use XyzOrAugmentationElementMixin(s).
Add ClassAugmentationElementImpl, no any tests yet because it
required parsing, AST, etc. And it is also not ready yet.

Change-Id: I601141545e9bf0638771f28bb9498be9de664659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312345
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-05 20:03:47 +00:00
Danny Tuppeny 1c4ad79985 [analyzer] Include trailing commas in display strings for single-positional-field records
See https://github.com/Dart-Code/Dart-Code/issues/4624

Change-Id: Iac2f061c11ffdb95917329465307abc8e92b6ba3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312421
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-07-05 18:56:36 +00:00
Danny Tuppeny 28ea45c05c [analysis_server] Handle hovers for identifiers declared in for loops
Fixes https://github.com/Dart-Code/Dart-Code/issues/4627

Change-Id: Idcff9a6e87929ef6ceb0cbed5b44a493bb6a8260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-05 18:12:21 +00:00
Danny Tuppeny 08353751ea [analysis_server] Handle inlay hints for patterns + improve hints for record types
Fixes https://github.com/Dart-Code/Dart-Code/issues/4624

Change-Id: Ib1887803957c001907ac439fd9f380964f6177e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-05 16:41:49 +00:00
Danny Tuppeny 0daf23ee75 [analysis_server] Handle widget references inside functions when converting to StatelessWidget
Fixes https://github.com/Dart-Code/Dart-Code/issues/4621

Change-Id: I7dda2ff11e56bb227b476b38ba42e3222f2ceb59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312265
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-05 16:37:56 +00:00
Kallen Tu c86af3c39b [analyzer] Refactor visitMethodInvocation in the const evaluator.
Change-Id: I9ae6c17967c98770ed06dead200c8bd87ae7f2a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309829
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-06-30 18:32:27 +00:00
Konstantin Shcheglov 8828fee865 Deprecate ExecutableElement.returnType, use returnType2 instead.
Change-Id: Ibd29c3fbec0439236c2cf45c57f820c45427df9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311932
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-06-29 23:16:59 +00:00
Konstantin Shcheglov fae9e418ea Deprecate Element.enclosingElement, use enclosingElement2 instead.
Change-Id: I78edb6d433949eb8bd86f397fb873a078edf9fc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311827
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-29 19:45:19 +00:00
Danny Tuppeny fc1188d55c [analysis_server] Refactor/rename server to simplify sharing handlers between LSP+Legacy protocols
In order to share LSP handlers between protocols, we need to be able to use a LegacyAnalysisServer in place of an LspAnalysisServer which means having a common interface (which they have via AnalysisServer) and to make the mapping of LSP method names to handlers reusable.

This changes makes the following non-functional changes (to reduce the size of a future change that will begin sharing handlers):

- Rename "clientCapabilities" to "lspClientCapabilities" to avoid conflicts with legacy servers clientCapabilities field when we add this to the base AnalysisServer interface
- Rename "clientConfiguration" to "lspClientConfiguration" for consistency
- Add an "LspMessageHandler" typedef over "MessageHandler" which now has a server type arg so that it can be used with either LspAnalysisServer (by handlers that really need LSP) and AnalysisServer (for handlers that can work in either server)
- Extract handler generators in `InitializedStateMessageHandler` to a static map and make constructors consistent taking only a server (in a future CL the legacy server will want access to some this mapping)

Change-Id: I23554a7ca318fbcd1113dcebff5601186b223618
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311982
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-06-29 19:20:20 +00:00
Danny Tuppeny 70be63ce49 Fix CreateConstructorForFinalFieldsRequiredNamedTest.test_enum on Windows
Checking the offset can be wrong on Windows due to line endings. Other tests in this file are checking the message, so I've done the same here.

I noticed this locally, but I see the Windows bot was also failing on this.

Change-Id: I36de86c3b3eac6f379da894ea9e6fcfcb1a0aa4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311981
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-29 15:39:08 +00:00
Konstantin Shcheglov 6f01da06a2 Put aside invalid mixin constructors, quick fix for MIXIN_DECLARES_CONSTRUCTOR.
Change-Id: If1b808bf7746b4f2c2c856d7fb7e72499023759f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-28 19:49:08 +00:00
Keerti Parthasarathy aec08eabd9 Convert some more assists/fixes to using ParsedCorrectionProducer
Change-Id: Ie715868183e1b06023b538ec1bc550171cfa2f5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311825
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-06-28 19:46:47 +00:00
Konstantin Shcheglov 892a7fbe4e Put aside invalid nodes during parsing, fix for EXTENSION_DECLARES_CONSTRUCTOR.
Change-Id: Ic01f4c1116ecb29087c8d1bff679906522b7562e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311726
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-28 15:17:23 +00:00
Konstantin Shcheglov d264ceeb05 Add InstanceElement as a super-interface for InterfaceElement and InlineClassElement.
Change-Id: Ie92168509cccb5b145bc5c9adea2945813725038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311721
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-28 00:56:05 +00:00
Brian Wilkerson 45572cf7dd Pull in a new version of unified_analytics and update server
Change-Id: I7f63b55fc6a74f2adfc97f00950ca0516bae68ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310965
Reviewed-by: Elias Yishak <eliasyishak@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-27 13:35:08 +00:00
Konstantin Shcheglov 76eb70963c Use 'UnitResult' type parameter instead of 'T' in CorrectionProducerContext.
Change-Id: I24c7f9450f6ad84de6e67a2fb2f70d6dea7983e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311158
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-06-26 16:05:14 +00:00
Konstantin Shcheglov eeecd53fe2 De-duplicate refactoringContext in RefactoringProducer.
Change-Id: Ia1dcbaf301d37d977b22742bf8198c64f7d34159
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311159
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-24 17:00:20 +00:00
Konstantin Shcheglov 69c62b1a31 Remove shipped features, and deprecated experiments from tests.
Change-Id: I428906a1d75a0dacedc8a5d5fd805f84ca8e3ce0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311156
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-24 16:23:28 +00:00
Konstantin Shcheglov 98d7e25027 [CMSR] Test that it works with FunctionTypedFormalParameter(s).
Change-Id: I86d483d379e7fe0be2dccf1659d2c6377dcc8eb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311140
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-23 19:30:12 +00:00
Konstantin Shcheglov ecc18c9600 [CMSR] Tests for TrailingComma, support for required positional formal parameters.
Change-Id: I1e477782895a053ff2060dada8fe834bd2c2c8db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310977
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-23 17:53:30 +00:00
Konstantin Shcheglov 9b3e36bbdc Refactorings run with multiple AnalysisContext(s) and sessions.
If we use just the session that produced the resolved unit, we will
not update other packages for example.

I tried to apply a refactoring to `LanguageVersionImpl` from `_fe_analyzer_shared`, and it did not update `analyzer`. With this change it does update :-)

Change-Id: I47fc28b4adba59c8e025e1bfe17490e4038d28ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310973
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-23 00:22:38 +00:00
Konstantin Shcheglov c50958a019 [CMSR] Add LSP command 'Move selected formal parameter(s) left'.
Change-Id: Ia30e9bad9643d80c183d8b17a0d3aae065c30dc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310969
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-22 23:13:27 +00:00
Kallen Tu 9ec1a84f29 [analyzer] Produce CONST_EVAL_EXTENSION_METHOD diagnostic when using extension methods in const contexts.
More specific error code.

Semi-related to work in https://dart-review.googlesource.com/c/sdk/+/301505.

Change-Id: I1233e9e31389d387a9c777fe83cdd30a224bd00e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-06-22 20:35:29 +00:00
Konstantin Shcheglov 09f6d8bb58 Use select() instead of NodeLocator in CorrectionProducerContext.
Includes https://dart-review.googlesource.com/c/sdk/+/310060,
as it is 2023-06-20 @ 1243

Change-Id: I8f9788bb3a7b669191e34a8ec42b81d2ebcd31b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310325
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-22 20:29:07 +00:00
Konstantin Shcheglov c2ffa07d7e [CMSR] Tests for removing first / last named / positional formal parameter.
Change-Id: I4028f17b9244835beb60d955f12763ff9184afc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310967
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-22 20:27:24 +00:00
Keerti Parthasarathy a023c3f00e Fix bug with change parameter type when there are no parameters in argument list
Change-Id: I5cabd16091cb66be45f107a3701128776e8129ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310820
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-06-22 18:45:27 +00:00
Keerti Parthasarathy ab884b7d7f Refactors to allow for parse only mode for lints and fixes.
- Make CorrectionProducer as base class for {Parsed/Resolved}CorrectionProducer.
- Use ParsedCorrectionProducer for ConvertDocumentationIntoLine
- Move sort imports test to used ParsedUnitResult
- Add getter to LintRule to indicate that rule can be run using just parsed AST


Change-Id: Id11466c445e6e505ea752d097b57143f18c47060
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310484
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-06-22 18:20:15 +00:00
Konstantin Shcheglov fe35362602 [CMSR] Support for removing formal parameters.
Change-Id: Id04f6c7854dec3d5059009a0a579110690d3eb62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310963
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-22 18:09:23 +00:00
Konstantin Shcheglov a8a3f3f77e [CMSR] Improve 'get invocation' implementation.
Change-Id: I871eddc1727ea6a51e169f4031d55ba3bc93527d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-22 14:38:38 +00:00
Brian Wilkerson 1c3011cbf0 Capture a failing case in code completion
Change-Id: I6a21172628462d0f3b569360849f8417e48cad1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-22 05:19:58 +00:00
Brian Wilkerson 5c84db453d Initial framework for completion refactoring
This is some prepration for starting the refactoring of the completion
support. The plan is for `InScopeCompletionPass` to implement the first
pass of the proposed algorithm. My intention is to convert one
contributor at a time (as much as possible), starting with the
`KeywordContributor`.

Change-Id: I206c704f5c2370f4c37b674be01ab7fb55afa65e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-22 05:18:07 +00:00