mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-13 13:52:33 +01:00
custom metadata for notebook document.
This commit is contained in:
@@ -328,7 +328,7 @@ suite('metadata', () => {
|
||||
|
||||
await waitFor(500);
|
||||
assert.equal(vscode.notebook.activeNotebookEditor !== undefined, true, 'notebook first');
|
||||
assert.equal(vscode.notebook.activeNotebookEditor!.document.metadata.custom['testMetadata'] as boolean, false);
|
||||
assert.equal(vscode.notebook.activeNotebookEditor!.document.metadata.custom!['testMetadata'] as boolean, false);
|
||||
assert.equal(vscode.notebook.activeNotebookEditor!.selection?.metadata.custom!['testCellMetadata'] as number, 123);
|
||||
assert.equal(vscode.notebook.activeNotebookEditor!.selection?.language, 'typescript');
|
||||
});
|
||||
|
||||
Vendored
+4
-2
@@ -1642,9 +1642,9 @@ declare module 'vscode' {
|
||||
displayOrder?: GlobPattern[];
|
||||
|
||||
/**
|
||||
* Additional attributes of a cell metadata.
|
||||
* Additional attributes of the document metadata.
|
||||
*/
|
||||
[key: string]: any;
|
||||
custom?: { [key: string]: any };
|
||||
}
|
||||
|
||||
export interface NotebookDocument {
|
||||
@@ -1685,7 +1685,9 @@ declare module 'vscode' {
|
||||
* The primary selected cell on this notebook editor.
|
||||
*/
|
||||
readonly selection?: NotebookCell;
|
||||
|
||||
viewColumn?: ViewColumn;
|
||||
|
||||
/**
|
||||
* Fired when the output hosting webview posts a message.
|
||||
*/
|
||||
|
||||
@@ -124,6 +124,7 @@ export class NotebookEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
clearInput(): void {
|
||||
// de-ref widget
|
||||
super.clearInput();
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,7 @@ export class NotebookEditorInput extends EditorInput {
|
||||
return this._move(group, target)?.editor;
|
||||
}
|
||||
|
||||
// called when users rename a notebook document
|
||||
move(group: GroupIdentifier, target: URI): IMoveResult | undefined {
|
||||
if (this.textModel) {
|
||||
const contributedNotebookProviders = this.notebookService.getContributedNotebookProviders(target);
|
||||
|
||||
Reference in New Issue
Block a user