Remove custom property from nb and cell metadata (#207995)

This commit is contained in:
Don Jayamanne
2024-03-19 01:01:04 +11:00
committed by GitHub
parent e752296594
commit 19a78385c7
6 changed files with 42 additions and 42 deletions

View File

@@ -83,14 +83,14 @@ const apiTestSerializer: vscode.NotebookSerializer = {
},
deserializeNotebook(_content, _token) {
const dto: vscode.NotebookData = {
metadata: { custom: { testMetadata: false } },
metadata: { testMetadata: false },
cells: [
{
value: 'test',
languageId: 'typescript',
kind: vscode.NotebookCellKind.Code,
outputs: [],
metadata: { custom: { testCellMetadata: 123 } },
metadata: { testCellMetadata: 123 },
executionSummary: { timing: { startTime: 10, endTime: 20 } }
},
{
@@ -107,7 +107,7 @@ const apiTestSerializer: vscode.NotebookSerializer = {
})
],
executionSummary: { executionOrder: 5, success: true },
metadata: { custom: { testCellMetadata: 456 } }
metadata: { testCellMetadata: 456 }
}
]
};

View File

@@ -295,11 +295,11 @@ suite('Notebook Document', function () {
const document = await vscode.workspace.openNotebookDocument(uri);
const edit = new vscode.WorkspaceEdit();
const metdataEdit = vscode.NotebookEdit.updateNotebookMetadata({ ...document.metadata, custom: { ...(document.metadata.custom || {}), extraNotebookMetadata: true } });
const metdataEdit = vscode.NotebookEdit.updateNotebookMetadata({ ...document.metadata, extraNotebookMetadata: true });
edit.set(document.uri, [metdataEdit]);
const success = await vscode.workspace.applyEdit(edit);
assert.equal(success, true);
assert.ok(document.metadata.custom.extraNotebookMetadata, `Test metadata not found`);
assert.ok(document.metadata.extraNotebookMetadata, `Test metadata not found`);
});
test('setTextDocumentLanguage for notebook cells', async function () {

View File

@@ -91,14 +91,14 @@ const apiTestSerializer: vscode.NotebookSerializer = {
},
deserializeNotebook(_content, _token) {
const dto: vscode.NotebookData = {
metadata: { custom: { testMetadata: false } },
metadata: { testMetadata: false },
cells: [
{
value: 'test',
languageId: 'typescript',
kind: vscode.NotebookCellKind.Code,
outputs: [],
metadata: { custom: { testCellMetadata: 123 } },
metadata: { testCellMetadata: 123 },
executionSummary: { timing: { startTime: 10, endTime: 20 } }
},
{
@@ -115,7 +115,7 @@ const apiTestSerializer: vscode.NotebookSerializer = {
})
],
executionSummary: { executionOrder: 5, success: true },
metadata: { custom: { testCellMetadata: 456 } }
metadata: { testCellMetadata: 456 }
}
]
};