-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
Following microsoft/vscode#119899, there is a structure in the package.json which looks like:
{
// ...
"contributes": {
"notebookRenderer": [
{
"id": "github-issues",
"displayName": "Github Issues Notebook Renderer",
"entrypoint": "./dist/renderer.js",
"mimeTypes": [
"x-application/github-issues"
],
"dependencies": [
"gh-issue-kernel"
]
}
]
}
}
VS Code will know the mimeType
and available kernelProvides
list. We need to be able to issue a query which will return:
- Extensions that have the
mimeType
in its list ofcontributes.notebookOutputRenderer.mimeTypes
list, - excluding extensions who have a non-empty
dependencies
list which does not include anything in thekernelProvides
list
In pseudo-code:
def search_extensions(mimeType, kernelProvides):
for extension in extensions:
if any(matches(c, mimeType, kernelProvides) for c in extension.contributes.notebookOutputRenderer):
yield extension
def matches(contribution, mimeType, kernelProvides):
if mimeType not in contribution.mimeTypes:
return False
if kernelDependency.dependencies is not None and len(kernelDependency.dependencies) > 0:
if not any(d in kernelProvides for d in kernelDependency.dependencies):
return False
return True
We will then be able to show a helpful hint in VS Code if there are no renderers for a mimeType.
RandomFractals
Metadata
Metadata
Assignees
Labels
No labels