-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
☂️ New analyzer plugin system #53402
Comments
This is really exciting Sam! If you could use any help trying out prototypes I'd volunteer some time! |
@srawlins Would you mind creating go links for your design docs on https://github.com/flutter/website/blob/main/firebase.json? Then you can add them to the top of your docs making them a bit easier to share and discuss publicly. Community members often follow new go links on flutter.dev as well. |
In order for CorrectionProducers to be used in analyzer plugins, we need to access DartFixContributor which needs to compute fixes via FixProcessor. So both DartFixContributor and FixProcessor need to be moved into analyzer_plugin (eventually). For now, to support prototyping, I am moving FixProcessor to its own library, and separating all of the built in mappings (from diagnostic to producer generators). I think this separation actually stands on its own as being tidier, simplifying fix_internal.dart, and separating code from data, as it were. Work towards #53402 Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try Change-Id: I3b4fadc7ed94c23597d72bef7dcd832380d34e9a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345561 Commit-Queue: Samuel Rawlins <srawlins@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
With a simple move of two classes, Fix and FixContent. The class moves are not exactly no-ops. I moved each class into its own library and made the following changes: * Start doc comments with third person verbs [1]. * Make `Fix` class **final**. * Make `FixContext` class **interface**. [1]: https://dart.dev/effective-dart/documentation#prefer-starting-function-or-method-comments-with-third-person-verbs Work towards #53402 Cq-Include-Trybots: dart-internal/g3.dart-internal.try:g3-cbuild-try Change-Id: Ic046b236d634543832825db8746e0abdca5191fe Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355889 Reviewed-by: Alexander Thomas <athom@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
* Combine DartFixContext and DartFixContextImpl into one class; separation seems unnecessary. * Change constructor (which was on DartFixContextImpl) to use all named parameters. * Change `resolveResult` field to `resolvedResult`, since the type is called `ResolvedUnitResult`. * Start doc comments with third person verbs [1]. [1]: https://dart.dev/effective-dart/documentation#prefer-starting-function-or-method-comments-with-third-person-verbs Work towards #53402 Change-Id: Idb3c6776f899d5bc9b634c1d9c4b998de2603d04 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358382 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
`_getInsertionLocationTop` and `addLibraryImports` are each moved to extract_method.dart, as the only location where they were used. We get to delete the `_InsertionLocation` class. The tests are also moved, unchanged, and CorrectionUtilsTest is very much simplified. Bug: #53402 Change-Id: Ia410f04a837d85a0e06ec523d156c6c6c8bf6a3b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363402 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
…sites Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try Bug: #53402 Change-Id: Id62b06f3419820d4a74b34b51a6022792bcef7ab Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363404 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
…nto extract_method Bug: #53402 Change-Id: I4fca3482c27520328339d1d1f0b6b541399ed612 Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363501 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Samuel Rawlins <srawlins@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: #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>
Work towards #53402 None of the classes which were moved are changed in any way. Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try Change-Id: If81098971de044e2f69c1039ec23eff07b108af6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368066 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
I'm not good about referencing this issue in my CLs, as all the work is sort of just preparation and grooming the code. So I'll write down some of the under-the-hood changes I've been making. They are largely to support two areas: lint rule APIs and correction producer (mostly quick fix) APIs: lint rule APIs:
correction producer APIs:
I'll update this comment as I make more preparatory changes. |
FixProcessor has to be part of the analysis_server_plugin package, so it cannot have any dependencies on the analysis_server package. This removes one. Work towards #53402 Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try Change-Id: I935712bf75837ba95438ac9ed5f7ba5d8f941a7a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376126 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
Tasks needed to deliver a new analyzer plugin system:
The text was updated successfully, but these errors were encountered: