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

Method runCommandForWorkspace

src/extension/commands/sdk.ts:40–56  ·  view source on GitHub ↗
(
		handler: (folder: string, args: string[], packageOrFolderDisplayName: string, alwaysShowOutput: boolean, operationProgress?: OperationProgress) => Promise<RunProcessResult | undefined>,
		placeHolder: string,
		args: string[],
		selection: vs.Uri | undefined,
		alwaysShowOutput = false,
		operationProgress?: OperationProgress,
		{ onlyShowWorkspaceRoots = false }: { onlyShowWorkspaceRoots?: boolean; } = {}
	)

Source from the content-addressed store, hash-verified

38 }
39
40 protected async runCommandForWorkspace(
41 handler: (folder: string, args: string[], packageOrFolderDisplayName: string, alwaysShowOutput: boolean, operationProgress?: OperationProgress) => Promise<RunProcessResult | undefined>,
42 placeHolder: string,
43 args: string[],
44 selection: vs.Uri | undefined,
45 alwaysShowOutput = false,
46 operationProgress?: OperationProgress,
47 { onlyShowWorkspaceRoots = false }: { onlyShowWorkspaceRoots?: boolean; } = {}
48 ): Promise<RunProcessResult | undefined> {
49 const folderToRunCommandIn = await getFolderToRunCommandIn(this.logger, placeHolder, { selection, onlyShowWorkspaceRoots });
50 if (!folderToRunCommandIn)
51 return;
52
53
54 const packageOrFolderDisplayName = getPackageOrFolderDisplayName(folderToRunCommandIn);
55 return handler(folderToRunCommandIn, args, packageOrFolderDisplayName, alwaysShowOutput, operationProgress);
56 }
57
58 public runFlutter(args: string[], selection: vs.Uri | undefined, alwaysShowOutput = false, operationProgress?: OperationProgress, { onlyShowWorkspaceRoots = false }: { onlyShowWorkspaceRoots?: boolean; } = {}): Promise<RunProcessResult | undefined> {
59 return this.runCommandForWorkspace(this.runFlutterInFolder.bind(this), `Select the folder to run "flutter ${args.join(" ")}" in`, args, selection, alwaysShowOutput, operationProgress, { onlyShowWorkspaceRoots });

Callers 2

runFlutterMethod · 0.95
runPubMethod · 0.95

Calls 2

getFolderToRunCommandInFunction · 0.90

Tested by

no test coverage detected