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

@@ -124,7 +124,20 @@ export class ExtHostNotebookKernelProviderAdapter extends Disposable {
description: kernel.description,
detail: kernel.detail,
isPreferred: kernel.isPreferred,
preloads: kernel.preloads,
preloads: kernel.preloads?.map(preload => {
// todo@connor4312: back compat on 2020-04-12, remove after transition
if (URI.isUri(preload)) {
preload = { uri: preload, provides: [] };
}
return {
uri: preload.uri, provides: typeof preload.provides === 'string'
? [preload.provides]
: preload.provides === undefined
? []
: preload.provides
};
}),
supportedLanguages: kernel.supportedLanguages,
implementsInterrupt: !!kernel.interrupt
};