mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 14:31:31 +01:00
Remove custom property from nb and cell metadata (#207995)
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user