mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Select notebook in viewlet when opened in editor (#14854)
* test changes * code clean up * remove extra line * remove commented code * remove unnecessary import * update expand logic * implement parent,children on bookitem * merge conflicts * refactor code * fix trustBook test * typo on condition * feedback * indexOf to include * fix undefined error on expand * remove set parent * revert getTreeItem logic * Fix duplicated nodes * remove debug * Clean up logic * Fix tests * Fix logic * cleanup * Cleanup findAndExpandParentNode (#14960) Co-authored-by: chgagnon <chgagnon@microsoft.com>
This commit is contained in:
@@ -34,10 +34,12 @@ export interface BookTreeItemFormat {
|
||||
treeItemCollapsibleState: number;
|
||||
isUntitled: boolean;
|
||||
version?: BookVersion;
|
||||
parent?: BookTreeItem;
|
||||
children?: BookTreeItem[];
|
||||
}
|
||||
|
||||
export class BookTreeItem extends vscode.TreeItem {
|
||||
private _sections: JupyterBookSection[];
|
||||
private _sections: JupyterBookSection[] | undefined;
|
||||
private _uri: string | undefined;
|
||||
private _previousUri: string;
|
||||
private _nextUri: string;
|
||||
@@ -204,6 +206,22 @@ export class BookTreeItem extends vscode.TreeItem {
|
||||
this._tableOfContentsPath = tocPath;
|
||||
}
|
||||
|
||||
public get children(): BookTreeItem[] | undefined {
|
||||
return this.book.children;
|
||||
}
|
||||
|
||||
public set children(children: BookTreeItem[] | undefined) {
|
||||
this.book.children = children;
|
||||
}
|
||||
|
||||
public get parent(): BookTreeItem {
|
||||
return this.book.parent;
|
||||
}
|
||||
|
||||
public set parent(parent: BookTreeItem) {
|
||||
this.book.parent = parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to find a child section with a specified URL
|
||||
* @param url The url of the section we're searching for
|
||||
|
||||
Reference in New Issue
Block a user