Commit Graph

125 Commits

Author SHA1 Message Date
Connor Peet
a57cb45be8 notebooks: pipe renderer API postmessages to the renderer itself (#100414)
* notebooks: pipe renderer API postmessages to the renderer itself

Previously the postMessage on acquireNotebookRenderer API was just
a proxy to the global vscode postmessage. Now, it's linked to the
renderer and will cause an optional `onDidReceiveMessage` method on
the renderer to be called.

The message still _also_ goes to the global webview message handling
for advanced use cases, but this change allows the webview<->renderer
communication to be more nicely contained
and separate for most use cases.

* wip

* fixup! pr comments
2020-06-22 09:35:16 -07:00
rebornix
e51bb9be57 fix unit test. 2020-06-17 18:31:53 -07:00
rebornix
6c68514534 Fix #100329. Content providers can contribute to undo/redo stack of a notebook document. 2020-06-17 17:08:09 -07:00
rebornix
ca7f2683fd resolve notebook editor with comm object. 2020-06-16 17:21:11 -07:00
rebornix
a9db9d94ff 💄 2020-06-16 16:25:24 -07:00
rebornix
8ad77ef2b6 mimetype and remove revert. 2020-06-16 14:55:20 -07:00
Connor Peet
45dbf43a87 Merge branch 'connor4312/identify-cell-outputs' 2020-06-15 09:14:23 -07:00
rebornix
98c3065160 Fix #96840. Support backup/revert from notebook content provider. 2020-06-12 18:00:15 -07:00
Connor Peet
1d1b452f2f notebooks: add ID for rich outputs, expose to renderer and webview
Some API changes:

 - I changed the second param of NotebookOutputRenderer.render to a
   `NotebookRenderRequest` since we were up to four parameters already.
 - The request contains a unique `outputId`, which is generated when
   output is first created or restored (the ID is not stable if a
	 notebook is closed and reopened)
 - I changed the renderer events to `onDidCreateOutput` and
   `onWillDestroyOutput` since they're for outputs, not cells.
 - Additionally, they're called with objects that contain the output
   ID to render.
2020-06-12 12:29:30 -07:00
Johannes Rieken
00637c1c42 remove obsolete APIs, https://github.com/microsoft/vscode/issues/93265 2020-06-12 09:57:10 +02:00
rebornix
88c8bfee45 Fix #99241. Deleted cells info in cells change event. Re #93265. 2020-06-09 11:20:38 -07:00
Johannes Rieken
aef90f8fda add vscode.notebooks.notebookDocuments-api, https://github.com/microsoft/vscode/issues/93265 2020-06-09 16:23:22 +02:00
Johannes Rieken
8ba5f99939 debt - soft remove NotebookCell#source 2020-06-09 15:51:53 +02:00
rebornix
adae0e5b4e Fix #98841. Open file should only emit document open event, no cells change event. 2020-06-02 15:13:32 -07:00
rebornix
c2131f984e set visible editors active property correctly. 2020-05-30 17:53:26 -07:00
rebornix
0663fac3ac support cell text model attach/detach on web. 2020-05-30 17:52:50 -07:00
Johannes Rieken
d61d7dd95e fix notebook tests 2020-05-29 17:23:51 +02:00
Johannes Rieken
5721d63eb6 notebooks - wire up onDidChange event from notebook providers, fyi @rebornix, https://github.com/microsoft/vscode/issues/96403 2020-05-29 13:20:28 +02:00
Johannes Rieken
c8012a7c1c notebook - add NotebookCell#notebook 2020-05-29 13:20:28 +02:00
rebornix
8bac4d17ad combine events from edits from ext host. 2020-05-27 16:00:49 -07:00
rebornix
914fa13e26 support renderer and content provider registered in different extension host. 2020-05-26 20:11:49 -07:00
rebornix
23f5231511 asWebvewUri requires guid. 2020-05-20 12:17:26 -07:00
rebornix
d321061c8c merge moveEvent into CellsChangeEvent. 2020-05-20 11:03:30 -07:00
rebornix
5e8d85b727 💄 2020-05-20 10:32:26 -07:00
rebornix
979ca623f1 onDidActiveNotebookEditorChange 2020-05-20 10:32:26 -07:00
rebornix
c19d0dcd9b false negative warning. 2020-05-20 09:52:12 -07:00
rebornix
6db9773a32 remove legacy API 2020-05-20 09:02:47 -07:00
rebornix
23e1fac001 NotebookEditor.onDidDispose 2020-05-20 08:22:54 -07:00
rebornix
5c928428df notebookEditor.visible 2020-05-19 17:20:20 -07:00
rebornix
8e02737abc notebookEditor.active 2020-05-19 16:55:38 -07:00
rebornix
cc151dd103 notebook tests for notebook content change events. 2020-05-19 14:46:14 -07:00
rebornix
345f02dad4 emit editor close event. 2020-05-19 13:55:15 -07:00
rebornix
0dea13a46a Notebook document events. 2020-05-19 12:05:21 -07:00
rebornix
b5831f5be7 notebook content change events. 2020-05-18 19:05:18 -07:00
rebornix
1cfa610cb6 model change on document. 2020-05-18 18:15:23 -07:00
rebornix
025bd27df7 webview comm based on editor other than document. 2020-05-18 18:13:45 -07:00
rebornix
4c54f7124c shared document between split editors and dispose them properly 2020-05-18 17:22:12 -07:00
rebornix
55ac452768 webview id attached to notebook editor 2020-05-18 16:29:02 -07:00
rebornix
a14736ca5e introduce visible notebook editors 2020-05-18 15:45:32 -07:00
rebornix
9a384768c3 Fix #97694. 2020-05-18 10:35:43 -07:00
rebornix
2d6df55ad1 Notebook kernel preloads 2020-05-17 21:12:58 -07:00
rebornix
b9c163faee asWebUri. 2020-05-14 17:53:33 -07:00
rebornix
e3c3ea27e0 Switch kernel info. 2020-05-13 18:26:41 -07:00
rebornix
03acd2250a Fix #96433 2020-05-13 12:47:39 -07:00
rebornix
a15661000f adopt notebook kernel 2020-05-13 11:31:06 -07:00
rebornix
4447915b00 saveAs 2020-05-06 12:42:36 -07:00
rebornix
a9da51fd57 document add/delete events 2020-05-05 18:50:00 -07:00
rebornix
3c710dfcc9 Transform outputs is now safe 2020-05-05 18:47:18 -07:00
rebornix
cb7ea6e166 Remove notebook content provider 2020-05-05 18:43:25 -07:00
rebornix
1b5217985b notebook document creation in UI side 2020-05-05 18:43:25 -07:00