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

Support automatic detection of workspaces #334

Open
gandalfsaxe opened this issue Feb 26, 2020 · 18 comments
Open

Support automatic detection of workspaces #334

gandalfsaxe opened this issue Feb 26, 2020 · 18 comments
Assignees
Milestone

Comments

@gandalfsaxe
Copy link

gandalfsaxe commented Feb 26, 2020

With #151 now workspaces can be saved as projects, which is great. However with git, I rely entirely on automatically detected projects in nested directories of one or more a master directories. It'd be great to have the same for .code-workspace files.

@alefragnani
Copy link
Owner

Hi @gandalfsaxe ,

I guess your comment in your previous issue would be the best solution to this. In fact, like folders that contains .vscode folder inside is recognized as a VS Code Project, the same goes for .code-workspace files.

But, I’m not sure if I would mix or create a new panel, exclusive to Workspaces. I think mix would work just fine.

What do you think?

@gandalfsaxe
Copy link
Author

I'm inclined to think a mix would work fine, yes. If vscode project A and B are both in multi-workspace C, then it's fine to have them all listed and available when fuzzy-searching.

How does the system currently not duplicate projects that are folders containing both contains .git and a .vscode? Which is prioritized?

@alefragnani
Copy link
Owner

That’s great 👏 .

BTW, the priorization is: Favorites, VSCode, Git, Mercurial, SVN and Any. And it’s coded here:

getProjects(items)

Hope this helps

@gandalfsaxe
Copy link
Author

Thanks, makes sense.

@mahyuan
Copy link

mahyuan commented Mar 2, 2020

If there are so much projects in sidbar, not easy to find.
Really looking forward to add grouping functionality, show directory tree

@alefragnani
Copy link
Owner

Hi @mhy-web

Sometime ago, a “search field” has been requested (registered in #213) but the VS Code team closed the required API request, so I have to close the issue.

Looking again now, the API feature has been reopened (another issue microsoft/vscode#70646) and maybe we will see it appear in the future (no ETA yet).

About grouping, it’s on my radar too :-)

@carloscadux
Copy link

Please, implement a functionality to indicate a base folders to search for .code-workspace files.
This way I could uninstall other extensions for managing workspaces, and keep only 'Project Manager' to handle all the needs related to workspaces, folders and other project types managing.
Thanks!

@alefragnani alefragnani added this to the Backlog milestone May 16, 2022
@wottpal
Copy link

wottpal commented May 26, 2022

Automatic workspace detection opening would be 🔥 (disturbs me every day that i open a project but forget to open the code-workspace and therefore vscode is running with different settings)

Let me know if I can help to get this done :)

@wottpal
Copy link

wottpal commented Jun 24, 2022

btw @alefragnani i just donated to the project (know that's by far not enough to value your work as it deserves)!

@devantler
Copy link

devantler commented Jun 27, 2022

Supporting this would go well with my suggestion for the "new project" feature (see #474 (comment))

Then we can create, open and work with workspaces without any need to leave VSCode or to combine multiple commands.

@alefragnani
Copy link
Owner

Hi @wottpal,

First of all, thank you for your donation! Your support is very important!

About your previous comment, I wonder if your scenario is a bit different from the original request.

I mean, this issue is to auto detection of workspaces within some baseFolders, similar to how Git repos and VS Code projects are automatically detected (folders with a .vscode subfolder) and becomes available in Project Manager: List Projects to Open command. Your comment, on the other hand, seems you would like VS Code to automatically detect if an opened folder contains a .code-workspace file, and instead of opening the folder (that you requested) it automatically switches to the .code-workspace. Am I right?

If that's the case, I wonder if VS Code itself wouldn't handle it, as think it's a great feature. I don't use Workspaces that much, but from time to time I'm opening a few of them. BTW, I didn't find anything in VS Code issues. Nevertheless, I guess this could also be added the the extension, but of course, it would work only if the folder is opened using the extension.

Hope this helps

@wottpal
Copy link

wottpal commented Jun 28, 2022

Many thanks for the clarifications, @alefragnani! ❤️

To be honest I would love to see both features:

  1. Detecting project-folders with workspaces in them. (But in this case, it would be important for me that workspace-detected folders take precedence/priority compared to git-detected ones. As I don't want to turn off git-detection and don't want a project-list full of duplicates).

  2. And again, as you understood correctly, the auto-opening of a workspace whenever a folder containing one was opened. I would love to see this as a feature of this plugin as I think this is a good fit but I could also imagine creating a vscode-issue (though i have no big hopes of getting that through soon). And the restriction you mentioned, that this only works if a folder is opened through the extension, is perfectly fine for me as I open all my projects with your extension only.

Let me know how we best proceed with those, I can also open a new issue in this repo and/or even help with implementation (but I've never developed vscode-extensions before unfortunately)

@alefragnani
Copy link
Owner

Hi @wottpal ,

Just to let you know, I opened #617 to track your second suggestion.

About your first suggestion, the extension has the groupList setting, which creates a kind of precedence between each kind of project. But I suggest you leave it false and play with sortList setting. It will ignore the kind of project and sort them by Name, Path or Recent. You will know its kind only because the icon attached to it.

Hope this helps

@saminton
Copy link

saminton commented Oct 4, 2022

Any news on this ? I would love to see workspace support

@wottpal
Copy link

wottpal commented Oct 5, 2022

Hey @saminton / @alefragnani,
as i wanted to explore building vscode extensions myself anyway, i took the chance and built a small one myself. it shows all available workspace files when opening a directory with vscode. it also can be configured to open the found workspace file automatically.

➡️ https://marketplace.visualstudio.com/items?itemName=zoma.vscode-auto-open-workspace

@MarkCanada
Copy link

Hey @saminton / @alefragnani, as i wanted to explore building vscode extensions myself anyway, i took the chance and built a small one myself. it shows all available workspace files when opening a directory with vscode. it also can be configured to open the found workspace file automatically.

➡️ https://marketplace.visualstudio.com/items?itemName=zoma.vscode-auto-open-workspace

Takes "a bit" to open the workspace since it's not integrated into the projects, but happy to say that it worked for me - even with the .code-workspace file "hidden" in the .vscode folder 👍

@wottpal
Copy link

wottpal commented Feb 3, 2023

Thanks for your feedback, @MarkCanada! Really appreciate that someone tried it out. Opened an issue about this: wottpal/vscode-auto-open-workspace#1. Happy for any help/suggestions as I do not have many ideas on how to improve it right now.

@MostHated
Copy link

I am not sure if I am a bit too late to the party, but I had a request. I was hoping the be able to specify a custom file which would be used to determine if a folder is a project or not. All of my current projects contain a file named ".project.nvim", which my Neovim project manager uses to determine if a folder is a project or not and acts as the project root.
It would be nice to be able to simply add that file name into a list that the VSCode project manager can use, then treating folders containing a filename from that list as projects automatically, instead of having to maintain multiple project lists which depend on different meta files.

An example might look like the following:

  "projectManager.any.projectIndicatorFilename": [
    ".project.nvim",
    ".code-workspace"
  ],

Thanks!
-MH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants