mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 17:22:55 -05:00
Correctly handle creating and saving untitled notebook .dib files. (#18744)
This commit is contained in:
@@ -224,12 +224,7 @@ export class ExtHostNotebookDocumentsAndEditors implements ExtHostNotebookDocume
|
||||
|
||||
//#region Extension accessible methods
|
||||
async createNotebookDocument(providerId: string, contents?: azdata.nb.INotebookContents): Promise<URI> {
|
||||
let options: INotebookShowOptions = {};
|
||||
if (contents) {
|
||||
options.providerId = providerId;
|
||||
options.initialContent = JSON.stringify(contents);
|
||||
}
|
||||
let uriComps = await this._proxy.$tryCreateNotebookDocument(options);
|
||||
let uriComps = await this._proxy.$tryCreateNotebookDocument(providerId, contents);
|
||||
let uri = URI.revive(uriComps);
|
||||
let notebookCells = contents?.cells?.map<azdata.nb.NotebookCell>(cellContents => {
|
||||
return {
|
||||
|
||||
@@ -1012,7 +1012,7 @@ export interface ExtHostNotebookDocumentsAndEditorsShape {
|
||||
export interface MainThreadNotebookDocumentsAndEditorsShape extends IDisposable {
|
||||
$trySetTrusted(_uri: UriComponents, isTrusted: boolean): Thenable<boolean>;
|
||||
$trySaveDocument(uri: UriComponents): Thenable<boolean>;
|
||||
$tryCreateNotebookDocument(options: INotebookShowOptions): Promise<UriComponents>;
|
||||
$tryCreateNotebookDocument(providerId: string, contents?: azdata.nb.INotebookContents): Promise<UriComponents>;
|
||||
$tryShowNotebookDocument(resource: UriComponents, options: INotebookShowOptions): Promise<string>;
|
||||
$tryApplyEdits(id: string, modelVersionId: number, edits: INotebookEditOperation[], opts: IUndoStopOptions): Promise<boolean>;
|
||||
$runCell(id: string, cellUri: UriComponents): Promise<boolean>;
|
||||
|
||||
Reference in New Issue
Block a user