-
Notifications
You must be signed in to change notification settings - Fork 73
CustomTreeSection
github-actions[bot] edited this page May 16, 2024
·
4 revisions
The 'custom' tree section, usually contributed by extensions as TreeView. All The behavior is defined by the general ViewSection class.
import { SideBarView, CustomTreeSection } from 'vscode-extension-tester';
...
// Type is inferred automatically, the type cast here is used to be more explicit
const section = await new SideBarView().getContent().getSection('servers') as CustomTreeSection;
Some sections may provide a welcome content when their tree is empty.
// find welcome content, return undefined if not present
const welcome: WelcomeContentSection = await section.findWelcomeContent();
// get all the possible buttons and paragraphs in a list
const contents = await welcome.getContents();
// get all buttons
const btns = await welcome.getButtons();
// get paragraphs as strings in a list
const text = await welcome.getTextSections();