fix tree layout, add proposed API

This commit is contained in:
aamunger
2023-11-13 16:31:44 -08:00
committed by Aaron Munger
parent d39e29e617
commit 85a73e7fcc
4 changed files with 214 additions and 71 deletions

View File

@@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
export interface NotebookController {
/** Set this to attach a variable provider to this controller. */
variableProvider?: NotebookVariableProvider;
}
export enum VariablesRequestKind {
Named,
Indexed
}
interface VariablesResult {
variable: Variable;
namedVariableCount: number;
indexedVariableCount: number;
}
interface NotebookVariableProvider {
onDidChangeVariables: Event<void>;
/** When variablesReference is undefined, this is requesting global Variables. When a variable is passed, it's requesting child props of that Variable. */
provideChildren(notebook: NotebookDocument, variable: Variable | undefined, kind: VariablesRequestKind, start: number, token: CancellationToken): AsyncIterable<VariablesResult>;
}
interface Variable {
/** The variable's name. */
name: string;
/** The variable's value.
This can be a multi-line text, e.g. for a function the body of a function.
For structured variables (which do not have a simple value), it is recommended to provide a one-line representation of the structured object.
This helps to identify the structured object in the collapsed state when its children are not yet visible.
An empty string can be used if no value should be shown in the UI.
*/
value: string;
}
}