From 1bac929ab38e64560a6f663baa086a9b540c083c Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Mon, 25 Mar 2019 15:24:57 -0700 Subject: [PATCH] Fix for SQL Kernel only showing up (#4691) * Ensure that notebook providers that are registered "early" are shown in kernels dropdown * cleanup --- .../services/notebook/common/notebookServiceImpl.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts b/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts index 15b45ddfb5..dcb47d8e19 100644 --- a/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts +++ b/src/sql/workbench/services/notebook/common/notebookServiceImpl.ts @@ -109,6 +109,13 @@ export class NotebookService extends Disposable implements INotebookService { super(); this._memento = new Memento('notebookProviders', this._storageService); this._register(notebookRegistry.onNewRegistration(this.updateRegisteredProviders, this)); + // 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}); + }); + } this.registerBuiltInProvider(); if (extensionService) {