|
1 | 1 | import * as T from 'typings' |
2 | | -import * as TT from 'typings/tutorial' |
3 | 2 | import * as vscode from 'vscode' |
4 | 3 | import { setupActions, solutionActions } from './actions/setupActions' |
5 | 4 | import { COMMANDS } from './commands' |
6 | 5 | import Context from './services/context/context' |
7 | 6 | import logger from './services/logger' |
8 | 7 | import { openWorkspace } from './services/workspace' |
9 | 8 | import { showOutput } from './services/testRunner/output' |
10 | | -import { exec } from './services/node' |
11 | | -import reset from './services/reset' |
12 | | -import getLastCommitHash from './services/reset/lastHash' |
13 | | - |
14 | 9 | import * as actions from './actions' |
15 | 10 |
|
16 | 11 | interface Channel { |
@@ -88,27 +83,7 @@ class Channel implements Channel { |
88 | 83 | vscode.commands.executeCommand(COMMANDS.RUN_TEST, action?.payload) |
89 | 84 | return |
90 | 85 | case 'EDITOR_RUN_RESET': |
91 | | - // reset to timeline |
92 | | - const tutorial: TT.Tutorial | null = this.context.tutorial.get() |
93 | | - const position: T.Position = this.context.position.get() |
94 | | - |
95 | | - // get last pass commit |
96 | | - const hash = getLastCommitHash(position, tutorial?.levels || []) |
97 | | - |
98 | | - const branch = tutorial?.config.repo.branch |
99 | | - |
100 | | - if (!branch) { |
101 | | - console.error('No repo branch found for tutorial') |
102 | | - return |
103 | | - } |
104 | | - |
105 | | - // load timeline until last pass commit |
106 | | - reset({ branch, hash }) |
107 | | - |
108 | | - // if tutorial.config.reset.command, run it |
109 | | - if (tutorial?.config?.reset?.command) { |
110 | | - await exec({ command: tutorial.config.reset.command }) |
111 | | - } |
| 86 | + actions.onRunReset(this.context) |
112 | 87 | return |
113 | 88 | default: |
114 | 89 | logger(`No match for action type: ${actionType}`) |
|
0 commit comments