Skip to content

Commit 1eb30fd

Browse files
Saner autocomplete feature (#1054)
* Add autocompletion and documentation display (#2) Add autocompletion and documentation display for builtins * Integrate code autocompletion * Bump js-slang version, handle editor prepend * Comment * Saner autocomplete behaviour Co-authored-by: martin-henz <henz@comp.nus.edu.sg>
1 parent bfc6b46 commit 1eb30fd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/sagas/workspaces.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,18 @@ export default function* workspaceSaga(): SagaIterator {
124124
autocompleteCode = prepend + '\n' + editorValue;
125125
}
126126

127-
const editorNames: any = yield call(
127+
const [editorNames, displaySuggestions] = yield call(
128128
getNames,
129129
autocompleteCode,
130130
action.payload.row + prependLength,
131131
action.payload.column
132132
);
133133

134+
if (!displaySuggestions) {
135+
yield call(action.payload.callback);
136+
return;
137+
}
138+
134139
const editorSuggestions = editorNames.map((name: any) => ({
135140
caption: name.name,
136141
value: name.name,

0 commit comments

Comments
 (0)