-
Notifications
You must be signed in to change notification settings - Fork 340
Description
We currently export a bunch of internal classes from the extensions activate method in a _privateApi field to make testing easier. These were never intended for use outside of tests, but some other extensions have started using them to get access to things they can't easily get elsewhere (for example the SDK paths or Outline data).
Because these classes were never meant as public API, they often change in breaking ways so we should remove them and only expose them when running in a test run. But first we should try to provide alternatives for extensions where it's reasonable. This issue tracks the known extensions using these APIs, what they use, and whether they have migrated off them.
The initial API provides access to the DTD URI and the current SDK paths (#5583). This will ship with version == 2 in v3.116 at the start of August.
- Wings (@tomgilder)
-
workspaceContext.sdks.flutter&workspaceContext.sdks.dart
This can be migrated toexports.sdks(and optionallyexports.onSdksChanged) - Tracking issue: Dart-Code private APIs are being removed cheeky-pixel/wings#3
-
- wanggaowan/flutter-dev-tools (@wanggaowan)
-
fileTracker.getOutlineFor&fileTracker.waitForOutline&fileTracker.waitForOutlineWithLength&fileTracker.getFlutterOutlineFor
These can be migrated toexports.workspace.getOutline(). - Tracking issue: Dart-Code private APIs are being removed wanggaowan/flutter-dev-tools#1
-
- Elementary-team/flutter-elementary (@MbIXjkee)
-
pubGlobal.runCommandWithProgress
This could be replaced with calls toexports.sdk.runDart()andexports.sdk.runPub()? - Tracking issue: Dart-Code private APIs are being removed Elementary-team/flutter-elementary#133
-
- schultek/jaspr (@schultek)
-
workspaceContext.sdks.flutter&workspaceContext.sdks.dart
This can be migrated toexports.sdks(and optionallyexports.onSdksChanged) -
packagesTreeProvider.projectFinder.findAllProjectFolders
This could be replaced by a call toexports.workspace.findProjectFolders() -
addDependencyCommand.runCommandForWorkspace
This could be replaced with calls toexports.sdk.runDart()andexports.sdk.runPub()? -
pubGlobal.installIfRequired
This could be replaced with calls toexports.sdk.runDart()andexports.sdk.runPub(), although it would require parsing the results of runningpub global list. Note: Dart-Code's own use of "pub global" may go away soon. - Tracking issue: Dart-Code private APIs are being removed schultek/jaspr#482
-
The items above are the only uses of the private APIs I've been able to find (besides CommandDash/commanddash but that is no longer in development) and therefore other APIs that are currently exposed will be removed soon. Other APIs will be removed once the projects above have had some time to migrate over.