Ensure we always get all providers (#3724)

This commit is contained in:
Chris LaFreniere
2019-01-14 16:38:57 -08:00
committed by GitHub
parent f8f57a93c3
commit 1fa03b5c74

View File

@@ -321,16 +321,13 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
let model = new NotebookInputModel(uri, undefined, trusted, undefined);
let providerId = options.providerId;
let providers: string[] = undefined;
if (!providerId)
{
// Ensure there is always a sensible provider ID for this file type
providers = getProvidersForFileName(uri.fsPath, this._notebookService);
// Try to use a non-builtin provider first
if (providers) {
providerId = providers.find(p => p !== DEFAULT_NOTEBOOK_PROVIDER);
if (!providerId) {
providerId = model.providerId;
}
// Ensure there is always a sensible provider ID for this file type
providers = getProvidersForFileName(uri.fsPath, this._notebookService);
// Try to use a non-builtin provider first
if (providers) {
providerId = providers.find(p => p !== DEFAULT_NOTEBOOK_PROVIDER);
if (!providerId) {
providerId = model.providerId;
}
}
model.providers = providers;