From de9dd34275f9bc042832c4174baff7237f48d4da Mon Sep 17 00:00:00 2001 From: Karl Burtram Date: Mon, 24 Oct 2022 13:56:10 -0700 Subject: [PATCH] Fix Notebook language ids (#20938) --- src/sql/workbench/common/constants.ts | 2 +- .../services/notebook/browser/notebookServiceImpl.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sql/workbench/common/constants.ts b/src/sql/workbench/common/constants.ts index de84bfa360..03e71e653a 100644 --- a/src/sql/workbench/common/constants.ts +++ b/src/sql/workbench/common/constants.ts @@ -51,7 +51,7 @@ export const NBFORMAT = 4; export const NBFORMAT_MINOR = 2; export const enum NotebookLanguage { - Notebook = 'Notebook', + Notebook = 'notebook', Ipynb = 'ipynb' } export interface INotebookSearchConfigurationProperties { diff --git a/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts b/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts index 34339cc907..966a201cf3 100644 --- a/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts +++ b/src/sql/workbench/services/notebook/browser/notebookServiceImpl.ts @@ -303,14 +303,14 @@ export class NotebookService extends Disposable implements INotebookService { } } if (isUntitled && path.isAbsolute(uri.fsPath)) { - const model = this._untitledEditorService.create({ associatedResource: uri, mode: languageMode, initialValue: initialStringContents }); + const model = this._untitledEditorService.create({ associatedResource: uri, languageId: languageMode, initialValue: initialStringContents }); fileInput = this._instantiationService.createInstance(UntitledTextEditorInput, model); } else { if (isUntitled) { - const model = this._untitledEditorService.create({ untitledResource: uri, mode: languageMode, initialValue: initialStringContents }); + const model = this._untitledEditorService.create({ untitledResource: uri, languageId: languageMode, initialValue: initialStringContents }); fileInput = this._instantiationService.createInstance(UntitledTextEditorInput, model); } else { - let input: any = { forceFile: true, resource: uri, mode: languageMode }; + let input: any = { forceFile: true, resource: uri, languageId: languageMode }; fileInput = await this._editorService.createEditorInput(input); } }