Skip to content

Commit d306214

Browse files
committed
fix: cell completer
1 parent 785a0c5 commit d306214

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

packages/react/src/components/cell/CellAdapter.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export class CellAdapter {
224224
extensions: editorExtensions(),
225225
languages,
226226
});
227-
227+
//
228228
const cellModel = createStandaloneCell({
229229
cell_type: type,
230230
source: source,
@@ -251,7 +251,7 @@ export class CellAdapter {
251251
if (this._type === 'markdown') {
252252
(this._cell as MarkdownCell).rendered = false;
253253
}
254-
254+
//
255255
this._sessionContext.kernelChanged.connect(
256256
(_, arg: Session.ISessionConnection.IKernelChangedArgs) => {
257257
const kernelConnection = arg.newValue;
@@ -281,6 +281,7 @@ export class CellAdapter {
281281
}
282282
});
283283
});
284+
// Completer.
284285
const editor = this._cell.editor;
285286
const model = new CompleterModel();
286287
const completer = new Completer({ editor, model });
@@ -308,8 +309,10 @@ export class CellAdapter {
308309
timeout,
309310
});
310311
});
311-
handler.editor = editor;
312-
312+
this._cell.ready.then(() => {
313+
handler.editor = this._cell && this._cell.editor;
314+
});
315+
//
313316
CellCommands(commands, this._cell!, handler, this);
314317
completer.hide();
315318
completer.addClass('jp-Completer-Cell');

packages/react/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function shim(regExp) {
1818

1919
const ENTRY =
2020
// './src/app/App';
21-
// './src/examples/Cell';
21+
'./src/examples/Cell';
2222
// './src/examples/Cells';
2323
// './src/examples/CellsExecute';
2424
// './src/examples/CellLite';
@@ -39,7 +39,7 @@ const ENTRY =
3939
// './src/examples/KernelExecutor';
4040
// './src/examples/Lumino';
4141
// './src/examples/Matplotlib';
42-
'./src/examples/Notebook';
42+
// './src/examples/Notebook';
4343
// './src/examples/NotebookUrl';
4444
// './src/examples/NotebookColorMode';
4545
// './src/examples/NotebookKernelChange';

0 commit comments

Comments
 (0)