Prefer non-builtin output renderers in notebooks (#136079)

Fixes #134172

This change updates `findBestRenderers` to sort non built-in renderers higher than built-in ones
This commit is contained in:
Matt Bierner 2021-10-29 10:49:45 -07:00 committed by GitHub
parent a84f6fe696
commit 12d38b20b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -314,8 +314,8 @@ export class NotebookOutputRendererInfoStore {
const enum ReuseOrder {
PreviouslySelected = 1 << 8,
SameExtensionAsNotebook = 2 << 8,
BuiltIn = 3 << 8,
OtherRenderer = 4 << 8
OtherRenderer = 3 << 8,
BuiltIn = 4 << 8,
}
const preferred = notebookProviderInfo && this.preferredMimetype.getValue()[notebookProviderInfo.id]?.[mimeType];
@ -333,7 +333,7 @@ export class NotebookOutputRendererInfoStore {
? ReuseOrder.PreviouslySelected
: renderer.extensionId.value === notebookProviderInfo?.extension?.value
? ReuseOrder.SameExtensionAsNotebook
: ReuseOrder.BuiltIn;
: renderer.isBuiltin ? ReuseOrder.BuiltIn : ReuseOrder.OtherRenderer;
return {
ordered: { mimeType, rendererId: renderer.id, isTrusted: true },
score: reuseScore | ownScore,