3

Im making an extension and I'm curious is it possible to add a search filter/box to a tree component?

Im currently coding the extension in javascript but im not sure if its possible or not

This is what i want to add in at the top of my tree view

2
  • use a WebViewView, you can use any HTML/CSS/JS you want Commented Jan 25, 2021 at 4:18
  • Check VSCode 1.70 (July 2022) which seems to have implemented something similar. Commented Jul 19, 2022 at 14:57

1 Answer 1

1

It will be built-in to vscode in v1.70. Here it is working in a treeView that I wrote for vertical tabgroups:

find in a tree view

The placement of the find widget is a little unfortunate right now.

WHen you have focus in the treeView Ctrl+F is bound to the command list.find which brings up the Find in list/treeView widget.

You need to enable the filter option icon to see it work.

Sign up to request clarification or add additional context in comments.

2 Comments

Unfortunately, this only function only searches through the TreeViewItem.label ignoring the description or any other additional metadata I'd like to be searching/filtering through. :/
@maninak I couldn't find an issue requesting a broader search. It is an interesting idea though.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.