Inconsistency with NotebookEdit.updateCellMetadata
and updateNotebookMetadata
#184606
Labels
api-proposal
author-verification-requested
Issues potentially verifiable by issue author
insiders-released
Patch has been released in VS Code Insiders
notebook-api
verification-needed
Verification of issue is requested
verification-steps-needed
Steps to verify are needed for verification
verified
Verification succeeded
Milestone
When updating cell metadata for a cell, users call
NotebookEdit.updateCellMetadata
which provides a function to alter the metadata of a cell. This usesreplaceNotebookCellMetadata
defined inextHostTypes.ts
.vscode/src/vscode-dts/vscode.d.ts
Lines 3536 to 3542 in 56f11d9
vscode/src/vs/workbench/api/common/extHostTypes.ts
Lines 834 to 836 in 56f11d9
When
replaceNotebookCellMetadata
is called, the CellEditType is marked asPartialMetadata
, resulting in the metadata of the cell only being updated with the passed in data, rather than fully replaced. This makes it difficult to determine how to remove fields from a cell's metadata, a change needed for fixing vscode/jupyter#13522. This can be worked around in this situation by setting the field to null.However, if a user calls
NotebookEdit.updateNotebookMetadata
, it appears that the functionality is a full replacement of initial metadata. There is a slight inconsistency here between the functionality of the two functions.Couple initial ideas:
updateCellMetadata
. Add in a line stating that this is an iterative change, only altering the fields passed into this function* @param newCellMetadata The new metadata for the cell.
* @param newCellMetadata The **revised** metadata for the cell.
The text was updated successfully, but these errors were encountered: