3

I'm new to TypeScript and the VS Code API. I'm looking to learn and am creating an extension that I've wanted a long time in order to do so. I managed to create the functionality I needed (basically a filename filter) using a WebView but I'd prefer using treeview. Here's what I've got:

Unfiltered file list

unfiltered

Filtered file list

filtered

Ideally, I'd like to create this:

combo

Is this currently possible and what keywords do I need to research to make it happen?

Thanks

3
  • Document tree filtering seems to work with other TreeViews... would that work? Commented Jul 5, 2021 at 1:25
  • Mayyybe! Maybe I can use my own Search to send values to that filter! Thank you, I'll take a look. Commented Jul 5, 2021 at 10:35
  • Would VSCode 1.70 (July 2022) help? Commented Jul 19, 2022 at 14:55

1 Answer 1

1

See the demo at https://stackoverflow.com/a/73039858/836330 of filtering in a TreeView. It is not part of the extension-available api though. You could trigger it in an extension with

await vscode.commands.executeCommand('workbench.files.action.focusFilesExplorer'); await vscode.commands.executeCommand('list.find'); 

but looking at the commit for this functionality I don't think there is any way to populate that find input from an extension - I don't think the command list.find takes any arguments. I tried a couple of ways like

await vscode.commands.executeCommand('list.find', {text: 'findMe'}); await vscode.commands.executeCommand('list.find', {query: 'findMe'}); 

Other find functionality in vscode can take arguments, but this filtering a treeView is brand new and will probably need a feature request if you want to populate the find input programmatically.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.