Commit Graph

7 Commits

Author SHA1 Message Date
Sam Rawlins fb03a18f63 DAS: switch ConfigurationFilesMixin to use package getters
Change-Id: I4931f2b7598ea96313fb00963e5e154101d51c24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429829
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-21 08:41:38 -07:00
Sam Rawlins 823908a435 Simplify ConfigurationFilesMixin
Work towards https://github.com/dart-lang/sdk/issues/55660

This mixin has some members that can be made private, and some that
can be removed.

Removing a `macro` parameter also simplifies things.

Change-Id: Id3b5d33ff66dde0c763499ff183943d72901d395
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429440
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-19 12:44:59 -07:00
Danny Tuppeny 496c5ca907 [analysis_server] Minor CodeAction test cleanup
This is some more final (🙃) cleanup before having CodeActions work for LSP-over-Legacy and run all the same tests. Includes:

- Adding some additional signatures to the SharedTestInterface
- Moving some setup code (that uses those methods) into the shared test mixins
- Add a field for `testPackageName` to allow tests to handle differences between the test package name between LSP/Legacy (something that should probably consolidated but is probably not for this CL)
- Move plugin tests back out of the shared code action tests (these require some additional abstraction to work the same across both kinds of tests - TODO added)

Change-Id: Iad25f1ff1e141d3315e9b972a6d0850e71d4a4bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427443
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-13 11:42:48 -07:00
Danny Tuppeny 4db0bdb286 [analysis_server] Update remainder of CodeAction tests to use shared interfaces
Some further changes to CodeAction tests to use shared interfaces so that they will be able to run with both LSP and Legacy test base classes.

Change-Id: I3383e9aef9ea97d39f28dad42633c1fac74e4efa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-05-12 09:36:31 -07:00
Danny Tuppeny 57cd03d400 [analysis_server] Immediately return null for getEditableArgs of non-Dart files
See https://github.com/flutter/devtools/issues/9048

Change-Id: I5edb446cbda6f9a4222f2aca8dfd72ccbf334287
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-03-20 07:40:04 -07:00
Danny Tuppeny 199d50aab1 [analysis_server] Check for applyEdit support before handling EditArguments
If we get an editArgument request (usually via DDS), we should verify the connected editor supports edits and return an explicit message if not.

Also adds a `setUp()` declaration to `SharedTestInterface` so shared tests can set client capabilities instead of them being duplicated in each test class (and moves the same for ApplyEdit tests to this).

Change-Id: Ie6a85620b3b53663ce92e55d93e3aefcaf4dc980
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-01-22 15:15:19 -08:00
Danny Tuppeny 549a78500a [analysis_server] Add a shared test interface to simplify sharing tests between LSP, LSP-over-Legacy
This is refactor extracted from an upcoming change (to make property editor tests run against both servers) to make that change smaller and easier to review.

There are some existing shared tests that run for both LSP and Legacy servers, but they currently do not touch much server API (one is for DTD and one tests reverse-requests). Migrating other tests (such as EditableArguments) requires some additional API be the same between the different test/server base classes.

This change adds an `abstract interface class SharedTestInterface` to serve as a common interface for methods that shared tests need to use that have different implementations between LSP and Legacy. For example, updating the overlays in an LSP-over-Legacy test needs to use the Legacy APIs for updating the overlay and not the LSP ones (so we can't just use the LSP methods like we would for calling something like getHover for LSP-over-Legacy).

It also:

- adds some new futures to the LSP test base to match the behaviour of the legacy one (wait for in-progress analysis)
- replaces the shared mixins with real base classes that implement the shared interface (for ex. `abstract class SharedLspOverLegacyTest extends LspOverLegacyTest implements SharedTestInterface`) to make it easier to create shared tests
- renames `sendLspRequest` to `sendLspRequestToClient` to make it clearer what direction this method is for

Change-Id: I070c2c005b11b9afd8a87aa22b04972a9dde2320
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404680
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2025-01-15 12:28:45 -08:00