vscode: Deserialize function doesn't have uri parameter

I am working on getting Live Share notebooks functional again after recent API changes. We want Live Share notebooks to be running on stable APIs, which means using serializers rather than content providers.

However, serializers do not work for the guest scenario. Previously, the guest’s content provider would have an openNotebook function with a uri parameter for the document being opened. We proxied that request to the host, where we could use vscode.notebook.openNotebookDocument with the uri. Now, deserialize only includes the document’s content. I can add the serializer’s view type to proxied request, but the only information we can give the host is content and viewtype. We need it to return NotebookData, but we cannot identify which notebook document to deserialize.

Could vscode.commands.executeCommand('_resolveNotebookContentProvider'); return serializers that have callable deserialize functions?

cc @jrieken @rebornix @davsterl

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Do you have any updates about the cause of the error I mentioned?

Please file a new, dedicated issue for that.

When the guest requests an open, we check the list of excluded files and do not return the notebook data if the requested notebook is marked as excluded.

Wouldn’t it make more sense to do the check in the layer that implements the file system? E.g I assume the guest has a virtual file system which is implemented by the host. To me that looks like a better place for such checks, otherwise the guest can always workaround those protections, e.g have an extension snippet doing the equivalent of vscode.workspace.fs.readFile(vscode.Uri.parse('vsls:///some/excluded/file.nb'))

There are 72 upvotes for this particular feature - https://github.com/MicrosoftDocs/live-share/issues/3301

Thanks @gregvanl, it was in the wrong repo.

Looks like a product question so moving to the vscode product repo.