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:
Kevin Cunnane
2018-12-07 17:56:21 -08:00
committed by GitHub
parent 96fb618390
commit e3bce7172c
7 changed files with 301 additions and 111 deletions

View File

@@ -26,10 +26,12 @@ export const DEFAULT_NOTEBOOK_FILETYPE = 'IPYNB';
export interface INotebookService {
_serviceBrand: any;
onNotebookEditorAdd: Event<INotebookEditor>;
onNotebookEditorRemove: Event<INotebookEditor>;
readonly onNotebookEditorAdd: Event<INotebookEditor>;
readonly onNotebookEditorRemove: Event<INotebookEditor>;
onNotebookEditorRename: Event<INotebookEditor>;
readonly isRegistrationComplete: boolean;
readonly registrationComplete: Promise<void>;
/**
* Register a metadata provider
*/
@@ -40,6 +42,10 @@ export interface INotebookService {
*/
unregisterProvider(providerId: string): void;
getSupportedFileExtensions(): string[];
getProviderForFileType(fileType: string): string;
/**
* Initializes and returns a Notebook manager that can handle all important calls to open, display, and
* run cells in a notebook.