mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 09:08:53 +01:00
prefix api object with api-prefix, like apiCell
This commit is contained in:
@@ -129,7 +129,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
||||
const data = this._documents.get(notebookUri);
|
||||
const cell = data?.getCell(cellHandle);
|
||||
if (cell) {
|
||||
return cell.cell;
|
||||
return cell.apiCell;
|
||||
}
|
||||
}
|
||||
return arg;
|
||||
@@ -256,11 +256,11 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
||||
async openNotebookDocument(uri: URI): Promise<vscode.NotebookDocument> {
|
||||
const cached = this._documents.get(uri);
|
||||
if (cached) {
|
||||
return cached.notebookDocument;
|
||||
return cached.apiNotebook;
|
||||
}
|
||||
const canonicalUri = await this._notebookDocumentsProxy.$tryOpenDocument(uri);
|
||||
const document = this._documents.get(URI.revive(canonicalUri));
|
||||
return assertIsDefined(document?.notebookDocument);
|
||||
return assertIsDefined(document?.apiNotebook);
|
||||
}
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await provider.provideCellStatusBarItems(cell.cell, token);
|
||||
const result = await provider.provideCellStatusBarItems(cell.apiCell, token);
|
||||
if (!result) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -395,14 +395,14 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
||||
async $saveNotebook(viewType: string, uri: UriComponents, token: CancellationToken): Promise<boolean> {
|
||||
const document = this._getNotebookDocument(URI.revive(uri));
|
||||
const { provider } = this._getProviderData(viewType);
|
||||
await provider.saveNotebook(document.notebookDocument, token);
|
||||
await provider.saveNotebook(document.apiNotebook, token);
|
||||
return true;
|
||||
}
|
||||
|
||||
async $saveNotebookAs(viewType: string, uri: UriComponents, target: UriComponents, token: CancellationToken): Promise<boolean> {
|
||||
const document = this._getNotebookDocument(URI.revive(uri));
|
||||
const { provider } = this._getProviderData(viewType);
|
||||
await provider.saveNotebookAs(URI.revive(target), document.notebookDocument, token);
|
||||
await provider.saveNotebookAs(URI.revive(target), document.apiNotebook, token);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
||||
const fileName = String(hash([document.uri.toString(), this._backupIdPool++]));
|
||||
const backupUri = URI.joinPath(storagePath, fileName);
|
||||
|
||||
const backup = await provider.provider.backupNotebook(document.notebookDocument, { destination: backupUri }, cancellation);
|
||||
const backup = await provider.provider.backupNotebook(document.apiNotebook, { destination: backupUri }, cancellation);
|
||||
document.updateBackup(backup);
|
||||
return backup.id;
|
||||
}
|
||||
@@ -428,12 +428,12 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
||||
|
||||
$acceptDirtyStateChanged(uri: UriComponents, isDirty: boolean): void {
|
||||
const document = this._getNotebookDocument(URI.revive(uri));
|
||||
document.acceptModelChanged({ rawEvents: [], versionId: document.notebookDocument.version }, isDirty);
|
||||
document.acceptModelChanged({ rawEvents: [], versionId: document.apiNotebook.version }, isDirty);
|
||||
}
|
||||
|
||||
$acceptModelSaved(uri: UriComponents): void {
|
||||
const document = this._getNotebookDocument(URI.revive(uri));
|
||||
this._onDidSaveNotebookDocument.fire(document.notebookDocument);
|
||||
this._onDidSaveNotebookDocument.fire(document.apiNotebook);
|
||||
}
|
||||
|
||||
$acceptEditorPropertiesChanged(id: string, data: INotebookEditorPropertiesChangeData): void {
|
||||
@@ -482,7 +482,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
||||
const document = this._getNotebookDocument(URI.revive(uri));
|
||||
document.acceptDocumentPropertiesChanged(data);
|
||||
if (data.metadata) {
|
||||
this._onDidChangeNotebookDocumentMetadata.fire({ document: document.notebookDocument });
|
||||
this._onDidChangeNotebookDocumentMetadata.fire({ document: document.apiNotebook });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -514,8 +514,8 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
||||
if (document) {
|
||||
document.dispose();
|
||||
this._documents.delete(revivedUri);
|
||||
this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({ removedDocuments: document.notebookDocument.getCells().map(cell => cell.document.uri) });
|
||||
this._onDidCloseNotebookDocument.fire(document.notebookDocument);
|
||||
this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({ removedDocuments: document.apiNotebook.getCells().map(cell => cell.document.uri) });
|
||||
this._onDidCloseNotebookDocument.fire(document.apiNotebook);
|
||||
}
|
||||
|
||||
for (const editor of this._editors.values()) {
|
||||
@@ -571,13 +571,13 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
||||
}, false);
|
||||
|
||||
// add cell document as vscode.TextDocument
|
||||
addedCellDocuments.push(...modelData.cells.map(cell => ExtHostCell.asModelAddData(document.notebookDocument, cell)));
|
||||
addedCellDocuments.push(...modelData.cells.map(cell => ExtHostCell.asModelAddData(document.apiNotebook, cell)));
|
||||
|
||||
this._documents.get(uri)?.dispose();
|
||||
this._documents.set(uri, document);
|
||||
this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({ addedDocuments: addedCellDocuments });
|
||||
|
||||
this._onDidOpenNotebookDocument.fire(document.notebookDocument);
|
||||
this._onDidOpenNotebookDocument.fire(document.apiNotebook);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,8 +737,8 @@ class NotebookCellExecutionTask extends Disposable {
|
||||
asApiObject(): vscode.NotebookCellExecutionTask {
|
||||
const that = this;
|
||||
return Object.freeze(<vscode.NotebookCellExecutionTask>{
|
||||
get document() { return that._document.notebookDocument; },
|
||||
get cell() { return that._cell.cell; },
|
||||
get document() { return that._document.apiNotebook; },
|
||||
get cell() { return that._cell.apiCell; },
|
||||
|
||||
get executionOrder() { return that._executionOrder; },
|
||||
set executionOrder(v: number | undefined) {
|
||||
|
||||
Reference in New Issue
Block a user