cleanup notebook argument processor, remove INotebookTextModel#handle and use uri instead, https://github.com/microsoft/vscode/issues/105735

This commit is contained in:
Johannes Rieken
2020-09-07 11:52:40 +02:00
parent 53ffabab80
commit ed9c404bf9
9 changed files with 18 additions and 28 deletions

View File

@@ -962,16 +962,13 @@ export class ExtHostNotebookController implements ExtHostNotebookShape, ExtHostN
// Serialized INotebookCellActionContext
processArgument: (arg) => {
if (arg && arg.$mid === 12) {
const documentHandle = arg.notebookEditor?.notebookHandle;
const notebookUri = arg.notebookEditor?.notebookUri;
const cellHandle = arg.cell.handle;
for (const value of this._editors) {
if (value[1].editor.notebookData.handle === documentHandle) {
const cell = value[1].editor.notebookData.getCell(cellHandle);
if (cell) {
return cell.cell;
}
}
const data = this._documents.get(notebookUri);
const cell = data?.getCell(cellHandle);
if (cell) {
return cell.cell;
}
}
return arg;