-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension.ts
34 lines (30 loc) · 943 Bytes
/
extension.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
const taskProvider = vscode.tasks.registerTaskProvider('mytask', new MyTaskProvider());
context.subscriptions.push(taskProvider);
}
export function deactivate() {
}
export class MyTaskProvider implements vscode.TaskProvider {
provideTasks() {
return [
new vscode.Task(
{ type: 'mytask' },
vscode.TaskScope.Workspace,
'Print a warning',
'mytask',
new vscode.ShellExecution('echo "warning README.md:3: This is a message"'),
'$mymatcher'
)
];
}
resolveTask(task: vscode.Task): vscode.Task | undefined {
const problemMatchers = task.problemMatchers as any;
vscode.window.showInformationMessage('problemMatchers: ' + (
problemMatchers === undefined ? 'undefined'
: Array.isArray(problemMatchers) ? '[' + problemMatchers.join(', ') + ']'
: problemMatchers.toString()
));
return undefined;
}
}