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

Function runTask

src/extension/dart/dart_task_provider.ts:146–162  ·  view source on GitHub ↗
(uri: vs.Uri | undefined, command: string, args: string[])

Source from the content-addressed store, hash-verified

144 }
145
146 protected async runTask(uri: vs.Uri | undefined, command: string, args: string[]) {
147 let projectFolder = uri;
148 let workspaceFolder = uri ? vs.workspace.getWorkspaceFolder(uri) : undefined;
149 if (!workspaceFolder) {
150 const folderPath = await getFolderToRunCommandIn(this.logger, "Select which project to run the command for");
151 if (!folderPath)
152 return;
153 projectFolder = vs.Uri.file(folderPath);
154 workspaceFolder = vs.workspace.getWorkspaceFolder(projectFolder);
155 }
156 if (!workspaceFolder)
157 return;
158
159 const task = await this.createTask(workspaceFolder, projectFolder!, command, args);
160
161 return vs.tasks.executeTask(task);
162 }
163
164 protected async createTaskExecution(sdks: DartSdks, definition: DartTaskDefinition, cwd: string | undefined): Promise<vs.ProcessExecution | undefined> {
165 if (!definition.command)

Callers

nothing calls this directly

Calls 1

getFolderToRunCommandInFunction · 0.90

Tested by

no test coverage detected