Skip to content

Commit 381819a

Browse files
committed
update
1 parent 180e5d3 commit 381819a

3 files changed

Lines changed: 13 additions & 16 deletions

File tree

src/CodeBuilder.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,10 @@ export abstract class CodeBuilder {
297297
else { shellOption.executable = '/bin/bash'; shellOption.shellArgs = ['-c']; }
298298
shellOption.env = <any>process.env;
299299
// setup task
300-
const task = new vscode.Task({ type: 'shell' }, vscode.TaskScope.Workspace, title, 'eide');
301300
if (os.platform() == 'win32') commandLine = `"${commandLine}"`;
302-
task.execution = new vscode.ShellExecution(commandLine, shellOption);
303-
task.definition['command'] = commandLine;
301+
const task = new vscode.Task({ type: 'shell', command: commandLine }, vscode.TaskScope.Workspace,
302+
title, 'eide', new vscode.ShellExecution(commandLine, shellOption), []);
304303
task.group = vscode.TaskGroup.Build;
305-
task.problemMatchers = [];
306304
task.isBackground = false;
307305
task.presentationOptions = { echo: true, focus: false, clear: true };
308306
vscode.tasks.executeTask(task);

src/extension.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,29 +1180,30 @@ class EideTaskProvider implements vscode.TaskProvider {
11801180
public static TASK_TYPE_MSYS = 'eide.msys';
11811181

11821182
provideTasks(token: vscode.CancellationToken): vscode.ProviderResult<vscode.Task[]> {
1183-
return [
1184-
new vscode.Task({ type: EideTaskProvider.TASK_TYPE_MSYS }, vscode.TaskScope.Workspace, 'msys', EideTaskProvider.TASK_TYPE_MSYS)
1185-
];
1183+
return undefined;
11861184
}
11871185

1188-
resolveTask(task: vscode.Task, token: vscode.CancellationToken): vscode.ProviderResult<vscode.Task> {
1186+
resolveTask(task_: vscode.Task, token: vscode.CancellationToken): vscode.ProviderResult<vscode.Task> {
11891187

11901188
const workspaceManager = WorkspaceManager.getInstance();
11911189

1192-
if (task.definition.type == EideTaskProvider.TASK_TYPE_MSYS) {
1190+
if (task_.definition.type == EideTaskProvider.TASK_TYPE_MSYS) {
11931191

1194-
const definition: EideShellTaskDef = <any>task.definition;
1192+
const definition: EideShellTaskDef = <any>task_.definition;
11951193

1196-
task.name = definition.name || task.name;
1194+
const task = new vscode.Task(definition, vscode.TaskScope.Workspace,
1195+
definition.name, EideTaskProvider.TASK_TYPE_MSYS, definition.problemMatchers);
11971196

1198-
const shellcommand = platform.osType() == 'win32' ? `"${definition.command}"` : definition.command;
1197+
const shellcommand = definition.command;
11991198
task.execution = new vscode.ShellExecution(shellcommand, {
12001199
executable: platform.osType() == 'win32' ? `${process.env['EIDE_MSYS']}/bash.exe` : '/bin/bash',
12011200
shellArgs: ['-c'],
12021201
cwd: definition?.options?.cwd || workspaceManager.getCurrentFolder()?.path,
12031202
env: utility.mergeEnv(process.env, {})
12041203
});
12051204

1205+
task.group = definition.group;
1206+
12061207
return task;
12071208
}
12081209

src/utility.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,10 @@ export function runShellCommand(title: string, commandLine: string, env?: any, u
220220
if (platform.osType() == 'win32') { shellOption.executable = 'cmd.exe'; shellOption.shellArgs = ['/C']; }
221221
else { shellOption.executable = '/bin/bash'; shellOption.shellArgs = ['-c']; }
222222
// init task
223-
const task = new vscode.Task({ type: 'shell' }, vscode.TaskScope.Global, title, 'shell');
224223
if (platform.osType() == 'win32') commandLine = `"${commandLine}"`;
225-
task.execution = new vscode.ShellExecution(commandLine, shellOption);
226-
task.definition['command'] = commandLine;
224+
const task = new vscode.Task({ type: 'shell', command: commandLine }, vscode.TaskScope.Global,
225+
title, 'shell', new vscode.ShellExecution(commandLine, shellOption), []);
227226
task.isBackground = false;
228-
task.problemMatchers = [];
229227
task.presentationOptions = { echo: true, focus: false, clear: true };
230228
vscode.tasks.executeTask(task);
231229
}

0 commit comments

Comments
 (0)