vscode: Notebook diffs not showing when triggered from GHPR extension

When viewing changes I make to a .ipynb file while using github.dev, the diffs render as expected (nicely, with red and green highlighting to indicate changes in code or state):

Screen Shot 2021-09-25 at 8 48 16 AM

When reviewing changes that other users have made to .ipynb files, the pull requests still render as JSON blobs:

Screen Shot 2021-09-25 at 8 47 55 AM

Browser: Microsoft Edge Version 94.0.992.31 (Official build) (x86_64) OS: MacOS Big Sur v11.6 Repro link: https://github.dev/ageron/handson-ml2/pull/408

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 27 (26 by maintainers)

Most upvoted comments

@lramos15 we only activate providers when you call activate (and it returns a Promise so you need to await) or when the file service is used. So yeah, it was happening as part of loading the file contents.

Yeah file scheme shouldn’t matter. I’ll investigate this as I assume it’s a resolver issue. We match on the extension using a glob. Will reassign to notebook folks if it turns out to be a notebook problem.

@rebornix and I synced up to figure out what was going on here.

Notebooks expect a file system provider, but the GHPR extension only registers a text document content provider. This means a text file can resolve the contents but a notebook cannot. This was the original issue of https://github.com/microsoft/vscode/issues/122627 and why the canSupportResource option was added to prevent notebooks from being opened in PRs.

The two possible fixes are

  • Notebooks support text content providers
  • GHPR adds a fullblown PR filesystem provider.

If notebooks support text content providers the code will then use ITextModelService to check if it can handle the resource.

reopening and adding label based on what @IanMatthewHuff said

@lramos15 Hmm, I’m still seeing this: image I’m in insiders version of github.dev.