Skip to content
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

Favorites not relative to workspace with multiple project folders #55

Open
B1Dobbs opened this issue Jan 8, 2021 · 3 comments
Open

Comments

@B1Dobbs
Copy link

B1Dobbs commented Jan 8, 2021

Describe the bug
When using either the global .favorites.json or the multi-set feature for different projects / workspaces, the files for this extension are stored in first folder in the workspace rather than relative to the workspace.

To Reproduce
Steps to reproduce the behavior:

  1. Open VSCode
  2. Add second folder to the workspace
  3. Add a favorite
  4. See that favorite .json file was added at the root of the first folder in the workspace.

Expected behavior
.favorites.json should have been stored and referenced relative to the workspace file ending in 'code-workspace'.

Screenshots
image
Favorites Settings
image
Result

System info (please complete the following information):

  • OS version: CentOS Linux 7
  • Favorites extension version: v2.4.5
  • vscode version: 1.48.2

Additional info
Notice that .favorites.json is under the folder labeled 'classic'. If I were to remove that folder from the workspace, my .favorites.json stored there would be inaccessible and then any new ones would be stored in the new top folder.

My .code-workspace file is located two folders up from the 'classic' folder and that's where I expected the favorite config files to be stored. With the favorites json files stored in the top folder, it now shows up on source control for that project which is problematic.

@GitMensch
Copy link

That's actually the described way, changing this would break existing setups.
I'd suggest to have, in your code-workspace:

"favorites.storageFilePath":"../../.favorites.json"

then - according to the docs - it should work (untested)

@B1Dobbs
Copy link
Author

B1Dobbs commented Jan 24, 2022

Hm, I don't think it's understood what I mentioned in the issue. My workspace is saved a couple folders up whereas the folder 'classic' is in the same folder as 'pro'. They are separate projects I work on in the same workspace.

So instead of favorites.json being stored relative to the workspace as it should be based on the note in settings, it is stored in the first project folder in my workspace. Why would the note say 'Storage file path relative to workspace' if it's really relative to the first folder in the workspace?

@GitMensch
Copy link

Readme has:

favorites.useWorkspace: number - default is 0
index of workspace to use as root when composing storage file path

So according to the docs it seems to be it always uses the first entry (zero based), while you want the "root" or one above, so use the appropriate one. A FR to have it relative to "real project root" with a value of -1 or similar sounds totally reasonable, but that would be @kdcro101's thing to adjust/implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants