@theia/notebook 1.58.3 → 1.59.0-next.62

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.
Files changed (44) hide show
  1. package/lib/browser/notebook-editor-widget-factory.d.ts.map +1 -1
  2. package/lib/browser/notebook-editor-widget-factory.js +10 -1
  3. package/lib/browser/notebook-editor-widget-factory.js.map +1 -1
  4. package/lib/browser/notebook-editor-widget.d.ts +2 -0
  5. package/lib/browser/notebook-editor-widget.d.ts.map +1 -1
  6. package/lib/browser/notebook-editor-widget.js +10 -0
  7. package/lib/browser/notebook-editor-widget.js.map +1 -1
  8. package/lib/browser/notebook-frontend-module.d.ts.map +1 -1
  9. package/lib/browser/notebook-frontend-module.js +4 -1
  10. package/lib/browser/notebook-frontend-module.js.map +1 -1
  11. package/lib/browser/service/notebook-execution-service.d.ts +2 -1
  12. package/lib/browser/service/notebook-execution-service.d.ts.map +1 -1
  13. package/lib/browser/service/notebook-execution-service.js +18 -0
  14. package/lib/browser/service/notebook-execution-service.js.map +1 -1
  15. package/lib/browser/service/notebook-execution-state-service.d.ts +0 -1
  16. package/lib/browser/service/notebook-execution-state-service.d.ts.map +1 -1
  17. package/lib/browser/service/notebook-execution-state-service.js +0 -4
  18. package/lib/browser/service/notebook-execution-state-service.js.map +1 -1
  19. package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts +4 -3
  20. package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts.map +1 -1
  21. package/lib/browser/service/notebook-kernel-quick-pick-service.js +13 -0
  22. package/lib/browser/service/notebook-kernel-quick-pick-service.js.map +1 -1
  23. package/lib/browser/service/notebook-model-resolver-service.d.ts.map +1 -1
  24. package/lib/browser/service/notebook-model-resolver-service.js +13 -6
  25. package/lib/browser/service/notebook-model-resolver-service.js.map +1 -1
  26. package/lib/browser/service/notebook-monaco-text-model-service.d.ts +8 -3
  27. package/lib/browser/service/notebook-monaco-text-model-service.d.ts.map +1 -1
  28. package/lib/browser/service/notebook-monaco-text-model-service.js +30 -6
  29. package/lib/browser/service/notebook-monaco-text-model-service.js.map +1 -1
  30. package/lib/browser/view/notebook-viewport-service.d.ts +1 -1
  31. package/lib/browser/view/notebook-viewport-service.d.ts.map +1 -1
  32. package/lib/browser/view/notebook-viewport-service.js +2 -1
  33. package/lib/browser/view/notebook-viewport-service.js.map +1 -1
  34. package/package.json +8 -8
  35. package/src/browser/notebook-editor-widget-factory.ts +12 -1
  36. package/src/browser/notebook-editor-widget.tsx +13 -2
  37. package/src/browser/notebook-frontend-module.ts +5 -2
  38. package/src/browser/service/notebook-execution-service.ts +20 -2
  39. package/src/browser/service/notebook-execution-state-service.ts +0 -5
  40. package/src/browser/service/notebook-kernel-quick-pick-service.ts +14 -6
  41. package/src/browser/service/notebook-model-resolver-service.ts +13 -6
  42. package/src/browser/service/notebook-monaco-text-model-service.ts +28 -7
  43. package/src/browser/style/index.css +35 -13
  44. package/src/browser/view/notebook-viewport-service.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"notebook-model-resolver-service.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-model-resolver-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,sCAAwF;AACxF,4DAAkE;AAElE,6EAAyE;AAGzE,yDAAqD;AACrD,sEAAiE;AAEjE,sDAAoD;AAO7C,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAAlC;QAcO,4BAAuB,GAAG,IAAI,cAAO,EAAiB,CAAC;QACxD,qBAAgB,GAAG,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC;QACrD,6BAAwB,GAAG,IAAI,cAAO,EAAiB,CAAC;QACzD,sBAAiB,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,OAAO,EAAE,CAAC;gBACV,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;YACtB,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;IAES,uBAAuB,CAAC,QAAa;;QAC3C,OAAO,MAAA,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,WACvD,OAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,eAAe,IAAI,IAAA,YAAK,EAAC,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA,EAAA,CACvI,0CAAE,IAAI,CAAC;IACZ,CAAC;CAEJ,CAAA;AA/HY,oEAA4B;AAG3B;IADT,IAAA,kBAAM,EAAC,0BAAW,CAAC;sCACG,0BAAW;iEAAC;AAGzB;IADT,IAAA,kBAAM,EAAC,uBAAgB,CAAC;;sEACoB;AAGnC;IADT,IAAA,kBAAM,EAAC,kCAAe,CAAC;sCACG,kCAAe;qEAAC;AAGjC;IADT,IAAA,kBAAM,EAAC,6CAAoB,CAAC;sCACG,6CAAoB;0EAAC;uCAZ5C,4BAA4B;IADxC,IAAA,sBAAU,GAAE;GACA,4BAA4B,CA+HxC"}
1
+ {"version":3,"file":"notebook-model-resolver-service.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-model-resolver-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,sCAAwF;AACxF,4DAAkE;AAElE,6EAAyE;AAGzE,yDAAqD;AAC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,kCAAe;qEAAC;AAGjC;IADT,IAAA,kBAAM,EAAC,6CAAoB,CAAC;sCACG,6CAAoB;0EAAC;uCAZ5C,4BAA4B;IADxC,IAAA,sBAAU,GAAE;GACA,4BAA4B,CAsIxC"}
@@ -1,14 +1,19 @@
1
- import { ReferenceCollection, URI, Reference, Event } from '@theia/core';
2
- import { MonacoTextModelService } from '@theia/monaco/lib/browser/monaco-text-model-service';
1
+ import { URI, Reference, Event, Emitter } from '@theia/core';
2
+ import { MonacoTextModelService, MonacoEditorModelFilter } from '@theia/monaco/lib/browser/monaco-text-model-service';
3
3
  import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model';
4
4
  import { NotebookModel } from '../view-model/notebook-model';
5
+ export declare class NotebookMonacoEditorModelFilter implements MonacoEditorModelFilter {
6
+ protected readonly onDidCreateCellModelEmitter: Emitter<MonacoEditorModel>;
7
+ get onDidCreateCellModel(): Event<MonacoEditorModel>;
8
+ filter(model: MonacoEditorModel): boolean;
9
+ }
5
10
  /**
6
11
  * special service for creating monaco textmodels for notebook cells.
7
12
  * Its for optimization purposes since there is alot of overhead otherwise with calling the backend to create a document for each cell and other smaller things.
8
13
  */
9
14
  export declare class NotebookMonacoTextModelService {
10
15
  protected readonly monacoTextModelService: MonacoTextModelService;
11
- protected readonly cellmodels: ReferenceCollection<string, MonacoEditorModel>;
16
+ protected readonly notebookMonacoEditorModelFilter: NotebookMonacoEditorModelFilter;
12
17
  getOrCreateNotebookCellModelReference(uri: URI): Promise<Reference<MonacoEditorModel>>;
13
18
  createTextModelsForNotebook(notebook: NotebookModel): Promise<void>;
14
19
  get onDidCreateNotebookCellModel(): Event<MonacoEditorModel>;
@@ -1 +1 @@
1
- {"version":3,"file":"notebook-monaco-text-model-service.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-monaco-text-model-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D;;;GAGG;AACH,qBACa,8BAA8B;IAGvC,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IAElE,SAAS,CAAC,QAAQ,CAAC,UAAU,iDAE3B;IAEF,qCAAqC,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAIhF,2BAA2B,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzE,IAAI,4BAA4B,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAE3D;CACJ"}
1
+ {"version":3,"file":"notebook-monaco-text-model-service.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-monaco-text-model-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AACtH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,qBACa,+BAAgC,YAAW,uBAAuB;IAE3E,SAAS,CAAC,QAAQ,CAAC,2BAA2B,6BAAoC;IAElF,IAAI,oBAAoB,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAEnD;IAED,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO;CAU5C;AAED;;;GAGG;AACH,qBACa,8BAA8B;IAGvC,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IAGlE,SAAS,CAAC,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;IAEpF,qCAAqC,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAIhF,2BAA2B,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzE,IAAI,4BAA4B,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAE3D;CACJ"}
@@ -15,27 +15,47 @@
15
15
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
16
  // *****************************************************************************
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.NotebookMonacoTextModelService = void 0;
18
+ exports.NotebookMonacoTextModelService = exports.NotebookMonacoEditorModelFilter = void 0;
19
19
  const tslib_1 = require("tslib");
20
20
  const core_1 = require("@theia/core");
21
21
  const inversify_1 = require("@theia/core/shared/inversify");
22
22
  const monaco_text_model_service_1 = require("@theia/monaco/lib/browser/monaco-text-model-service");
23
+ const notebook_common_1 = require("../../common/notebook-common");
24
+ let NotebookMonacoEditorModelFilter = class NotebookMonacoEditorModelFilter {
25
+ constructor() {
26
+ this.onDidCreateCellModelEmitter = new core_1.Emitter();
27
+ }
28
+ get onDidCreateCellModel() {
29
+ return this.onDidCreateCellModelEmitter.event;
30
+ }
31
+ filter(model) {
32
+ const applies = model.uri.startsWith(notebook_common_1.CellUri.cellUriScheme);
33
+ if (applies) {
34
+ // If the model is for a notebook cell, we emit the event to notify the listeners.
35
+ // We create our own event here, as we don't want to propagate the creation of the cell to the plugin host.
36
+ // Instead, we want to do that ourselves once the notebook model is completely initialized.
37
+ this.onDidCreateCellModelEmitter.fire(model);
38
+ }
39
+ return applies;
40
+ }
41
+ };
42
+ exports.NotebookMonacoEditorModelFilter = NotebookMonacoEditorModelFilter;
43
+ exports.NotebookMonacoEditorModelFilter = NotebookMonacoEditorModelFilter = tslib_1.__decorate([
44
+ (0, inversify_1.injectable)()
45
+ ], NotebookMonacoEditorModelFilter);
23
46
  /**
24
47
  * special service for creating monaco textmodels for notebook cells.
25
48
  * Its for optimization purposes since there is alot of overhead otherwise with calling the backend to create a document for each cell and other smaller things.
26
49
  */
27
50
  let NotebookMonacoTextModelService = class NotebookMonacoTextModelService {
28
- constructor() {
29
- this.cellmodels = new core_1.ReferenceCollection(uri => this.monacoTextModelService.createUnmanagedModel(new core_1.URI(uri)));
30
- }
31
51
  getOrCreateNotebookCellModelReference(uri) {
32
- return this.cellmodels.acquire(uri.toString());
52
+ return this.monacoTextModelService.createModelReference(uri);
33
53
  }
34
54
  async createTextModelsForNotebook(notebook) {
35
55
  await Promise.all(notebook.cells.map(cell => cell.resolveTextModel()));
36
56
  }
37
57
  get onDidCreateNotebookCellModel() {
38
- return this.cellmodels.onDidCreate;
58
+ return this.notebookMonacoEditorModelFilter.onDidCreateCellModel;
39
59
  }
40
60
  };
41
61
  exports.NotebookMonacoTextModelService = NotebookMonacoTextModelService;
@@ -43,6 +63,10 @@ tslib_1.__decorate([
43
63
  (0, inversify_1.inject)(monaco_text_model_service_1.MonacoTextModelService),
44
64
  tslib_1.__metadata("design:type", monaco_text_model_service_1.MonacoTextModelService)
45
65
  ], NotebookMonacoTextModelService.prototype, "monacoTextModelService", void 0);
66
+ tslib_1.__decorate([
67
+ (0, inversify_1.inject)(NotebookMonacoEditorModelFilter),
68
+ tslib_1.__metadata("design:type", NotebookMonacoEditorModelFilter)
69
+ ], NotebookMonacoTextModelService.prototype, "notebookMonacoEditorModelFilter", void 0);
46
70
  exports.NotebookMonacoTextModelService = NotebookMonacoTextModelService = tslib_1.__decorate([
47
71
  (0, inversify_1.injectable)()
48
72
  ], NotebookMonacoTextModelService);
@@ -1 +1 @@
1
- {"version":3,"file":"notebook-monaco-text-model-service.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-monaco-text-model-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,sCAAyE;AACzE,4DAAkE;AAClE,mGAA6F;AAI7F;;;GAGG;AAEI,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAApC;QAKgB,eAAU,GAAG,IAAI,0BAAmB,CACnD,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,oBAAoB,CAAC,IAAI,UAAG,CAAC,GAAG,CAAC,CAAC,CACxE,CAAC;IAaN,CAAC;IAXG,qCAAqC,CAAC,GAAQ;QAC1C,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,2BAA2B,CAAC,QAAuB;QACrD,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,4BAA4B;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;IACvC,CAAC;CACJ,CAAA;AApBY,wEAA8B;AAGpB;IADlB,IAAA,kBAAM,EAAC,kDAAsB,CAAC;sCACY,kDAAsB;8EAAC;yCAHzD,8BAA8B;IAD1C,IAAA,sBAAU,GAAE;GACA,8BAA8B,CAoB1C"}
1
+ {"version":3,"file":"notebook-monaco-text-model-service.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-monaco-text-model-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uD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;8EAAC;AAG/C;IADlB,IAAA,kBAAM,EAAC,+BAA+B,CAAC;sCACY,+BAA+B;uFAAC;yCAN3E,8BAA8B;IAD1C,IAAA,sBAAU,GAAE;GACA,8BAA8B,CAmB1C"}
@@ -8,7 +8,7 @@ export declare class NotebookViewportService implements Disposable {
8
8
  protected onDidChangeViewportEmitter: Emitter<void>;
9
9
  readonly onDidChangeViewport: import("vscode-jsonrpc/lib/common/events").Event<void>;
10
10
  protected _viewportElement: HTMLDivElement | undefined;
11
- protected resizeObserver: ResizeObserver;
11
+ protected resizeObserver?: ResizeObserver;
12
12
  set viewportElement(element: HTMLDivElement | undefined);
13
13
  isElementInViewport(element: HTMLElement): boolean;
14
14
  onScroll(e: HTMLDivElement): void;
@@ -1 +1 @@
1
- {"version":3,"file":"notebook-viewport-service.d.ts","sourceRoot":"","sources":["../../../src/browser/view/notebook-viewport-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAE5E;;;GAGG;AACH,qBACa,uBAAwB,YAAW,UAAU;IAEtD,SAAS,CAAC,0BAA0B,gBAAuB;IAC3D,QAAQ,CAAC,mBAAmB,yDAAyC;IAErE,SAAS,CAAC,gBAAgB,EAAE,cAAc,GAAG,SAAS,CAAC;IAEvD,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAEzC,IAAI,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,EAQtD;IAED,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IASlD,QAAQ,CAAC,CAAC,EAAE,cAAc,GAAG,IAAI;IAIjC,OAAO,IAAI,IAAI;CAGlB"}
1
+ {"version":3,"file":"notebook-viewport-service.d.ts","sourceRoot":"","sources":["../../../src/browser/view/notebook-viewport-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAE5E;;;GAGG;AACH,qBACa,uBAAwB,YAAW,UAAU;IAEtD,SAAS,CAAC,0BAA0B,gBAAuB;IAC3D,QAAQ,CAAC,mBAAmB,yDAAyC;IAErE,SAAS,CAAC,gBAAgB,EAAE,cAAc,GAAG,SAAS,CAAC;IAEvD,SAAS,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IAE1C,IAAI,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,EAQtD;IAED,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IASlD,QAAQ,CAAC,CAAC,EAAE,cAAc,GAAG,IAAI;IAIjC,OAAO,IAAI,IAAI;CAGlB"}
@@ -50,7 +50,8 @@ let NotebookViewportService = class NotebookViewportService {
50
50
  this.onDidChangeViewportEmitter.fire();
51
51
  }
52
52
  dispose() {
53
- this.resizeObserver.disconnect();
53
+ var _a;
54
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
54
55
  }
55
56
  };
56
57
  exports.NotebookViewportService = NotebookViewportService;
@@ -1 +1 @@
1
- {"version":3,"file":"notebook-viewport-service.js","sourceRoot":"","sources":["../../../src/browser/view/notebook-viewport-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAGhF,4DAA0D;AAC1D,sGAA4E;AAE5E;;;GAGG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAA7B;QAEO,+BAA0B,GAAG,IAAI,wCAAO,EAAQ,CAAC;QAClD,wBAAmB,GAAG,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC;IAgCzE,CAAC;IA1BG,IAAI,eAAe,CAAC,OAAmC;;QACnD,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC;QAChC,IAAI,OAAO,EAAE,CAAC;YACV,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,CAAC;YACvC,MAAA,IAAI,CAAC,cAAc,0CAAE,UAAU,EAAE,CAAC;YAClC,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,CAAC,CAAC;YACvF,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;IACL,CAAC;IAED,mBAAmB,CAAC,OAAoB;QACpC,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACxB,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;YAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,CAAC;YAC/D,OAAO,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC7F,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,QAAQ,CAAC,CAAiB;QACtB,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,CAAC;IAC3C,CAAC;IAED,OAAO;QACH,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC;CACJ,CAAA;AAnCY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CAmCnC"}
1
+ {"version":3,"file":"notebook-viewport-service.js","sourceRoot":"","sources":["../../../src/browser/view/notebook-viewport-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,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IAED,QAAQ,CAAC,CAAiB;QACtB,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,CAAC;IAC3C,CAAC;IAED,OAAO;;QACH,MAAA,IAAI,CAAC,cAAc,0CAAE,UAAU,EAAE,CAAC;IACtC,CAAC;CACJ,CAAA;AAnCY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CAmCnC"}
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@theia/notebook",
3
- "version": "1.58.3",
3
+ "version": "1.59.0-next.62+9e43c93ad",
4
4
  "description": "Theia - Notebook Extension",
5
5
  "dependencies": {
6
- "@theia/core": "1.58.3",
7
- "@theia/editor": "1.58.3",
8
- "@theia/filesystem": "1.58.3",
9
- "@theia/monaco": "1.58.3",
6
+ "@theia/core": "1.59.0-next.62+9e43c93ad",
7
+ "@theia/editor": "1.59.0-next.62+9e43c93ad",
8
+ "@theia/filesystem": "1.59.0-next.62+9e43c93ad",
9
+ "@theia/monaco": "1.59.0-next.62+9e43c93ad",
10
10
  "@theia/monaco-editor-core": "1.96.302",
11
- "@theia/outline-view": "1.58.3",
11
+ "@theia/outline-view": "1.59.0-next.62+9e43c93ad",
12
12
  "advanced-mark.js": "^2.6.0",
13
13
  "react-perfect-scrollbar": "^1.5.8",
14
14
  "tslib": "^2.6.2"
@@ -46,12 +46,12 @@
46
46
  "watch": "theiaext watch"
47
47
  },
48
48
  "devDependencies": {
49
- "@theia/ext-scripts": "1.58.3",
49
+ "@theia/ext-scripts": "1.58.0",
50
50
  "@types/markdown-it": "^12.2.3",
51
51
  "@types/vscode-notebook-renderer": "^1.72.0"
52
52
  },
53
53
  "nyc": {
54
54
  "extends": "../../configs/nyc.json"
55
55
  },
56
- "gitHead": "ca70c15332f91e0f61b12cd147b5ff8326e2e6d2"
56
+ "gitHead": "9e43c93ad61ea977db3974207bac5d7c1fd3ccd6"
57
57
  }
@@ -20,6 +20,8 @@ import { inject, injectable } from '@theia/core/shared/inversify';
20
20
  import { NotebookEditorWidget, NotebookEditorWidgetContainerFactory, NotebookEditorProps } from './notebook-editor-widget';
21
21
  import { NotebookService } from './service/notebook-service';
22
22
  import { NotebookModelResolverService } from './service/notebook-model-resolver-service';
23
+ import { Deferred } from '@theia/core/lib/common/promise-util';
24
+ import { NotebookModel } from './view-model/notebook-model';
23
25
 
24
26
  export interface NotebookEditorWidgetOptions extends NavigatableWidgetOptions {
25
27
  notebookType: string;
@@ -62,10 +64,19 @@ export class NotebookEditorWidgetFactory implements WidgetFactory {
62
64
  }
63
65
 
64
66
  protected async createEditor(uri: URI, notebookType: string): Promise<NotebookEditorWidget> {
67
+ const notebookData = new Deferred<NotebookModel>();
68
+ const resolverError = new Deferred<string>();
69
+ this.notebookModelResolver.resolve(uri, notebookType).then(model => {
70
+ notebookData.resolve(model);
71
+ }).catch((reason: Error) => {
72
+ resolverError.resolve(reason.message);
73
+ });
74
+
65
75
  return this.createNotebookEditorWidget({
66
76
  uri,
67
77
  notebookType,
68
- notebookData: this.notebookModelResolver.resolve(uri, notebookType),
78
+ notebookData: notebookData.promise,
79
+ error: resolverError.promise
69
80
  });
70
81
  }
71
82
 
@@ -15,8 +15,8 @@
15
15
  // *****************************************************************************
16
16
 
17
17
  import * as React from '@theia/core/shared/react';
18
- import { CommandRegistry, MenuModelRegistry, URI } from '@theia/core';
19
- import { ReactWidget, Navigatable, SaveableSource, Message, DelegatingSaveable, lock, unlock, animationFrame } from '@theia/core/lib/browser';
18
+ import { CommandRegistry, MenuModelRegistry, URI, nls } from '@theia/core';
19
+ import { ReactWidget, Navigatable, SaveableSource, Message, DelegatingSaveable, lock, unlock, animationFrame, codicon } from '@theia/core/lib/browser';
20
20
  import { ReactNode } from '@theia/core/shared/react';
21
21
  import { CellKind, NotebookCellsChangeType } from '../common';
22
22
  import { CellRenderer as CellRenderer, NotebookCellListView } from './view/notebook-cell-list-view';
@@ -72,6 +72,7 @@ export interface NotebookEditorProps {
72
72
  uri: URI,
73
73
  readonly notebookType: string,
74
74
  notebookData: Promise<NotebookModel>
75
+ error?: Promise<string>
75
76
  }
76
77
  export const NOTEBOOK_EDITOR_ID_PREFIX = 'notebook:';
77
78
 
@@ -135,6 +136,7 @@ export class NotebookEditorWidget extends ReactWidget implements Navigatable, Sa
135
136
 
136
137
  protected readonly renderers = new Map<CellKind, CellRenderer>();
137
138
  protected _model?: NotebookModel;
139
+ protected error?: string;
138
140
  protected _ready: Deferred<NotebookModel> = new Deferred();
139
141
  protected _findWidgetVisible = false;
140
142
  protected _findWidgetRef = React.createRef<NotebookFindWidget>();
@@ -188,6 +190,10 @@ export class NotebookEditorWidget extends ReactWidget implements Navigatable, Sa
188
190
  }
189
191
  });
190
192
  });
193
+ this.props.error?.then(error => {
194
+ this.error = error;
195
+ this.update();
196
+ });
191
197
  }
192
198
 
193
199
  protected async waitForData(): Promise<NotebookModel> {
@@ -288,6 +294,11 @@ export class NotebookEditorWidget extends ReactWidget implements Navigatable, Sa
288
294
  </PerfectScrollbar>
289
295
  </div>
290
296
  </div>;
297
+ } else if (this.error) {
298
+ return <div className='theia-notebook-main-container error-message' tabIndex={-1}>
299
+ <span className={codicon('error')}></span>
300
+ <h3>{nls.localizeByDefault('The editor could not be opened because the file was not found.')}</h3>
301
+ </div>;
291
302
  } else {
292
303
  return <div className='theia-notebook-main-container' tabIndex={-1}>
293
304
  <div className='theia-notebook-main-loading-indicator'></div>
@@ -41,7 +41,7 @@ import { NotebookKernelHistoryService } from './service/notebook-kernel-history-
41
41
  import { NotebookEditorWidgetService } from './service/notebook-editor-widget-service';
42
42
  import { NotebookRendererMessagingService } from './service/notebook-renderer-messaging-service';
43
43
  import { NotebookColorContribution } from './contributions/notebook-color-contribution';
44
- import { NotebookMonacoTextModelService } from './service/notebook-monaco-text-model-service';
44
+ import { NotebookMonacoEditorModelFilter, NotebookMonacoTextModelService } from './service/notebook-monaco-text-model-service';
45
45
  import { NotebookOutlineContribution } from './contributions/notebook-outline-contribution';
46
46
  import { NotebookLabelProviderContribution } from './contributions/notebook-label-provider-contribution';
47
47
  import { NotebookOutputActionContribution } from './contributions/notebook-output-action-contribution';
@@ -52,8 +52,9 @@ import { NotebookUndoRedoHandler } from './contributions/notebook-undo-redo-hand
52
52
  import { NotebookStatusBarContribution } from './contributions/notebook-status-bar-contribution';
53
53
  import { NotebookCellEditorService } from './service/notebook-cell-editor-service';
54
54
  import { NotebookCellStatusBarService } from './service/notebook-cell-status-bar-service';
55
+ import { MonacoEditorModelFilter } from '@theia/monaco/lib/browser/monaco-text-model-service';
55
56
 
56
- export default new ContainerModule((bind, unbind, isBound, rebind) => {
57
+ export default new ContainerModule(bind => {
57
58
  bind(NotebookColorContribution).toSelf().inSingletonScope();
58
59
  bind(ColorContribution).toService(NotebookColorContribution);
59
60
 
@@ -108,6 +109,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
108
109
  );
109
110
 
110
111
  bind(NotebookMonacoTextModelService).toSelf().inSingletonScope();
112
+ bind(NotebookMonacoEditorModelFilter).toSelf().inSingletonScope();
113
+ bind(MonacoEditorModelFilter).toService(NotebookMonacoEditorModelFilter);
111
114
 
112
115
  bind(NotebookOutlineContribution).toSelf().inSingletonScope();
113
116
  bind(FrontendApplicationContribution).toService(NotebookOutlineContribution);
@@ -18,13 +18,13 @@
18
18
  * Licensed under the MIT License. See License.txt in the project root for license information.
19
19
  *--------------------------------------------------------------------------------------------*/
20
20
 
21
- import { inject, injectable } from '@theia/core/shared/inversify';
21
+ import { inject, injectable, named } from '@theia/core/shared/inversify';
22
22
  import { CellExecution, NotebookExecutionStateService } from '../service/notebook-execution-state-service';
23
23
  import { CellKind, NotebookCellExecutionState } from '../../common';
24
24
  import { NotebookCellModel } from '../view-model/notebook-cell-model';
25
25
  import { NotebookModel } from '../view-model/notebook-model';
26
26
  import { NotebookKernelService } from './notebook-kernel-service';
27
- import { CommandService, Disposable } from '@theia/core';
27
+ import { CommandService, Disposable, ILogger } from '@theia/core';
28
28
  import { NotebookKernelQuickPickService } from './notebook-kernel-quick-pick-service';
29
29
  import { NotebookKernelHistoryService } from './notebook-kernel-history-service';
30
30
 
@@ -50,6 +50,9 @@ export class NotebookExecutionService {
50
50
  @inject(NotebookKernelQuickPickService)
51
51
  protected notebookKernelQuickPickService: NotebookKernelQuickPickService;
52
52
 
53
+ @inject(ILogger) @named('notebook')
54
+ protected readonly logger: ILogger;
55
+
53
56
  protected readonly cellExecutionParticipants = new Set<CellExecutionParticipant>();
54
57
 
55
58
  async executeNotebookCells(notebook: NotebookModel, cells: Iterable<NotebookCellModel>): Promise<void> {
@@ -59,6 +62,11 @@ export class NotebookExecutionService {
59
62
  return;
60
63
  }
61
64
 
65
+ this.logger.debug('Executing notebook cells', {
66
+ notebook: notebook.uri.toString(),
67
+ cells: cellsArr.map(c => c.handle)
68
+ });
69
+
62
70
  // create cell executions
63
71
  const cellExecutions: [NotebookCellModel, CellExecution][] = [];
64
72
  for (const cell of cellsArr) {
@@ -71,6 +79,7 @@ export class NotebookExecutionService {
71
79
  const kernel = await this.notebookKernelHistoryService.resolveSelectedKernel(notebook);
72
80
 
73
81
  if (!kernel) {
82
+ this.logger.debug('Failed to resolve kernel for execution', notebook.uri.toString());
74
83
  // clear all pending cell executions
75
84
  cellExecutions.forEach(cellExe => cellExe[1].complete({}));
76
85
  return;
@@ -99,7 +108,16 @@ export class NotebookExecutionService {
99
108
  });
100
109
  await this.runExecutionParticipants(validCellExecutions);
101
110
 
111
+ this.logger.debug('Selecting kernel for cell execution', {
112
+ notebook: notebook.uri.toString(),
113
+ kernel: kernel.id
114
+ });
102
115
  this.notebookKernelService.selectKernelForNotebook(kernel, notebook);
116
+
117
+ this.logger.debug('Running cell execution request', {
118
+ notebook: notebook.uri.toString(),
119
+ cells: validCellExecutions.map(c => c.cellHandle)
120
+ });
103
121
  await kernel.executeNotebookCellsRequest(notebook.uri, validCellExecutions.map(c => c.cellHandle));
104
122
  // the connecting state can change before the kernel resolves executeNotebookCellsRequest
105
123
  const unconfirmed = validCellExecutions.filter(exe => exe.state === NotebookCellExecutionState.Unconfirmed);
@@ -169,7 +169,6 @@ export class CellExecution implements Disposable {
169
169
  readonly cellHandle: number,
170
170
  protected readonly notebook: NotebookModel,
171
171
  ) {
172
- console.debug(`CellExecution#ctor ${this.getCellLog()}`);
173
172
  }
174
173
 
175
174
  initialize(): void {
@@ -188,10 +187,6 @@ export class CellExecution implements Disposable {
188
187
  this.applyCellExecutionEditsToNotebook([startExecuteEdit]);
189
188
  }
190
189
 
191
- protected getCellLog(): string {
192
- return `${this.notebookURI.toString()}, ${this.cellHandle}`;
193
- }
194
-
195
190
  confirm(): void {
196
191
  this._state = NotebookCellExecutionState.Pending;
197
192
  this.onDidUpdateEmitter.fire();
@@ -18,8 +18,8 @@
18
18
  * Copyright (c) Microsoft Corporation. All rights reserved.
19
19
  * Licensed under the MIT License. See License.txt in the project root for license information.
20
20
  *--------------------------------------------------------------------------------------------*/
21
- import { ArrayUtils, CommandService, DisposableCollection, Event, nls, QuickInputButton, QuickInputService, QuickPickInput, QuickPickItem, URI, } from '@theia/core';
22
- import { inject, injectable } from '@theia/core/shared/inversify';
21
+ import { ArrayUtils, CommandService, DisposableCollection, Event, ILogger, nls, QuickInputButton, QuickInputService, QuickPickInput, QuickPickItem, URI, } from '@theia/core';
22
+ import { inject, injectable, named } from '@theia/core/shared/inversify';
23
23
  import { NotebookKernelService, NotebookKernel, NotebookKernelMatchResult, SourceCommand } from './notebook-kernel-service';
24
24
  import { NotebookModel } from '../view-model/notebook-model';
25
25
  import { NotebookEditorWidget } from '../notebook-editor-widget';
@@ -89,12 +89,12 @@ export class NotebookKernelQuickPickService {
89
89
  protected readonly quickInputService: QuickInputService;
90
90
  @inject(CommandService)
91
91
  protected readonly commandService: CommandService;
92
-
93
92
  @inject(OpenerService)
94
- protected openerService: OpenerService;
95
-
93
+ protected readonly openerService: OpenerService;
96
94
  @inject(NotebookKernelHistoryService)
97
- protected notebookKernelHistoryService: NotebookKernelHistoryService;
95
+ protected readonly notebookKernelHistoryService: NotebookKernelHistoryService;
96
+ @inject(ILogger) @named('notebook')
97
+ protected readonly logger: ILogger;
98
98
 
99
99
  async showQuickPick(editor: NotebookModel, wantedId?: string, skipAutoRun?: boolean): Promise<boolean> {
100
100
  const notebook = editor;
@@ -238,6 +238,10 @@ export class NotebookKernelQuickPickService {
238
238
  }
239
239
 
240
240
  protected selectKernel(notebook: NotebookModel, kernel: NotebookKernel): void {
241
+ this.logger.debug('Selected notebook kernel', {
242
+ notebook: notebook.uri.toString(),
243
+ kernel: kernel.id
244
+ });
241
245
  const currentInfo = this.notebookKernelService.getMatchingKernel(notebook);
242
246
  if (currentInfo.selected) {
243
247
  // there is already a selected kernel
@@ -270,6 +274,10 @@ export class NotebookKernelQuickPickService {
270
274
  }
271
275
 
272
276
  if (isSourcePick(pick)) {
277
+ this.logger.debug('Selected notebook kernel command', {
278
+ notebook: editor.uri.toString(),
279
+ command: pick.action.command.id
280
+ });
273
281
  // selected explicitly, it should trigger the execution?
274
282
  pick.action.run(this.commandService);
275
283
  }
@@ -65,14 +65,21 @@ export class NotebookModelResolverService {
65
65
  throw new Error(`Missing viewType for '${resource}'`);
66
66
  }
67
67
 
68
- const actualResource = await this.resourceProvider(resource);
69
- const notebookData = await this.resolveExistingNotebookData(actualResource, viewType!);
70
- const notebookModel = await this.notebookService.createNotebookModel(notebookData, viewType, actualResource);
68
+ try {
71
69
 
72
- notebookModel.onDirtyChanged(() => this.onDidChangeDirtyEmitter.fire(notebookModel));
73
- notebookModel.onDidSaveNotebook(() => this.onDidSaveNotebookEmitter.fire(notebookModel.uri.toComponents()));
70
+ const actualResource = await this.resourceProvider(resource);
71
+ const notebookData = await this.resolveExistingNotebookData(actualResource, viewType!);
72
+ const notebookModel = await this.notebookService.createNotebookModel(notebookData, viewType, actualResource);
74
73
 
75
- return notebookModel;
74
+ notebookModel.onDirtyChanged(() => this.onDidChangeDirtyEmitter.fire(notebookModel));
75
+ notebookModel.onDidSaveNotebook(() => this.onDidSaveNotebookEmitter.fire(notebookModel.uri.toComponents()));
76
+
77
+ return notebookModel;
78
+ } catch (e) {
79
+ const message = `Error resolving notebook model for: \n ${resource.path.fsPath()} \n with view type ${viewType}. \n ${e}`;
80
+ console.error(message);
81
+ throw new Error(message);
82
+ }
76
83
  }
77
84
 
78
85
  async resolveUntitledResource(arg: UntitledResource, viewType: string): Promise<NotebookModel> {
@@ -14,11 +14,33 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { ReferenceCollection, URI, Reference, Event } from '@theia/core';
17
+ import { URI, Reference, Event, Emitter } from '@theia/core';
18
18
  import { inject, injectable } from '@theia/core/shared/inversify';
19
- import { MonacoTextModelService } from '@theia/monaco/lib/browser/monaco-text-model-service';
19
+ import { MonacoTextModelService, MonacoEditorModelFilter } from '@theia/monaco/lib/browser/monaco-text-model-service';
20
20
  import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model';
21
21
  import { NotebookModel } from '../view-model/notebook-model';
22
+ import { CellUri } from '../../common/notebook-common';
23
+
24
+ @injectable()
25
+ export class NotebookMonacoEditorModelFilter implements MonacoEditorModelFilter {
26
+
27
+ protected readonly onDidCreateCellModelEmitter = new Emitter<MonacoEditorModel>();
28
+
29
+ get onDidCreateCellModel(): Event<MonacoEditorModel> {
30
+ return this.onDidCreateCellModelEmitter.event;
31
+ }
32
+
33
+ filter(model: MonacoEditorModel): boolean {
34
+ const applies = model.uri.startsWith(CellUri.cellUriScheme);
35
+ if (applies) {
36
+ // If the model is for a notebook cell, we emit the event to notify the listeners.
37
+ // We create our own event here, as we don't want to propagate the creation of the cell to the plugin host.
38
+ // Instead, we want to do that ourselves once the notebook model is completely initialized.
39
+ this.onDidCreateCellModelEmitter.fire(model);
40
+ }
41
+ return applies;
42
+ }
43
+ }
22
44
 
23
45
  /**
24
46
  * special service for creating monaco textmodels for notebook cells.
@@ -30,12 +52,11 @@ export class NotebookMonacoTextModelService {
30
52
  @inject(MonacoTextModelService)
31
53
  protected readonly monacoTextModelService: MonacoTextModelService;
32
54
 
33
- protected readonly cellmodels = new ReferenceCollection<string, MonacoEditorModel>(
34
- uri => this.monacoTextModelService.createUnmanagedModel(new URI(uri))
35
- );
55
+ @inject(NotebookMonacoEditorModelFilter)
56
+ protected readonly notebookMonacoEditorModelFilter: NotebookMonacoEditorModelFilter;
36
57
 
37
58
  getOrCreateNotebookCellModelReference(uri: URI): Promise<Reference<MonacoEditorModel>> {
38
- return this.cellmodels.acquire(uri.toString());
59
+ return this.monacoTextModelService.createModelReference(uri);
39
60
  }
40
61
 
41
62
  async createTextModelsForNotebook(notebook: NotebookModel): Promise<void> {
@@ -43,6 +64,6 @@ export class NotebookMonacoTextModelService {
43
64
  }
44
65
 
45
66
  get onDidCreateNotebookCellModel(): Event<MonacoEditorModel> {
46
- return this.cellmodels.onDidCreate;
67
+ return this.notebookMonacoEditorModelFilter.onDidCreateCellModel;
47
68
  }
48
69
  }