Notebook cleanup (#20954)

This commit is contained in:
Charles Gagnon
2022-10-24 15:32:42 -07:00
committed by GitHub
parent a64a33e091
commit 5032685162
4 changed files with 25 additions and 16 deletions

View File

@@ -458,11 +458,11 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
private async assignProviders(): Promise<void> {
await this.extensionService.whenInstalledExtensionsRegistered();
let mode: string;
let languageId: string | undefined = undefined;
if (this._textInput instanceof UntitledTextEditorInput) {
mode = this._textInput.model.getLanguageId();
languageId = this._textInput.model.getLanguageId();
}
let providerIds: string[] = getProvidersForFileName(this._title, this.notebookService, mode);
let providerIds: string[] = getProvidersForFileName(this._title, this.notebookService, languageId);
if (providerIds && providerIds.length > 0) {
this._providerId = providerIds.filter(provider => provider !== DEFAULT_NOTEBOOK_PROVIDER)[0];
this._providers = providerIds;