-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Use file system structure for grouping #41
Comments
Are you talking about the statusbar item? Because you can configure the quick pick to show you the full path of the project, that seems something you'd want.
Like, you want projects automatically organized based on their location in the file system?
It should also detect git repos, and arbitrary projects can be added manually. |
I guess i was thinking more of a Mouse over on the project, but the status bar is fine and i'll enable that. I created a PowerShell script that will generate the json for the vscode_projects.json which works well but wont auto update. The one thing I did notice after this setup was that when i navigate to the Project list, its always fully expanded (kind of annoying now) I believe when i had it auto pick up it only found projects with a .vscode folder, however the script now bypasses this problem. Here is the script i used to generate the json $root = gi 'D:\Repos'
$results = [pscustomobject]@{
groups = @()
projects = @()
}
function processFolder {
param($folder, $data)
foreach($subfolder in (gci $folder.FullName -Directory -force:$false))
{
if(isProject $subfolder){
$data.projects += new-project $subfolder
}else{
$g = new-pGroup $subfolder
$data.groups += $g
processFolder $subfolder $g
}
}
}
function isProject {
param($folder)
## only checking for .git, probably worth checking a few more options
return (test-path (join-path $folder.FullName '.git'))
}
function new-project {
param($folder)
[pscustomobject]@{
name = $folder.name
path = $folder.fullname
icon = "code"
}
}
function new-pGroup {
param($folder)
[pscustomobject]@{
name=$folder.Name
description = "automated"
icon = "globe"
projects = @()
groups = @()
}
}
processFolder $root $results
$results | convertto-json -Depth 15 |
What project, those displayed in the activity bar view? We could very well add support for that. Currently we are displaying their descriptions in the tooltips.
We could add support for that in the future, it has been requested a few times already. If anybody would like to work on that I'd be happy to consider a PR. Thanks for sharing the script. |
Do you have an approach you'd like to take? I think the refreshroots should work if perhaps i add a "retainFolders" or something like that to have that auto scan basically just pull in non-project folders as folders in the treeview. The other thought was to have a new node type in the xml or add a property to the Group nodes to indicate auto population. |
Sorry I don't really have time to provide much guidance on this right now, I'm not even sure it should be implemented. What you should probably do is implement another "projects fetcher" https://github.com/fabiospampinato/vscode-projects-plus/blob/master/src%2Ffetchers%2Fprojects%2Fgit_tower.ts But I'm not sure how that should work, in what group should fetched projects be put into? Should we always preserve the file system structure even if the project is found many levels deep? And what if the user doesn't want this behavior? It might be a good idea to publish a separate projects manager built around this feature. |
The way i have my folders setup is like this
/repos/platform/org/repo
The platform is, for example, github/GHE/bitbucket etc
It would be awesome if i could set the repo's folder as my root and have it retain some of the folder structure (platform/org) for faster locating of projects. One of the problems I've had with it as it stands now is that i will commonly have a fork of a project
so these two paths could show up
repos/github/org/repo1
repos/github/jrich523/repo1
with how its setup now the tool tip shows "repo1" for both, making it hard to tell which is the original project and the fork.
I guess ideally i'd like to have a matching folder structure in VS Code to quickly pick and switch projects.
Also it seems like you're basing it off of a .vscode folder, which, if this is correct, would likely cause a problem with new clones (have to open by hand to create .vscode folder)?
anyways, i LOVE what you've done!
Thanks!
The text was updated successfully, but these errors were encountered: