-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathcreateTutorial.ts
More file actions
45 lines (42 loc) · 1.29 KB
/
createTutorial.ts
File metadata and controls
45 lines (42 loc) · 1.29 KB
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
import type * as vscode from "vscode";
import type { Hats, HatTokenMap, IDE } from "@cursorless/lib-common";
import type {
CommandRunnerDecorator,
CustomSpokenFormGenerator,
} from "@cursorless/lib-engine";
import { FileSystemTutorialContentProvider } from "@cursorless/lib-node-common";
import { TutorialImpl } from "@cursorless/lib-tutorial";
import type { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem";
import type { ScopeVisualizer } from "./ScopeVisualizerCommandApi";
import { vscodeApi } from "./vscodeApi";
import { VscodeTutorial } from "./VscodeTutorial";
export function createTutorial(
context: vscode.ExtensionContext,
ide: IDE,
scopeVisualizer: ScopeVisualizer,
fileSystem: VscodeFileSystem,
addCommandRunnerDecorator: (
commandRunnerDecorator: CommandRunnerDecorator,
) => void,
hatTokenMap: HatTokenMap,
customSpokenFormGenerator: CustomSpokenFormGenerator,
hats: Hats,
) {
const contentProvider = new FileSystemTutorialContentProvider(ide.assetsRoot);
const tutorial = new TutorialImpl(
ide,
hatTokenMap,
customSpokenFormGenerator,
contentProvider,
hats,
);
ide.disposeOnExit(tutorial);
addCommandRunnerDecorator(tutorial);
return new VscodeTutorial(
context,
vscodeApi,
tutorial,
scopeVisualizer,
fileSystem,
);
}