Add `DartFileEditBuilder.addConstructorInsertion`, a replacement for both `CorrectionUtils.prepareEnumNewConstructorLocation` and `CorrectionUtils.prepareNewConstructorLocation`. Combining the two APIs is made possible by adding enum support to _InsertionPreparer. For example, constructors can be inserted after an enum value-list's semicolon (if there is one), or after the last value (if there isn't). Also: * Refactor _InsertionPreparer a bit to be cleaner; in the constructor, we determine whether we can grab the `NamedCompilationUnitMember` members. * Instead of storing a `_targetMember` as a field, which is only null- checked, store a Boolean value for whether a target member was found. * Remove pre-nnbd support in `DartFileEditBuilder.writeParameter`. Change-Id: I3e98ed906cf5ac82e464c502db5986d3761c3611 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361624 Commit-Queue: Samuel Rawlins <srawlins@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
A framework for building plugins for the analysis server.
Usage
Note: The plugin support is not currently available for general use.
Plugins are written in Dart and are run in the same VM as the analysis server. The analysis server runs each plugin in a separate isolate and communicates with the plugin using a plugin API. This API is similar to the API used by the analysis server to communicate with clients.
Plugins are automatically discovered and run by the analysis server.
This package contains support code to make it easier to write a plugin. There is a tutorial describing how to use the support in this package.
Support
Post issues and feature requests on the issue tracker.
Questions and discussions are welcome at the Dart Analyzer Discussion Group.
License
See the LICENSE file.