vscode-favorites icon indicating copy to clipboard operation
vscode-favorites copied to clipboard

Global Favorites

Open gazugafan opened this issue 6 years ago • 2 comments

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 ?

gazugafan avatar Nov 20 '18 20:11 gazugafan

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

sveggiani avatar Jun 19 '19 11:06 sveggiani

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.

cuixiping avatar Jan 04 '20 03:01 cuixiping