@jupyterlab/codemirror 4.0.0-alpha.20 → 4.0.0-alpha.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
1
  // Copyright (c) Jupyter Development Team.
2
2
  // Distributed under the terms of the Modified BSD License.
3
- import { JSONExt } from '@lumino/coreutils';
4
3
  import { StateEffect, StateField } from '@codemirror/state';
5
4
  import { Decoration, EditorView } from '@codemirror/view';
6
5
  import { GenericSearchProvider, TextSearchEngine } from '@jupyterlab/documentsearch';
@@ -22,6 +21,7 @@ export class EditorSearchProvider {
22
21
  */
23
22
  this.query = null;
24
23
  this._isActive = true;
24
+ this._inSelection = null;
25
25
  this._isDisposed = false;
26
26
  this._cmHandler = null;
27
27
  this.currentIndex = null;
@@ -100,9 +100,10 @@ export class EditorSearchProvider {
100
100
  * @param v New value
101
101
  */
102
102
  async setIsActive(v) {
103
- if (this._isActive !== v) {
104
- this._isActive = v;
103
+ if (this._isActive === v) {
104
+ return;
105
105
  }
106
+ this._isActive = v;
106
107
  if (this._isActive) {
107
108
  if (this.query !== null) {
108
109
  await this.startQuery(this.query, this.filters);
@@ -112,6 +113,17 @@ export class EditorSearchProvider {
112
113
  await this.endQuery();
113
114
  }
114
115
  }
116
+ /**
117
+ * Set whether search should be limitted to specified selection.
118
+ */
119
+ async setSearchSelection(selection) {
120
+ if (this._inSelection === selection) {
121
+ return;
122
+ }
123
+ this._inSelection = selection;
124
+ await this.updateCodeMirror(this.model.sharedModel.getSource());
125
+ this._stateChanged.emit();
126
+ }
115
127
  /**
116
128
  * Initialize the search using the provided options. Should update the UI
117
129
  * to highlight all matches and "select" the first match.
@@ -131,6 +143,7 @@ export class EditorSearchProvider {
131
143
  * Stop the search and clean any UI elements.
132
144
  */
133
145
  async endQuery() {
146
+ await this.clearHighlight();
134
147
  await this.cmHandler.endQuery();
135
148
  this.currentIndex = null;
136
149
  }
@@ -139,17 +152,20 @@ export class EditorSearchProvider {
139
152
  *
140
153
  * @returns The next match if there is one.
141
154
  */
142
- async highlightNext(loop = true) {
155
+ async highlightNext(loop = true, fromCursor = false) {
143
156
  if (this.matchesCount === 0 || !this.isActive) {
144
157
  this.currentIndex = null;
145
158
  }
146
159
  else {
147
- // This starts from the cursor position
148
- let match = await this.cmHandler.highlightNext();
160
+ // This starts from the cursor position if `fromCursor` is true
161
+ let match = await this.cmHandler.highlightNext(fromCursor);
149
162
  if (match) {
150
163
  this.currentIndex = this.cmHandler.currentIndex;
151
164
  }
152
165
  else {
166
+ // Note: the loop logic is only used in single-editor (e.g. file editor)
167
+ // provider sub-classes, notebook has it's own loop logic and ignores
168
+ // `currentIndex` as set here.
153
169
  this.currentIndex = loop ? 0 : null;
154
170
  }
155
171
  return match;
@@ -161,13 +177,13 @@ export class EditorSearchProvider {
161
177
  *
162
178
  * @returns The previous match if there is one.
163
179
  */
164
- async highlightPrevious(loop = true) {
180
+ async highlightPrevious(loop = true, fromCursor = false) {
165
181
  if (this.matchesCount === 0 || !this.isActive) {
166
182
  this.currentIndex = null;
167
183
  }
168
184
  else {
169
- // This starts from the cursor position
170
- let match = await this.cmHandler.highlightPrevious();
185
+ // This starts from the cursor position if `fromCursor` is true
186
+ let match = await this.cmHandler.highlightPrevious(fromCursor);
171
187
  if (match) {
172
188
  this.currentIndex = this.cmHandler.currentIndex;
173
189
  }
@@ -183,6 +199,13 @@ export class EditorSearchProvider {
183
199
  *
184
200
  * If no match is selected, it won't do anything.
185
201
  *
202
+ * The caller of this method is expected to call `highlightNext` if after
203
+ * calling `replaceCurrentMatch()` attribute `this.currentIndex` is null.
204
+ * It is necesary to let the caller handle highlighting because this
205
+ * method is used in composition pattern (search engine of notebook cells)
206
+ * and highligthing on the composer (notebook) level needs to switch to next
207
+ * engine (cell) with matches.
208
+ *
186
209
  * @param newText The replacement text.
187
210
  * @returns Whether a replace occurred.
188
211
  */
@@ -193,17 +216,17 @@ export class EditorSearchProvider {
193
216
  let occurred = false;
194
217
  if (this.currentIndex !== null &&
195
218
  this.currentIndex < this.cmHandler.matches.length) {
196
- const editor = this.editor;
197
- const selection = editor.state.sliceDoc(editor.state.selection.main.from, editor.state.selection.main.to);
198
219
  const match = this.getCurrentMatch();
199
- // If cursor is not on a selection, highlight the next match
200
- if (selection !== (match === null || match === void 0 ? void 0 : match.text)) {
220
+ // If cursor there is no match selected, highlight the next match
221
+ if (!match) {
201
222
  this.currentIndex = null;
202
- // The next will be highlighted as a consequence of this returning false
203
223
  }
204
224
  else {
205
225
  this.cmHandler.matches.splice(this.currentIndex, 1);
206
- this.currentIndex = null;
226
+ this.currentIndex =
227
+ this.currentIndex < this.cmHandler.matches.length
228
+ ? Math.max(this.currentIndex - 1, 0)
229
+ : null;
207
230
  const substitutedText = (options === null || options === void 0 ? void 0 : options.regularExpression)
208
231
  ? match.text.replace(this.query, newText)
209
232
  : newText;
@@ -283,7 +306,22 @@ export class EditorSearchProvider {
283
306
  */
284
307
  async updateCodeMirror(content) {
285
308
  if (this.query !== null && this.isActive) {
286
- this.cmHandler.matches = await TextSearchEngine.search(this.query, content);
309
+ const allMatches = await TextSearchEngine.search(this.query, content);
310
+ if (this._inSelection) {
311
+ const editor = this.editor;
312
+ const start = editor.getOffsetAt(this._inSelection.start);
313
+ const end = editor.getOffsetAt(this._inSelection.end);
314
+ this.cmHandler.matches = allMatches.filter(match => match.position >= start && match.position <= end);
315
+ // A special case to always have a current match when in line selection mode.
316
+ if (this.cmHandler.currentIndex === null &&
317
+ this.cmHandler.matches.length > 0) {
318
+ await this.cmHandler.highlightNext(true, false);
319
+ }
320
+ this.currentIndex = this.cmHandler.currentIndex;
321
+ }
322
+ else {
323
+ this.cmHandler.matches = allMatches;
324
+ }
287
325
  }
288
326
  else {
289
327
  this.cmHandler.matches = [];
@@ -295,6 +333,13 @@ export class EditorSearchProvider {
295
333
  *
296
334
  * Highlighted texts (aka `matches`) must be provided through
297
335
  * the `matches` attributes.
336
+ *
337
+ * **NOTES:**
338
+ * - to retain the selection visibility `drawSelection` extension is needed.
339
+ * - highlighting starts from the cursor (if editor is focused, cursor moved,
340
+ * or `fromCursor` argument is set to `true`), or from last "current" match
341
+ * otherwise.
342
+ * - `currentIndex` is the (readonly) source of truth for the current match.
298
343
  */
299
344
  export class CodeMirrorSearchHighlighter {
300
345
  /**
@@ -303,18 +348,26 @@ export class CodeMirrorSearchHighlighter {
303
348
  * @param editor The CodeMirror editor
304
349
  */
305
350
  constructor(editor) {
351
+ this._current = null;
306
352
  this._cm = editor;
307
353
  this._matches = new Array();
308
354
  this._currentIndex = null;
309
355
  this._highlightEffect = StateEffect.define({
310
- map: (value, mapping) => ({
311
- matches: value.matches.map(v => ({
356
+ map: (value, mapping) => {
357
+ const transform = (v) => ({
312
358
  text: v.text,
313
359
  position: mapping.mapPos(v.position)
314
- }))
315
- })
360
+ });
361
+ return {
362
+ matches: value.matches.map(transform),
363
+ currentMatch: value.currentMatch
364
+ ? transform(value.currentMatch)
365
+ : null
366
+ };
367
+ }
316
368
  });
317
369
  this._highlightMark = Decoration.mark({ class: 'cm-searching' });
370
+ this._currentMark = Decoration.mark({ class: 'jp-current-match' });
318
371
  this._highlightField = StateField.define({
319
372
  create: () => {
320
373
  return Decoration.none;
@@ -330,6 +383,14 @@ export class CodeMirrorSearchHighlighter {
330
383
  // filter out old marks
331
384
  filter: () => false
332
385
  });
386
+ highlights = highlights.update({
387
+ add: e.value.currentMatch
388
+ ? [
389
+ this._currentMark.range(e.value.currentMatch.position, e.value.currentMatch.position +
390
+ e.value.currentMatch.text.length)
391
+ ]
392
+ : []
393
+ });
333
394
  }
334
395
  else {
335
396
  highlights = Decoration.none;
@@ -354,10 +415,12 @@ export class CodeMirrorSearchHighlighter {
354
415
  return this._matches;
355
416
  }
356
417
  set matches(v) {
357
- if (!JSONExt.deepEqual(this._matches, v)) {
358
- this._matches = v;
418
+ this._matches = v;
419
+ if (this._currentIndex !== null &&
420
+ this._currentIndex > this._matches.length) {
421
+ this._currentIndex = this._matches.length > 0 ? 0 : null;
359
422
  }
360
- this._refresh();
423
+ this._highlightCurrentMatch(true);
361
424
  }
362
425
  /**
363
426
  * Clear all highlighted matches
@@ -374,16 +437,8 @@ export class CodeMirrorSearchHighlighter {
374
437
  this._matches = [];
375
438
  if (this._cm) {
376
439
  this._cm.editor.dispatch({
377
- effects: this._highlightEffect.of({ matches: [] })
440
+ effects: this._highlightEffect.of({ matches: [], currentMatch: null })
378
441
  });
379
- const selection = this._cm.state.selection.main;
380
- const from = selection.from;
381
- const to = selection.to;
382
- // Setting a reverse selection to allow search-as-you-type to maintain the
383
- // current selected match. See comment in _findNext for more details.
384
- if (from !== to) {
385
- this._cm.editor.dispatch({ selection: { anchor: to, head: from } });
386
- }
387
442
  }
388
443
  return Promise.resolve();
389
444
  }
@@ -392,9 +447,9 @@ export class CodeMirrorSearchHighlighter {
392
447
  *
393
448
  * @returns The next match if available
394
449
  */
395
- highlightNext() {
396
- this._currentIndex = this._findNext(false);
397
- this._highlightCurrentMatch();
450
+ highlightNext(fromCursor = false, doNotModifySelection = false) {
451
+ this._currentIndex = this._findNext(false, fromCursor);
452
+ this._highlightCurrentMatch(doNotModifySelection);
398
453
  return Promise.resolve(this._currentIndex !== null
399
454
  ? this._matches[this._currentIndex]
400
455
  : undefined);
@@ -404,8 +459,8 @@ export class CodeMirrorSearchHighlighter {
404
459
  *
405
460
  * @returns The previous match if available
406
461
  */
407
- highlightPrevious() {
408
- this._currentIndex = this._findNext(true);
462
+ highlightPrevious(fromCursor = false) {
463
+ this._currentIndex = this._findNext(true, fromCursor);
409
464
  this._highlightCurrentMatch();
410
465
  return Promise.resolve(this._currentIndex !== null
411
466
  ? this._matches[this._currentIndex]
@@ -422,13 +477,35 @@ export class CodeMirrorSearchHighlighter {
422
477
  }
423
478
  else {
424
479
  this._cm = editor;
425
- this._refresh();
426
480
  if (this._currentIndex !== null) {
427
481
  this._highlightCurrentMatch();
428
482
  }
483
+ this._refresh();
429
484
  }
430
485
  }
431
- _highlightCurrentMatch() {
486
+ _selectCurrentMatch() {
487
+ const match = this._current;
488
+ if (!match) {
489
+ return;
490
+ }
491
+ if (!this._cm) {
492
+ return;
493
+ }
494
+ const selection = this._cm.editor.state.selection.main;
495
+ if (selection.from === match.position &&
496
+ selection.to === match.position + match.text.length) {
497
+ return;
498
+ }
499
+ const cursor = {
500
+ anchor: match.position,
501
+ head: match.position + match.text.length
502
+ };
503
+ this._cm.editor.dispatch({
504
+ selection: cursor,
505
+ scrollIntoView: true
506
+ });
507
+ }
508
+ _highlightCurrentMatch(doNotModifySelection = false) {
432
509
  if (!this._cm) {
433
510
  // no-op
434
511
  return;
@@ -436,19 +513,25 @@ export class CodeMirrorSearchHighlighter {
436
513
  // Highlight the current index
437
514
  if (this._currentIndex !== null) {
438
515
  const match = this.matches[this._currentIndex];
439
- this._cm.editor.focus();
440
- this._cm.editor.dispatch({
441
- selection: {
442
- anchor: match.position,
443
- head: match.position + match.text.length
444
- },
445
- scrollIntoView: true
446
- });
516
+ this._current = match;
517
+ // Do not change selection/scroll if user is selecting
518
+ if (!doNotModifySelection) {
519
+ if (this._cm.hasFocus()) {
520
+ // If editor is focused we actually set the cursor on the match.
521
+ this._selectCurrentMatch();
522
+ }
523
+ else {
524
+ // otherwise we just scroll to preserve the selection.
525
+ this._cm.editor.dispatch({
526
+ effects: EditorView.scrollIntoView(match.position)
527
+ });
528
+ }
529
+ }
447
530
  }
448
531
  else {
449
- // Set cursor to remove any selection
450
- this._cm.editor.dispatch({ selection: { anchor: 0 } });
532
+ this._current = null;
451
533
  }
534
+ this._refresh();
452
535
  }
453
536
  _refresh() {
454
537
  if (!this._cm) {
@@ -456,31 +539,38 @@ export class CodeMirrorSearchHighlighter {
456
539
  return;
457
540
  }
458
541
  let effects = [
459
- this._highlightEffect.of({ matches: this.matches })
542
+ this._highlightEffect.of({
543
+ matches: this.matches,
544
+ currentMatch: this._current
545
+ })
460
546
  ];
461
547
  if (!this._cm.state.field(this._highlightField, false)) {
462
548
  effects.push(StateEffect.appendConfig.of([this._highlightField]));
549
+ // set cursor on active match when editor gets focused
550
+ const focusExtension = EditorView.domEventHandlers({
551
+ focus: () => {
552
+ this._selectCurrentMatch();
553
+ }
554
+ });
555
+ effects.push(StateEffect.appendConfig.of([focusExtension]));
463
556
  }
464
557
  this._cm.editor.dispatch({ effects });
465
558
  }
466
- _findNext(reverse) {
559
+ _findNext(reverse, fromCursor = false) {
467
560
  if (this._matches.length === 0) {
468
561
  // No-op
469
562
  return null;
470
563
  }
471
- // In order to support search-as-you-type, we needed a way to allow the first
472
- // match to be selected when a search is started, but prevent the selected
473
- // search to move for each new keypress. To do this, when a search is ended,
474
- // the cursor is reversed, putting the head at the 'from' position. When a new
475
- // search is started, the cursor we want is at the 'from' position, so that the same
476
- // match is selected when the next key is entered (if it is still a match).
477
- //
478
- // When toggling through a search normally, the cursor is always set in the forward
479
- // direction, so head is always at the 'to' position. That way, if reverse = false,
480
- // the search proceeds from the 'to' position during normal toggling. If reverse = true,
481
- // the search always proceeds from the 'anchor' position, which is at the 'from'.
482
- const cursor = this._cm.state.selection.main;
483
- let lastPosition = reverse ? cursor.anchor : cursor.head;
564
+ let lastPosition = 0;
565
+ if (this._cm.hasFocus() || fromCursor) {
566
+ const cursor = this._cm.state.selection.main;
567
+ lastPosition = reverse ? cursor.anchor : cursor.head;
568
+ }
569
+ else if (this._current) {
570
+ lastPosition = reverse
571
+ ? this._current.position
572
+ : this._current.position + this._current.text.length;
573
+ }
484
574
  if (lastPosition === 0 && reverse && this.currentIndex === null) {
485
575
  // The default position is (0, 0) but we want to start from the end in that case
486
576
  lastPosition = this._cm.doc.length;
@@ -1 +1 @@
1
- {"version":3,"file":"searchprovider.js","sourceRoot":"","sources":["../src/searchprovider.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAgC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAmB,UAAU,EAAE,MAAM,mBAAmB,CAAC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C,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACnD,CAAC;IAlCe,cAAQ,WAkCvB,CAAA;AACH,CAAC,EAhDS,KAAK,KAAL,KAAK,QAgDd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/codemirror",
3
- "version": "4.0.0-alpha.20",
3
+ "version": "4.0.0-alpha.22",
4
4
  "description": "JupyterLab - CodeMirror Editor Provider",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -58,29 +58,29 @@
58
58
  "@codemirror/search": "^6.2.0",
59
59
  "@codemirror/state": "^6.2.0",
60
60
  "@codemirror/view": "^6.7.0",
61
- "@jupyter/ydoc": "^0.3.1",
62
- "@jupyterlab/codeeditor": "^4.0.0-alpha.20",
63
- "@jupyterlab/coreutils": "^6.0.0-alpha.20",
64
- "@jupyterlab/documentsearch": "^4.0.0-alpha.20",
65
- "@jupyterlab/nbformat": "^4.0.0-alpha.20",
66
- "@jupyterlab/translation": "^4.0.0-alpha.20",
61
+ "@jupyter/ydoc": "^0.3.4",
62
+ "@jupyterlab/codeeditor": "^4.0.0-alpha.22",
63
+ "@jupyterlab/coreutils": "^6.0.0-alpha.22",
64
+ "@jupyterlab/documentsearch": "^4.0.0-alpha.22",
65
+ "@jupyterlab/nbformat": "^4.0.0-alpha.22",
66
+ "@jupyterlab/translation": "^4.0.0-alpha.22",
67
67
  "@lezer/common": "^1.0.0",
68
68
  "@lezer/generator": "^1.0.0",
69
69
  "@lezer/highlight": "^1.0.0",
70
- "@lumino/coreutils": "^2.0.0-rc.0",
71
- "@lumino/disposable": "^2.0.0-rc.0",
72
- "@lumino/signaling": "^2.0.0-rc.0",
70
+ "@lumino/coreutils": "^2.0.0",
71
+ "@lumino/disposable": "^2.0.0",
72
+ "@lumino/signaling": "^2.0.0",
73
73
  "yjs": "^13.5.40"
74
74
  },
75
75
  "devDependencies": {
76
- "@jupyterlab/testing": "^4.0.0-alpha.20",
76
+ "@jupyterlab/testing": "^4.0.0-alpha.22",
77
77
  "@lezer/generator": "^1.0.0",
78
78
  "@lezer/lr": "^1.0.0",
79
79
  "@types/jest": "^29.2.0",
80
80
  "jest": "^29.2.0",
81
81
  "rimraf": "~3.0.0",
82
82
  "typedoc": "~0.23.25",
83
- "typescript": "~5.0.0-beta"
83
+ "typescript": "~5.0.2"
84
84
  },
85
85
  "publishConfig": {
86
86
  "access": "public"
package/src/extension.ts CHANGED
@@ -620,13 +620,13 @@ export namespace EditorExtensionRegistry {
620
620
  default: 1200,
621
621
  factory: () =>
622
622
  createConfigurableExtension((value: number) =>
623
- value !== 1200 ? drawSelection({ cursorBlinkRate: value }) : []
623
+ drawSelection({ cursorBlinkRate: value })
624
624
  ),
625
625
  schema: {
626
626
  type: 'number',
627
627
  title: trans.__('Cursor blinking rate'),
628
628
  description: trans.__(
629
- 'Half-period in milliseconds used for cursor blinking. The default blink rate is 1200ms. By setting this to zero, blinking can be disabled. Using a non-default value has a performance cost.'
629
+ 'Half-period in milliseconds used for cursor blinking. The default blink rate is 1200ms. By setting this to zero, blinking can be disabled.'
630
630
  )
631
631
  }
632
632
  }),
@@ -772,6 +772,18 @@ export namespace EditorExtensionRegistry {
772
772
  title: trans.__('Tab size')
773
773
  }
774
774
  }),
775
+ Object.freeze({
776
+ name: 'allowMultipleSelections',
777
+ default: true,
778
+ factory: () =>
779
+ createConfigurableExtension((value: boolean) =>
780
+ EditorState.allowMultipleSelections.of(value)
781
+ ),
782
+ schema: {
783
+ type: 'boolean',
784
+ title: trans.__('Multiple selections')
785
+ }
786
+ }),
775
787
  Object.freeze({
776
788
  name: 'customStyles',
777
789
  factory: () =>
@@ -15,7 +15,13 @@ import {
15
15
  SelectionRange
16
16
  } from '@codemirror/state';
17
17
  import { EditorView, ViewPlugin, ViewUpdate } from '@codemirror/view';
18
- import type { RelativePosition, Text, Transaction, YTextEvent } from 'yjs';
18
+ import type {
19
+ RelativePosition,
20
+ Text,
21
+ Transaction,
22
+ UndoManager,
23
+ YTextEvent
24
+ } from 'yjs';
19
25
  import {
20
26
  createAbsolutePositionFromRelativePosition,
21
27
  createRelativePositionFromJSON,
@@ -257,11 +263,33 @@ export const ySync = ViewPlugin.fromClass(
257
263
  * and the editor state.
258
264
  *
259
265
  * @param ytext Yjs text to bind
266
+ * @param undoManager Yjs text undo manager
260
267
  * @returns CodeMirror 6 extension
261
268
  */
262
- export function ybinding(ytext: Text): Extension {
269
+ export function ybinding({
270
+ ytext,
271
+ undoManager
272
+ }: {
273
+ ytext: Text;
274
+ undoManager?: UndoManager;
275
+ }): Extension {
263
276
  const ySyncConfig = new YSyncConfig(ytext);
264
277
  // We don't need the undo manager extension as in y-codemirror.next
265
278
  // because we deal with undo/redo with our own keyboard shortcut mechanism.
266
- return [ySyncFacet.of(ySyncConfig), ySync];
279
+ return [
280
+ ySyncFacet.of(ySyncConfig),
281
+ ySync,
282
+ // We need to add a new origin to the undo manager to ensure text updates
283
+ // are tracked.
284
+ undoManager
285
+ ? ViewPlugin.define(() => {
286
+ undoManager.addTrackedOrigin(ySyncConfig);
287
+ return {
288
+ destroy: () => {
289
+ undoManager.removeTrackedOrigin(ySyncConfig);
290
+ }
291
+ };
292
+ })
293
+ : []
294
+ ];
267
295
  }
package/src/language.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  // Copyright (c) Jupyter Development Team.
2
2
  // Distributed under the terms of the Modified BSD License.
3
3
 
4
- import { IEditorMimeTypeService } from '@jupyterlab/codeeditor';
5
- import { PathExt } from '@jupyterlab/coreutils';
6
4
  import {
7
5
  LanguageDescription,
8
6
  LanguageSupport,
@@ -10,17 +8,14 @@ import {
10
8
  StreamLanguage,
11
9
  StreamParser
12
10
  } from '@codemirror/language';
11
+ import { IEditorMimeTypeService } from '@jupyterlab/codeeditor';
12
+ import { PathExt } from '@jupyterlab/coreutils';
13
+ import { ITranslator, nullTranslator } from '@jupyterlab/translation';
14
+ import { buildParser } from '@lezer/generator';
13
15
  import { highlightTree } from '@lezer/highlight';
14
16
 
15
- // This ensures the language spec for python will be loaded when
16
- // we instantiate a new editor instance, which is required since
17
- // python is the default language and we don't want to split
18
- // the editor constructor because of asynchronous loading.
19
- import { python } from '@codemirror/lang-python';
20
17
  import { jupyterHighlightStyle } from './theme';
21
18
  import { IEditorLanguage, IEditorLanguageRegistry } from './token';
22
- import { buildParser } from '@lezer/generator';
23
- import { ITranslator, nullTranslator } from '@jupyterlab/translation';
24
19
 
25
20
  /**
26
21
  * CodeMirror language registry
@@ -476,19 +471,21 @@ export namespace EditorLanguageRegistry {
476
471
  mime: 'text/x-python',
477
472
  extensions: ['BUILD', 'bzl', 'py', 'pyw'],
478
473
  filename: /^(BUCK|BUILD)$/,
479
- load() {
480
- return Promise.resolve(python());
474
+ async load() {
475
+ const m = await import('@codemirror/lang-python');
476
+ return m.python();
481
477
  }
482
478
  },
483
479
  {
484
480
  name: 'ipython',
485
481
  displayName: trans.__('ipython'),
486
482
  mime: 'text/x-ipython',
487
- load: () => {
483
+ async load() {
488
484
  // FIXME Restore '?' operator - using the default python LanguageSupport allows
489
485
  // to activate feature such as code folding.
490
486
  // return Promise.resolve(legacy(mkPython({ singleOperators: /\?/ })));
491
- return Promise.resolve(python());
487
+ const m = await import('@codemirror/lang-python');
488
+ return m.python();
492
489
  }
493
490
  },
494
491
  {