mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 01:25:36 -05:00
Handle delayed Notebook provider registration (#3526)
* Handle delayed Notebook provider registration - Fixes #3197 Notebooks: builtin provider always used on reopen with notebook file visible - Fixes #3414 Can't refresh kernel after connect to big data cluster There are 3 parts to this fix: - If no notebook provider other than the default is installed, we warn users and prompt to install the SQL2019 extension - We wait on the extension host registration to complete before determining which provider to use - We know that the extension registration of the provider instance will be after package.json is read, so if we wait after registration for 10 seconds to give this a chance to happen before returning a provider to the front end * Remove launch.json change that was added accidentally * Fix timeout not being the expected value * Removed console log left in during debugging * Remove unnecessary whitespace * Fix unit test failure * Name the registration better, and remove outdated comments
This commit is contained in:
@@ -258,7 +258,8 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
|
||||
extHostContext: IExtHostContext,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IEditorService private _editorService: IEditorService,
|
||||
@IEditorGroupsService private _editorGroupService: IEditorGroupsService
|
||||
@IEditorGroupsService private _editorGroupService: IEditorGroupsService,
|
||||
@INotebookService private readonly _notebookService: INotebookService
|
||||
) {
|
||||
super();
|
||||
if (extHostContext) {
|
||||
@@ -306,7 +307,7 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
|
||||
if(!providerId)
|
||||
{
|
||||
// Ensure there is always a sensible provider ID for this file type
|
||||
providerId = getProviderForFileName(uri.fsPath);
|
||||
providerId = getProviderForFileName(uri.fsPath, this._notebookService);
|
||||
}
|
||||
|
||||
model.providerId = providerId;
|
||||
|
||||
Reference in New Issue
Block a user