Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to get a handler for the default Explorer TreeView #76891

Closed
eine opened this issue Jul 8, 2019 · 4 comments
Closed

Allow to get a handler for the default Explorer TreeView #76891

eine opened this issue Jul 8, 2019 · 4 comments
Assignees
Labels
api feature-request Request for new features or functionality file-explorer Explorer widget issues *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@eine
Copy link

eine commented Jul 8, 2019

I'm trying to get a handler for the default File Explorer TreeView. The use case is to reveal (and focus) a given item programmatically, after an action is triggered in a separate Custom TreeView contributed by my own extension.

I found #30288, about how to reveal an item in the Custom TreeView. However, I'd like to reveal an item in the default File Explorer instead. Hence, I tried window.createTreeView:

const myhandle = vscode.window.createTreeView(viewId: 'explorer');

But it is invalid, because it requires TreeViewOptions, which I don't want to provide/override.

I'd expect the API to provide window.getTreeView, so it is possible to interact with the default File Explorer view. AFAIK, currently it is only possible to add features in the expected contribution points, e.g. the context menu.

@jrieken jrieken assigned isidorn and unassigned jrieken Jul 8, 2019
@isidorn
Copy link
Contributor

isidorn commented Jul 8, 2019

This is a fair feature request, however it is not currently on the plan, thus assigning to backlog.

@isidorn isidorn added api feature-request Request for new features or functionality file-explorer Explorer widget issues labels Jul 8, 2019
@isidorn isidorn added this to the Backlog milestone Jul 8, 2019
@eine
Copy link
Author

eine commented Jul 8, 2019

@isidorn, is there any workaround/hack I can use meanwhile?

Since it might take long until this feature is included on some plan, an alternative I have considered is to use an additional 'subtree view', where the desired file explorer subtree is shown. However, I'm afraid that it is not possible to 'reuse' all the default and custom options that are configured/defined for the File Explorer viewId. I.e., to make a (custom) copy/instance of File Explorer with a limited scope. Hence, I would need to reimplement all the features in the custom view, which sounds as a no-go.

Another approach would be to filter the content of the default File Explorer, instead of trying to reveal some subdir. Is it possible to programmatically filter the content of the File Explorer?

@isidorn
Copy link
Contributor

isidorn commented Jul 8, 2019

Unfortunetly there is no workaround.
We are not exposing the Explorer via the API.

And sorry it is not possible to programmaticly filter the content in the file explorer.
It is simply not exposed and this goes with our API rules. More about our approach can be found here
https://code.visualstudio.com/api and in some corresponding docs

@isidorn isidorn added the *out-of-scope Posted issue is not in scope of VS Code label Oct 9, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 9, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality file-explorer Explorer widget issues *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

3 participants