kdcro101 / vscode-favorites

Add files and directories to workspace favorites. You can create groups (and subgroups) of favorite items with files and folders. Time saver for complex projects.
MIT License
49 stars 13 forks source link

Feature Request: Support multiple favorites JSON files #28

Closed arfordweb closed 5 years ago

arfordweb commented 5 years ago

As it is now, I added .favorites.json to my .gitignore so it won't interfere with other developers' usage of this extension. It would be nice if, instead, this config were installed in multiple files in a folder like .vscode-favorites-items/favorites1.json, etc.

If we could switch between JSON files in that folder with a dropdown, we could check that entire folder in to the repo to allow other developers to utilize the favorites configs we create.

For instance, let's say I'm making changes to a TodoItemPhotos features. It has styles, components, selectors, reducers, etc. all over a large codebase. I could create a favorites file others can use to show the same folder structure as the main project, but with only files pertinent to that feature available. If I could save it as any JSON file in a "hidden" config folder, I could share that with other developers, but without it getting in their way.

A possible way to do this now is to check in a single JSON file that all developers create favorites groups within for features, or for their own favorites. But, in such a case, I can foresee that config being corrupted by merge conflicts regularly. If we could save a multitude of JSON files in a folder, that would cut down the likelihood of merge conflicts dramatically.

Thanks for the awesome extension!

kdcro101 commented 5 years ago

@arfordweb ,

Thank you for your feedback.

Please update to version 2.3.0. Functionalities you requested have been added.

How to use:

Add favorites.storageRegistry to your workspace settings, for example:

// paths are relative to workspace
 "favorites.storageRegistry": [
            "favorites/system.json",
            "favorites/classes.json",
            "favorites/services.json",
],

Select active storage file from registry by clicking status bar element select or by executing command Favorites: Select alternative storage from registry from command palette and then selecting item from list: list

Keep in mind that when you select active storage file all add favorite operations will write in currently selected storage file.

If you have any problems, open issue.

kdcro101 commented 5 years ago

@arfordweb ,

To use unique set for each user of repo and having shared sets use:

For example:

// example for arfordweb workspace settings
 "favorites.storageRegistry": [
            "favorites/arfordweb/uniqueSet1.json",
            "favorites/arfordweb/uniqueSet2.json",
            "favorites/arfordweb/uniqueSet3.json",
            "favorites/shared/classes.json",
            "favorites/shared/services.json",
],

// example for otherUser1 workspace settings
 "favorites.storageRegistry": [
            "favorites/otherUser1/uniqueSet1.json",
            "favorites/otherUser1/uniqueSet2.json",
            "favorites/otherUser1/uniqueSet3.json",
            "favorites/shared/classes.json",
            "favorites/shared/services.json",
],
mbaas2 commented 5 years ago

Pardon me - I'm a VSC-newbie and am getting acquainted with all the new terminilogy and philosophy. Is it possible to maintain a truly global list of favs that is accessible regardless of current workspace?