Also move the top-level `computeFixes` convenience function.
The `computeFixes` function is the main entrypoint that various code
uses to, well, compute all fixes with a FixProcessor and a
FixInFileProcessor. In order for plugin code to call `computeFixes`,
we need that function and FixInFileProcessor in the
analysis_server_plugin package.
Work towards https://github.com/dart-lang/sdk/issues/53402
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Id5f02864762eeefb92055a3534e91b60b76dfeb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
FixProcessor has to be part of the analysis_server_plugin package, so
it cannot have any dependencies on the analysis_server package. This moves one.
The word 'default' is reserved, so I changed to 'standard'.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I1ee21c800203fac758f10a6fde0ea7d07eee5e7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374742
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This brings the soft static enforcement that we had before: a producer
that extends ParsedCorrectionProducer cannot access the
ResolvedUnitResult of a ParsedUnitResult.
Also we add some runtime enforcement that the producers used for parse-
only lint rules are ParsedCorrectionProducer.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: If77fa66ae6fc070de1c7e931eb992a4adc14b68a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369561
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
We do this by passing a CorrectionProducerContext up each of the
constructors. We can then remove all `configure` methods. This
requires a few changes and allows a few changes:
* Remove ParsedCorrectionProducer. It does not seem to have served a
purpose.
* CorrectionProducerContext no longer needs to be generic.
* Add a public getter for `MultiCorrectionProducer._context`, so that
a multi correction producer can pass along its context to child
correction producers.
* Introduce a `CorrectionProducerContext.instance` dummy variable,
used when we need to check if a correction producer can be applied
in bulk.
* Make `CorrectionProducerContext._node` public, so that it can be
used in factory constructors.
* `BulkFixProcesor.correctionContext()` return type is non-nullable.
* Add a factory constructor for AddMissingParameter, and move the
`configure` logic there.
* Add a factory constructor for ConvertAddAllToSpread, and move the
`configure` logic there. Then make `_isInlineInvocation` and
`_invocation` final.
* Add a factory constructor for ReplaceFinalWithVar, and move the
`configure` logic there. Then make `_removeFinal` and
`_finalKeyword` final.
* Add a factory constructor for ReplaceWithIsEmpty, and move the
`configure` logic there. Then make `fixKind`, `multiFixKind`,
`_binary`, and `_replacement` final.
* Rename `_AddMissingParameter.context` to `_executableParameters`,
and make it final.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: If0e9bc1cbf5c8e656938bc6cd4eb32a9d4f06b38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
* Move the only 3 files from server_plugin to analysis_server_plugin.
* Copy some test infra into analysis_server_plugin. This is temporary,
as we need some shared test infra location.
Change-Id: If2b41d436c9d3051e590f60ae2eb7ab31e529321
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364161
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
We have chosen a new name for this package. So before we write more
code inside, we need to move everything from 'server_plugin' to
'analysis_server_plugin'. There are some steps do doing so, to not
break various infra:
1. Land this change, introducing the new package in the SDK, but no
dependencies on it.
2. Land this change independently in google3 (the package is not
yet "unbundled.")
3. Mark the package as "unbundled" in google3.
4. Move all code from server_plugin to analysis_server_plugin; update
imports; and delete server_plugin.
5. Remove server_plugin as an "unbundled" package; and remove
server_plugin from google3.
Bug: https://github.com/dart-lang/sdk/issues/53402
Change-Id: I70197fdf61dd5862c2220d8ed5dd0880a1593ead
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>