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

Global Favorites #32

Open gazugafan opened 5 years ago

gazugafan commented 5 years ago

Is your feature request related to a problem? Please describe. I'd like to store "global" favorites that aren't related to a single workspace, so that when I switch between workspaces the favorites remain the same. Unfortunately, I think the favorites.json file location MUST be relative to a workspace root.

Describe the solution you'd like A way to store a favorites.json file globally, such as in the extension's own data directory. Maybe allow for environment variable expansion, like is done at https://github.com/oleg-shilo/Favorites.vscode ?

sveggiani commented 5 years ago

This would be a great addition to this Extension. Do you have it in mind for next releases @kdcro101 ?

cuixiping commented 4 years ago

Just change one line code to add global favorites if you don't care workspace favorites. I did and it works well for me.

File: src/class/storage.ts Change this line

this.storageFilePath = path.join(workspace.getConfigurationRoot(), execRelativePath);

to

this.storageFilePath = path.isAbsolute(execRelativePath) ? execRelativePath : path.join(workspace.getConfigurationRoot(), execRelativePath);

And config your Storage File Path value as a absolute path in your vscode extension setting.