-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Idea] Create auto group based on files.exclude
#8
Comments
Maybe this could be solved by adding a check in the /**
* Add a resource (file/folder) to the group.
* @param uri The vscode.URI of the resource.
*/
public addResource = (uri: Uri) => {
if (this._resourceContains(uri)) {
return;
}
if (file_does_exist(uri)){ // or however this looks like in TS
this._resource.push(uri);
}
}; |
Heya, thanks for the feedback. I really like your idea and just spotted your PR. I'm pretty busy at work at the minute but will make time on the weekend to review and merge. Thanks again for your effort much appreciated. |
Thanks for the reply. This does not have any urgency, so take your time. |
Hi, In the current master branch, I have enabled the following two algorithms. 1) Exclude GroupThe excluded group can be enabled in the settings of the extension (requires restarting vscode to pick up changes). When enabled a Dynamic Group named "Excluded" is added to the extension the group automatically shows any files and folders that match the glob patterns defined inside the files.exclude file. 2) Glob Groups.It is now possible to define Dynamic Groups based on glob patterns. This should provide a lot of flexibility of what is possible to automatically group. See the readme for more information. You can grab the pre-release from the git hub releases tab which should be on the right-hand side when viewing this repo. There are some other improvements, have a look at the readme in the project root. Unless I find some major issues I should be releasing this version to the marketplace in the next week or two. Feel free to give the pre-release a try and let me know what you think. Once again thanks for the feedback and helping to improve the extension. |
Hey there! |
Thank the flooding and cyclone in Cairns. On holidays with nowhere to go. So plenty of time to code. :) :) I liked the suggestion as it led to a new feature where you can now define dynamic folders based on glob patterns. There are still some little niggles because I can't access vscodes own glob implementation and I have to use another library that works slightly differently. Just post any issues and they should be easy to fix. Just grab the latest build I have published from git hub it will be some 1.5.x version. |
Thanks for the update, I downloaded the latest version and want to give it a try. However, I'm too stupid to figure out how to set up the dynamic exclude group.
These are my excluded files and I would like them to show up in a File Focus group. Could you maybe show me how to add the dynamic group? Thanks! |
So two options. The first option, go to settings and tick the setting: "Show Excluded Group". Then restart VSCode. You should then see a group that will automatically contain anything defined inside "files.exclude". The second option is to define your own filters. Go to settings and look for "Glob Group". Then click "edit in settings json" Within the [] you can put the following configuration. {
"name": "Hidden Files",
"include": ["**/.*"],
"exclude": ["**/node_modules/**", "**/.git{,/**/*}"],
"recurse": true
}
Of course you can modify the patterns to whatever you want, notice that you can specify multiple pattern for both include and exclude as has been done in the example for exclude.
It would then look something like this: "filefocus.globGroup": [
{
"name": "Hidden Files",
"include": ["**/.*"],
"exclude": ["**/node_modules/**", "**/.git{,/**/*}"],
"recurse": false
}
], |
Awesome extension! I really like it and I think you're doing a great job here.
I have one idea where I don't know how difficult it would be to implement and whether this is even a use case that more people encounter.
I'm frequently having projects with many project files / hidden files / dot files. Here's how that could look like:
Now if I add some of these files in my
files.exclude
section in thesettings.json
like thisAND add them to File Focus, I can organize my workspace nicely:
I really like this. This makes everything much more organized in my opinion. It does even solve an issue that has been thoroughly discussed on HackerNews.
So my idea/question: Would it be possible to add a setting that is something like: "Automatically create focus group from excluded files". Then, if toggled, a focus group "Excluded" (or some other name) is created. This should add all files in the
files.exclude
section of thesettings.json
, even if their flag is set tofalse
and nottrue
. This would allow to have this setup that I have shown above out of the box.Implementation wise I am not sure if this is difficult or not. I am not a TS developer, but I am willing to try to help if that's something that would bring this feature to live.
Happy to hear your opinion :)
The text was updated successfully, but these errors were encountered: