From 3310d3ac2d42e0ab20f31fe32028df72745408c5 Mon Sep 17 00:00:00 2001 From: rebornix Date: Fri, 15 Jan 2021 08:40:14 -0800 Subject: [PATCH] sort notebook content providers in the list. --- .../notebook/browser/notebook.contribution.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts index 91dace927d8..60fd454b086 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts @@ -237,7 +237,22 @@ export class NotebookContribution extends Disposable implements IWorkbenchContri const associatedEditors = distinct([ ...this.getUserAssociatedNotebookEditors(resource), ...this.getContributedEditors(resource) - ], editor => editor.id); + ], editor => editor.id).sort((a, b) => { + // if a content provider is exclusive, it has higher order + if (a.exclusive && b.exclusive) { + return 0; + } + + if (a.exclusive) { + return -1; + } + + if (b.exclusive) { + return 1; + } + + return 0; + }); return associatedEditors.map(info => { return { -- GitLab