Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support searching the marketplace for compatible notebook renderers #60

Closed
connor4312 opened this issue Apr 15, 2021 · 0 comments
Closed
Labels

Comments

@connor4312
Copy link
Member

connor4312 commented Apr 15, 2021

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 of contributes.notebookOutputRenderer.mimeTypes list,
  • excluding extensions who have a non-empty dependencies list which does not include anything in the kernelProvides 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.

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants