From 5ac6cf3b745fc4fe67e39a167c6e2dac010c3888 Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Tue, 26 Mar 2019 19:39:28 -0700 Subject: [PATCH] Ensure SQL is the first kernel in the kernels dropdown (#4692) * Ensure SQL is the first kernel shown in the dropdown * cleanup to prevent sql from registering twice --- .../services/notebook/common/notebookServiceImpl.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts b/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts index dcb47d8e19..99c300807f 100644 --- a/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts +++ b/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts @@ -109,14 +109,17 @@ export class NotebookService extends Disposable implements INotebookService { super(); this._memento = new Memento('notebookProviders', this._storageService); this._register(notebookRegistry.onNewRegistration(this.updateRegisteredProviders, this)); + this.registerBuiltInProvider(); // If a provider has been already registered, the onNewRegistration event will not have a listener attached yet // So, explicitly updating registered providers here. if (notebookRegistry.providers.length > 0) { notebookRegistry.providers.forEach(p => { - this.updateRegisteredProviders({id: p.provider, registration: p}); + // Don't need to re-register SQL_NOTEBOOK_PROVIDER + if (p.provider !== SQL_NOTEBOOK_PROVIDER) { + this.updateRegisteredProviders({id: p.provider, registration: p}); + } }); } - this.registerBuiltInProvider(); if (extensionService) { extensionService.whenInstalledExtensionsRegistered().then(() => {