Add a Tree View
Example of adding a tree view here
Creating the view
Instructions here are similar to Add a Tree View. Please jump to documentation there for additional details.
Integrate the view with the plugin
- Add new enum to
DendronTreeViewKey
export enum DendronTreeViewKey { ..., TREE_VIEW_V2 = "dendron.tree-view", }
- Edit description to
TREE_VIEWS
TREE_VIEWS = { ..., [DendronEditorViewKey.TREE_VIEW_V2]: { ... }, }
- Update
constants.ts
- src/constants.ts
DENDRON_VIEWS = [ ..., { ...treeViewConfig2VSCodeEntry(DendronTreeViewKey.TREE_VIEW_V2), where: "explorer", }, ]
- Update
package.json
From Update Pkg JsonGo to text ā- Inside of vscode, use
> Run Task
- Execute
gen:config
to update package.json`
- Inside of vscode, use
- Create the webview
- see
src/views/DendronTreeViewV2.ts
for an example
- see
- Initialize webview on start
DendronExtension { ... setupViews { ... const provider = new DendronTreeViewV2(); vscode.window.registerWebviewViewProvider( DendronTreeViewV2.viewType, provider, ) } }
Backlinks