notebooks: add initial kernel/renderer constraints

See https://github.com/microsoft/vscode/issues/119899

Backwards compatible, initially. The implementation should be
pretty unsurprising. Some churn from data wiring.

This does the bulk of the work. The only remaining item is caching
the last renderer used for notebooks in the workspace to avoid running
selection again if the user reopens/reloads the window.
This commit is contained in:
Connor Peet
2021-04-12 15:53:12 -07:00
parent f7e5a67039
commit 60a7c6a925
20 changed files with 185 additions and 48 deletions

View File

@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { flatten } from 'vs/base/common/arrays';
import { VSBuffer } from 'vs/base/common/buffer';
import { CancellationToken } from 'vs/base/common/cancellation';
import { Emitter } from 'vs/base/common/event';
@@ -169,7 +170,8 @@ export class MainThreadNotebooks implements MainThreadNotebookShape {
description: dto.description,
detail: dto.detail,
isPreferred: dto.isPreferred,
preloads: dto.preloads?.map(u => URI.revive(u)),
preloadProvides: flatten(dto.preloads?.map(p => p.provides) ?? []),
preloadUris: dto.preloads?.map(u => URI.revive(u.uri)) ?? [],
supportedLanguages: dto.supportedLanguages,
implementsInterrupt: dto.implementsInterrupt,
implementsExecutionOrder: true, // todo@jrieken this is temporary and for the OLD API only