mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-07 01:25:38 -05:00
Correctly handle creating and saving untitled notebook .dib files. (#18744)
This commit is contained in:
@@ -447,7 +447,11 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
|
||||
private async assignProviders(): Promise<void> {
|
||||
await this.extensionService.whenInstalledExtensionsRegistered();
|
||||
let providerIds: string[] = getProvidersForFileName(this._title, this.notebookService);
|
||||
let mode: string;
|
||||
if (this._textInput instanceof UntitledTextEditorInput) {
|
||||
mode = this._textInput.model.getMode();
|
||||
}
|
||||
let providerIds: string[] = getProvidersForFileName(this._title, this.notebookService, mode);
|
||||
if (providerIds && providerIds.length > 0) {
|
||||
this._providerId = providerIds.filter(provider => provider !== DEFAULT_NOTEBOOK_PROVIDER)[0];
|
||||
this._providers = providerIds;
|
||||
|
||||
@@ -27,7 +27,7 @@ export class UntitledNotebookInput extends NotebookInput {
|
||||
) {
|
||||
super(title, resource, textInput, true, textModelService, instantiationService, notebookService, extensionService);
|
||||
// Set the mode explicitly so that the auto language detection doesn't run and mark the model as being JSON
|
||||
this.textInput.resolve().then(() => this.setMode('notebook'));
|
||||
this.textInput.resolve().then(() => this.setMode(textInput.model.getMode()));
|
||||
}
|
||||
|
||||
public override get textInput(): UntitledTextEditorInput {
|
||||
|
||||
Reference in New Issue
Block a user