MCPcopy Index your code
hub / github.com/coderoad/coderoad-vscode / loadStep

Function loadStep

web-app/src/services/state/actions/editor.ts:46–73  ·  view source on GitHub ↗
(context: T.MachineContext)

Source from the content-addressed store, hash-verified

44 })
45 },
46 loadStep(context: T.MachineContext): void {
47 const step: TT.Step | null = selectors.currentStep(context)
48 if (step && step.setup) {
49 // load step actions
50 editorSend({
51 type: 'EDITOR_STEP_ENTER',
52 payload: {
53 // set position here
54 position: {
55 stepId: step.id,
56 levelId: context.position.levelId,
57 complete: false,
58 },
59 actions: step.setup,
60 },
61 })
62
63 if (step.subtasks) {
64 // load subtask summary by running tests and parsing result
65 editorSend({
66 type: 'EDITOR_RUN_TEST',
67 payload: {
68 position: context.position,
69 },
70 })
71 }
72 }
73 },
74 editorLoadSolution(context: T.MachineContext): void {
75 const step: TT.Step | null = selectors.currentStep(context)
76 // tell editor to load solution commit

Callers

nothing calls this directly

Calls 1

editorSendFunction · 0.85

Tested by

no test coverage detected