-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
Add vscode.window.activeFolder #15991
Comments
Isn't that |
My understand is that it's the selected folder in the explorer. @leotm Please clarify |
Hi guys, any news when this feature will be available? Any other way to get current selected folder? Thanks. |
I woudl prefer to have vscode.activeWorkspaceFolder - Especially with the new vscode update 1.18 allowing to add multiple folders in workspace |
Kind of... You can register commands for the explorer context menu. When being selected the resource/uri of the item in question is being passed as argument. It's not really the explorer-tree-selection but contextual and well-integrated with our commands. |
Few hints if someone want to do it (or note for me later) :
This API would be REALLY helpful... |
Is it possible to ONLY have a context menu item without it ever showing up in the command palette? UPDATE:
|
How can I get selected folder if command runs using keybind? Function's params will be null |
I need this feature now. Has it ever been implemented or is there another way to get the selected items in the explorer view? I need to search for specific files but only in the currently selected folder. |
We closed this issue because we don't plan to address it in the foreseeable future. You can find more detailed information about our decision-making process 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! |
This seems like such an easy low hanging fruit to harvest. The extension we're developing has to do stuff to files located in the currently selected folder. Currently we're trying to guess that folder by looking at the file currently being edited. That's not a particular safe way of doing it but currently the only way. It would be much more safe to have it handled by VS Code generally. I'd like very much for you to reconsider opening this case again. To me sounds like a really easy thing to implement but I have no idea how the internals of vscode module is made. |
Yeah but the resource/uri of the item in question is not passed if you're running the extension though a keyboard shortcut. So lets say you're on the explorer view and you press enter on a folder. Next you use a keyboard shortcut to run an extension you've made, it won't pass that URI as a param. Which means you're forced to run the extension via a mouse click... which I try to avoid if at all possible :) |
To open git-bash.exe at the active folder (like Git and GitHub Desktop).
Works 👌 for
activeTextEditor
VS Code Marketplace: McCarter.start-git-bash
Repo: vscode-start-git-bash by @Robert923
#3553 and #2067 are similar to this specific request, but not quite.
The text was updated successfully, but these errors were encountered: