File tree Expand file tree Collapse file tree 4 files changed +27
-6
lines changed Expand file tree Collapse file tree 4 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,15 @@ const Application: React.FC = () => {
138
138
case MessageTypeNames . AssessmentAnswer :
139
139
dispatch ( SessionActions . submitAnswer ( message . questionId , message . answer ) ) ;
140
140
break ;
141
+ case MessageTypeNames . SetEditorBreakpoints :
142
+ dispatch (
143
+ WorkspaceActions . setEditorBreakpoint (
144
+ message . workspaceLocation ,
145
+ 0 ,
146
+ message . newBreakpoints
147
+ )
148
+ ) ;
149
+ break ;
141
150
}
142
151
} ) ;
143
152
// eslint-disable-next-line react-hooks/exhaustive-deps
Original file line number Diff line number Diff line change @@ -412,14 +412,16 @@ const AssessmentWorkspace: React.FC<AssessmentWorkspaceProps> = props => {
412
412
case QuestionTypes . programming || QuestionTypes . voting :
413
413
const prepend = question . prepend ;
414
414
const code = question . answer ?? question . solutionTemplate ;
415
+ const breakpoints = editorTabs [ 0 ] ?. breakpoints ?? [ ] ;
415
416
sendToWebview (
416
417
Messages . NewEditor (
417
418
workspaceLocation ,
418
419
`assessment${ assessment . id } ` ,
419
420
props . questionId ,
420
421
chapter ,
421
422
prepend ,
422
- code
423
+ code ,
424
+ breakpoints
423
425
)
424
426
) ;
425
427
break ;
@@ -449,14 +451,16 @@ const AssessmentWorkspace: React.FC<AssessmentWorkspaceProps> = props => {
449
451
// TODO: Hardcoded to make use of the first editor tab. Refactoring is needed for this workspace to enable Folder mode.
450
452
handleEditorValueChange ( 0 , answer ) ;
451
453
// Hacky way to view the editor, might cause issues
454
+ const breakpoints = editorTabs [ 0 ] ?. breakpoints ?? [ ] ;
452
455
sendToWebview (
453
456
Messages . NewEditor (
454
457
workspaceLocation ,
455
458
`submission${ _submissionId } ` ,
456
459
questionId ,
457
460
question . library . chapter ,
458
461
'' ,
459
- answer
462
+ answer ,
463
+ breakpoints
460
464
)
461
465
) ;
462
466
//
Original file line number Diff line number Diff line change @@ -33,14 +33,16 @@ const Messages = createMessages({
33
33
questionId : number ,
34
34
chapter : number ,
35
35
prepend : string ,
36
- initialCode : string
36
+ initialCode : string ,
37
+ breakpoints : string [ ]
37
38
) => ( {
38
39
workspaceLocation,
39
40
assessmentName,
40
41
questionId,
41
42
chapter,
42
43
prepend,
43
- initialCode
44
+ initialCode,
45
+ breakpoints
44
46
} ) ,
45
47
Text : ( workspaceLocation : VscWorkspaceLocation , code : string ) => ( {
46
48
workspaceLocation,
@@ -99,7 +101,11 @@ const Messages = createMessages({
99
101
questionId,
100
102
answer
101
103
} ) ,
102
- LoginWithBrowser : ( route : string ) => ( { route } )
104
+ LoginWithBrowser : ( route : string ) => ( { route } ) ,
105
+ SetEditorBreakpoints : ( workspaceLocation : VscWorkspaceLocation , newBreakpoints : string [ ] ) => ( {
106
+ workspaceLocation,
107
+ newBreakpoints
108
+ } )
103
109
} ) ;
104
110
105
111
export default Messages ;
Original file line number Diff line number Diff line change @@ -381,14 +381,16 @@ const Playground: React.FC<PlaygroundProps> = props => {
381
381
return ;
382
382
}
383
383
const initialCode = editorTabs [ 0 ] ?. value ?? '' ;
384
+ const breakpoints = editorTabs [ 0 ] ?. breakpoints ?? [ ] ;
384
385
sendToWebview (
385
386
Messages . NewEditor (
386
387
workspaceLocation ,
387
388
'playground' ,
388
389
1 ,
389
390
playgroundSourceChapter ,
390
391
'' ,
391
- initialCode
392
+ initialCode ,
393
+ breakpoints
392
394
)
393
395
) ;
394
396
// We don't want to re-send this message even when the variables change
You can’t perform that action at this time.
0 commit comments