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

Global storage add folder to goups breaks when change workspace #11

Open
InfiniteCoder01 opened this issue Nov 11, 2023 · 10 comments
Open

Comments

@InfiniteCoder01
Copy link

When I:

  1. Set storage to be global
  2. Add a folder to it by right-clicking a folder in explorer and selecting "Add to Focus Group"
  3. Change workspace (for example, open another folder)
    I see, that I can't access focused folder anymore, because it uses local paths.
    And I see a warning icon next to it.
@InfiniteCoder01
Copy link
Author

Also, I should mention, that I'm on linux and here we need folder path to start with a slash to be global

@InfiniteCoder01
Copy link
Author

A possible workaround, is to open a file where paths are stored and change paths to global manually, but I don't know where this file can be located

@quicken
Copy link
Owner

quicken commented Nov 22, 2023

I think there may be a misunderstanding behind the "global storage" setting. I will update the configuration description to be more clear.

However, I will provide you with a more in-depth description.

In VSCode settings can be shared across computers. For example, you might have a computer at home and another computer at school or at work. If you use VSCodes "global" storage for settings then those settings will automatically be synced to all your computers. In the case of File Focus that would mean that when you add something to a workspace at Home and then open that workspace on another computer the File Focus groups would automatically appear on that machine too.

What "global" does not currently do is make, groups open in a different workspace.

My thinking was that your files and folder would be different in a different workspace anyway. With that line of thinking I would be interested to learn more about your specific use case or workflow.

I will keep this thread open for discussion, thanks for the feedback and if you have any questions please ask.

@InfiniteCoder01
Copy link
Author

Thank you for making it more clear.

My usecases:

  • I'm using NixOS, which is declaratively configured system, so to install a package or add a shell alias, I would edit configuration file and run the command to rebuild the system. However, sometimes I'm working on another project (another VSCode workspace) and I want to add a package. I will need to change the config, for that I'll need to switch my workspace. I wish there was a feature to pin a workspace to switch to it temporarily.
  • More obvious usecase would be having notes in a separate folder (for example, as neopolitan files).

@quicken
Copy link
Owner

quicken commented Dec 15, 2023

Heya,

I just published a pre-release version that includes the ability to define groups based on glob patterns. This feature might be able to get you what you want.

Have a look at the readme file in the section for "Creating Dynamic Folders with Glob Patterns"

The new version is not yet in the market place so you will have to download it from this project it's under releases the tag is: 1.5.9b

Let me know how you go.

Cheers,

Marcel

@InfiniteCoder01
Copy link
Author

After building VSIX from this exact tag, if I press reload button with any globgroup defined, I get this error:

Error running command fileFocusExtension.reloadStorage: Cannot read properties of undefined (reading 'refresh'). This is likely caused by the extension that contributes fileFocusExtension.reloadStorage.

@InfiniteCoder01
Copy link
Author

And any global path breaks globgroups completely

@quicken
Copy link
Owner

quicken commented Dec 15, 2023

interesting, can you share the glob groups you have setup so that I can debug?

@InfiniteCoder01
Copy link
Author

I just did a group from example (but without excludes) and refresh broke:

    "filefocus.globgroup": [
        {
            "name": "Dister",
            "include": "**/.*"
        }
    ]

And global paths don't work either:

    "filefocus.globgroup": [
        {
            "name": "Dister",
            "include": "/home/infinitecoder/.config/**/.*"
        }
    ]

@quicken
Copy link
Owner

quicken commented Dec 17, 2023

Cool, thanks for that. I have just added a new beta release VSIX file to GitHub it is 1.5.10b.

Also, I have decided to change the configuration in settings slightly which is a breaking change if you have the previous beta.

Keeping the old globGroup definition will probably crash the extension so you would need to update the definition in your settings as follows:

"filefocus.globGroup": [
        {
            "name": "Dister",
            "include": ["**/.*"]
        }
    ]

Note: The case of the key has changed to globGroup.

Include and the optional exclude are now an array of patterns to support more complex use cases. There is also an option to only search the root of workspaces. (the name of that property may still change."

I think I now understand by global paths, could it be that you mean absolute paths on your computer instead of paths inside a vscode workspace? If that assumption is correct then it will currently not be possible to search those paths.

The reason is that vscode extension skd has its idea of a file system and without a lot of work it is only possible to refer to folders that have been added into vscode.

Going back to your first use case as long as you have folders added inside a workspace you should be able to put together a glob group that automatically has the files you are looking for.

Let me know how you go with the latest build.

Cheers,

Marcel

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