Skip to content

Commit 7680705

Browse files
committed
Merge branch 'sa_2021' into non-det-sa_2021-rebased
2 parents aa52208 + 9da0fe4 commit 7680705

File tree

23 files changed

+226
-15
lines changed

23 files changed

+226
-15
lines changed

package-lock.json

Lines changed: 23 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"draft-js": "^0.10.5",
4646
"flexboxgrid": "^6.3.1",
4747
"flexboxgrid-helpers": "^1.1.3",
48-
"js-slang": "^0.4.20",
48+
"js-slang": "^0.4.25",
4949
"jwt-decode": "^2.2.0",
5050
"lodash": "^4.17.13",
5151
"lz-string": "^1.4.4",

src/actions/actionTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const END_CLEAR_CONTEXT = 'END_CLEAR_CONTEXT';
4040
export const ENSURE_LIBRARIES_LOADED = 'ENSURE_LIBRARIES_LOADED';
4141
export const EVAL_EDITOR = 'EVAL_EDITOR';
4242
export const EVAL_REPL = 'EVAL_REPL';
43+
export const PROMPT_AUTOCOMPLETE = 'PROMPT_AUTOCOMPLETE';
4344
// For interpreting code blocks silently (e.g. prepend) BEFORE the test case is run
4445
export const EVAL_SILENT = 'EVAL_SILENT';
4546
export const EVAL_TESTCASE = 'EVAL_TESTCASE';

src/actions/workspaces.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,16 @@ export const updateHasUnsavedChanges = (
215215
workspaceLocation,
216216
hasUnsavedChanges
217217
});
218+
219+
export const promptAutocomplete = (
220+
workspaceLocation: WorkspaceLocation,
221+
row: number,
222+
column: number,
223+
callback: any // TODO: define a type for this
224+
) =>
225+
action(actionTypes.PROMPT_AUTOCOMPLETE, {
226+
workspaceLocation,
227+
row,
228+
column,
229+
callback
230+
});

src/components/Playground.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export interface IDispatchProps {
106106
handleDebuggerResume: () => void;
107107
handleDebuggerReset: () => void;
108108
handleToggleEditorAutorun: () => void;
109+
handlePromptAutocomplete: (row: number, col: number, callback: any) => void;
109110
}
110111

111112
type PlaygroundState = {
@@ -278,6 +279,7 @@ class Playground extends React.Component<IPlaygroundProps, PlaygroundState> {
278279
handleDeclarationNavigate: this.props.handleDeclarationNavigate,
279280
handleEditorEval: this.props.handleEditorEval,
280281
handleEditorValueChange: this.props.handleEditorValueChange,
282+
handlePromptAutocomplete: this.props.handlePromptAutocomplete,
281283
handleFinishInvite: this.props.handleFinishInvite,
282284
sharedbAceInitValue: this.props.sharedbAceInitValue,
283285
sharedbAceIsInviting: this.props.sharedbAceIsInviting,

src/components/__tests__/Playground.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ const baseProps = {
5656
handleUsingSubst: (usingSubst: boolean) => {},
5757
handleDebuggerPause: () => {},
5858
handleDebuggerResume: () => {},
59-
handleDebuggerReset: () => {}
59+
handleDebuggerReset: () => {},
60+
handlePromptAutocomplete: (row: number, col: number, callback: any) => {}
6061
};
6162

6263
const testValueProps: IPlaygroundProps = {

src/components/academy/grading/GradingWorkspace.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export type DispatchProps = {
8888
handleDebuggerReset: () => void;
8989
handleUpdateCurrentSubmissionId: (submissionId: number, questionId: number) => void;
9090
handleUpdateHasUnsavedChanges: (hasUnsavedChanges: boolean) => void;
91+
handlePromptAutocomplete: (row: number, col: number, callback: any) => void;
9192
};
9293

9394
class GradingWorkspace extends React.Component<GradingWorkspaceProps> {
@@ -179,6 +180,7 @@ class GradingWorkspace extends React.Component<GradingWorkspaceProps> {
179180
highlightedLines: this.props.highlightedLines,
180181
newCursorPosition: this.props.newCursorPosition,
181182
handleEditorUpdateBreakpoints: this.props.handleEditorUpdateBreakpoints,
183+
handlePromptAutocomplete: this.props.handlePromptAutocomplete,
182184
isEditorAutorun: false
183185
}
184186
: undefined,

src/components/assessment/AssessmentWorkspace.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export type DispatchProps = {
108108
handleDebuggerPause: () => void;
109109
handleDebuggerResume: () => void;
110110
handleDebuggerReset: () => void;
111+
handlePromptAutocomplete: (row: number, col: number, callback: any) => void;
111112
};
112113

113114
class AssessmentWorkspace extends React.Component<
@@ -248,6 +249,7 @@ class AssessmentWorkspace extends React.Component<
248249
highlightedLines: this.props.highlightedLines,
249250
newCursorPosition: this.props.newCursorPosition,
250251
handleEditorUpdateBreakpoints: this.props.handleEditorUpdateBreakpoints,
252+
handlePromptAutocomplete: this.props.handlePromptAutocomplete,
251253
isEditorAutorun: false
252254
}
253255
: undefined,

src/components/assessment/__tests__/AssessmentWorkspace.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const defaultProps: AssessmentWorkspaceProps = {
4545
handleDebuggerPause: () => {},
4646
handleDebuggerResume: () => {},
4747
handleDebuggerReset: () => {},
48+
handlePromptAutocomplete: (row: number, col: number, callback: any) => {},
4849
isRunning: false,
4950
isDebugging: false,
5051
enableDebugging: false,

src/components/missionControl/EditingWorkspace.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export type DispatchProps = {
102102
handleDebuggerReset: () => void;
103103
handleUpdateCurrentAssessmentId: (assessmentId: number, questionId: number) => void;
104104
handleUpdateHasUnsavedChanges: (hasUnsavedChanges: boolean) => void;
105+
handlePromptAutocomplete: (row: number, col: number, callback: any) => void;
105106
};
106107

107108
interface IState {
@@ -182,6 +183,7 @@ class AssessmentWorkspace extends React.Component<AssessmentWorkspaceProps, ISta
182183
newCursorPosition: this.props.newCursorPosition,
183184
handleEditorUpdateBreakpoints: this.props.handleEditorUpdateBreakpoints,
184185
handleUpdateHasUnsavedChanges: this.props.handleUpdateHasUnsavedChanges,
186+
handlePromptAutocomplete: this.props.handlePromptAutocomplete,
185187
isEditorAutorun: false
186188
}
187189
: undefined,

0 commit comments

Comments
 (0)