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):

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

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)
@lramos15 we only activate providers when you call activate (and it returns a
Promiseso you need toawait) 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.
@alexr00 just sent a PR https://github.com/microsoft/vscode-pull-request-github/pull/3091;)
@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
canSupportResourceoption was added to prevent notebooks from being opened in PRs.The two possible fixes are
If notebooks support text content providers the code will then use
ITextModelServiceto check if it can handle the resource.reopening and adding label based on what @IanMatthewHuff said
@lramos15 Hmm, I’m still seeing this:
I’m in insiders version of github.dev.