diff --git a/src/sql/parts/notebook/notebook.component.ts b/src/sql/parts/notebook/notebook.component.ts index 801a1876ff..c25c38b024 100644 --- a/src/sql/parts/notebook/notebook.component.ts +++ b/src/sql/parts/notebook/notebook.component.ts @@ -223,10 +223,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe private async loadModel(): Promise { await this.awaitNonDefaultProvider(); - let providerId = 'sql'; // this is tricky; really should also depend on the connection profile - this.setContextKeyServiceWithProviderId(providerId); - this.fillInActionsForCurrentContext(); - let model = new NotebookModel({ factory: this.modelFactory, notebookUri: this._notebookParams.notebookUri, @@ -249,6 +245,8 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe this.updateToolbarComponents(this._model.trustedMode); this._modelRegisteredDeferred.resolve(this._model); await model.startSession(this.model.notebookManager, undefined, true); + this.setContextKeyServiceWithProviderId(model.providerId); + this.fillInActionsForCurrentContext(); this.detectChanges(); }