Fix for SQL Kernel only showing up (#4691)

* Ensure that notebook providers that are registered "early" are shown in kernels dropdown

* cleanup
This commit is contained in:
Chris LaFreniere
2019-03-25 15:24:57 -07:00
committed by GitHub
parent b27417da41
commit 1bac929ab3

View File

@@ -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) {