MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / flutterClean

Method flutterClean

src/extension/commands/flutter.ts:52–79  ·  view source on GitHub ↗
(
		uri: vs.Uri | vs.Uri[] | undefined,
		operationProgress?: OperationProgress,
	)

Source from the content-addressed store, hash-verified

50 }
51
52 private async flutterClean(
53 uri: vs.Uri | vs.Uri[] | undefined,
54 operationProgress?: OperationProgress,
55 ): Promise<RunProcessResult | undefined> {
56 // If we don't have a parent progress, add one.
57 if (!operationProgress) {
58 return vs.window.withProgress({
59 cancellable: true,
60 location: vs.ProgressLocation.Notification,
61 title: "flutter clean",
62 }, (progress, token) => this.flutterClean(uri, { progressReporter: progress, cancellationToken: token }));
63 }
64
65 // If we are a batch, run for each item.
66 if (Array.isArray(uri)) {
67 await runBatchFolderOperation(uri, operationProgress, this.flutterCleanForUri.bind(this));
68 return;
69 }
70
71 if (!uri) {
72 const path = await getFolderToRunCommandIn(this.logger, `Select the folder to run "flutter clean" in`, { selection: uri, flutterOnly: true });
73 if (!path)
74 return;
75 uri = vs.Uri.file(path);
76 }
77
78 return this.flutterCleanForUri(uri, operationProgress);
79 }
80
81 private async flutterCleanForUri(uri: vs.Uri, operationProgress?: OperationProgress): Promise<RunProcessResult | undefined> {
82 return this.runFlutter(["clean"], uri, false, operationProgress);

Callers

nothing calls this directly

Calls 3

flutterCleanForUriMethod · 0.95
runBatchFolderOperationFunction · 0.90
getFolderToRunCommandInFunction · 0.90

Tested by

no test coverage detected