-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathextension.ts
58 lines (52 loc) · 1.84 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import vscode from 'vscode';
import {
appendSchemasConfig,
runTaskByInput,
viewActionGraph,
viewProjectGraph,
viewTaskGraph,
} from './commands';
import { LastRunProvider } from './lastRunView';
import { ProjectsProvider } from './projectsView';
import { Workspace } from './workspace';
export function activate(context: vscode.ExtensionContext) {
const workspace = new Workspace();
const projectsProvider = new ProjectsProvider(context, workspace, 'category');
const tagsProvider = new ProjectsProvider(context, workspace, 'tag');
context.subscriptions.push(
vscode.commands.registerCommand('moon.openSettings', () =>
vscode.commands.executeCommand('workbench.action.openSettings', '@ext:moonrepo.moon-console'),
),
// Create commands
vscode.commands.registerCommand('moon.runTaskByInput', () => runTaskByInput(workspace)),
vscode.commands.registerCommand('moon.viewActionGraph', () =>
viewActionGraph(context, workspace),
),
vscode.commands.registerCommand('moon.viewProjectGraph', () =>
viewProjectGraph(context, workspace),
),
vscode.commands.registerCommand('moon.viewTaskGraph', () => viewTaskGraph(context, workspace)),
vscode.commands.registerCommand('moon.appendSchemasConfig', () =>
appendSchemasConfig(context, workspace),
),
// Create a tree view for all moon projects
vscode.window.createTreeView('moonProjects', {
showCollapseAll: true,
treeDataProvider: projectsProvider,
}),
vscode.window.createTreeView('moonProjectsExternal', {
showCollapseAll: true,
treeDataProvider: projectsProvider,
}),
vscode.window.createTreeView('moonTags', {
showCollapseAll: true,
treeDataProvider: tagsProvider,
}),
// Create a webview for last run report
vscode.window.registerWebviewViewProvider(
'moonLastRun',
new LastRunProvider(context, workspace),
),
);
}
export function deactivate() {}