Create untitled notebook names in core code rather than in the notebook extension (#21111)

This commit is contained in:
Cory Rivera
2022-11-04 19:31:55 -07:00
committed by GitHub
parent a618ef983a
commit facd317b4d
9 changed files with 63 additions and 94 deletions

View File

@@ -218,6 +218,9 @@ export class ExtHostNotebookDocumentsAndEditors implements ExtHostNotebookDocume
//#endregion
//#region Extension accessible methods
/**
* Attempts to create a new notebook with the specified provider and contents. Used for VS Code extension compatibility.
*/
async createNotebookDocument(providerId: string, contents?: azdata.nb.INotebookContents): Promise<URI> {
let uriComps = await this._proxy.$tryCreateNotebookDocument(providerId, contents);
let uri = URI.revive(uriComps);
@@ -241,6 +244,9 @@ export class ExtHostNotebookDocumentsAndEditors implements ExtHostNotebookDocume
return uri;
}
/**
* Attempts to open an existing notebook. Used for VS Code extension compatibility.
*/
async openNotebookDocument(uri: vscode.Uri): Promise<azdata.nb.NotebookDocument> {
let docData = this._documents.get(uri.toString());
if (!docData) {