mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -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 {
|
||||
|
||||
@@ -238,7 +238,7 @@ export class NotebookServiceStub implements INotebookService {
|
||||
getSupportedLanguagesForProvider(provider: string, kernelDisplayName?: string): Promise<string[]> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
createNotebookInput(options: INotebookShowOptions, resource?: UriComponents): Promise<IEditorInput> {
|
||||
createNotebookInputFromContents(providerId: string, contents?: nb.INotebookContents, resource?: UriComponents): Promise<IEditorInput> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
_serviceBrand: undefined;
|
||||
|
||||
Reference in New Issue
Block a user