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

Feature request: Setting to change workspaceStorage location #22557

Closed
sean-mcmanus opened this issue Mar 13, 2017 · 21 comments
Closed

Feature request: Setting to change workspaceStorage location #22557

sean-mcmanus opened this issue Mar 13, 2017 · 21 comments
Assignees
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code

Comments

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Mar 13, 2017

Our C++ extension can generate several GB of per-workspace data (and theoretically so could other extensions). We want some sort of workspaceStorage setting so users can change the location to a drive with more storage space. The default on Windows is AppData\Roaming\Code\User\workspaceStorage. Our extension could provide this setting ourselves, but it seems like it should belong to VS code so that everyone using the workspaceStorage can benefit.

@bpasero bpasero assigned jrieken and dbaeumer and unassigned bpasero Mar 14, 2017
@dbaeumer
Copy link
Member

IMO we should not hide this behind a general workspace storage settings since it sounds more like a workspace & extension specific setting. I can imagine that workspace A stores this metadata on drive X: where as workspace B stores the metadata on drive Y:.

@jrieken jrieken added api feature-request Request for new features or functionality labels Mar 14, 2017
@mguptawork
Copy link

@dbaeumer I think having a general workspace storage setting would be invaluable, I want to be able to choose what the default location where my information is stored. My roaming profile has a hard limit on the amount of data I can store and I don't want to use it as a workspace storage area.

@Tyriar
Copy link
Member

Tyriar commented May 8, 2017

This seems like an edge case that may only affect the C++ extension and very few others, with the obvious workaround of storing somewhere owned by the extension.

@mguptawork related to roaming: #3884

@sean-mcmanus
Copy link
Contributor Author

Sure, that's fine. I assumed other extensions existed that used large amounts of storage, but if that's not the case, it's easy for us to add the setting to our extension.

@mguptawork
Copy link

@Tyriar I would like the ability to store my data somewhere other than the default AppData\Roaming\Code\User\workspaceStorage, it's not just extensions, this is the location for all cached data for VS code. The area keeps getting filled and I keep having to delete data. This would be a very valuable option for me and I'm sure for a lot of other users.

Further considering VS code rightfully prides itself on being easily configurable by updating a simple JSON. It seems to be an unusual oversight that we cannot configure the location of the workspaceStorage.

@Tyriar
Copy link
Member

Tyriar commented May 15, 2017

@mguptawork easily configurable and at the same time not bloated by overly specific settings with very few use cases. Why not just store the large files in some json file defined in an extension setting?

You could also run the client and specify your user data dir on the other drive as another workaround.

@sean-mcmanus
Copy link
Contributor Author

cpptools has the databaseFilename setting for changing the location from the workspaceStorage, but it's per-workspace with no per-user option yet. It looks like code --user-data-dir <dir> is the option @Tyriar is referring to.

@mguptawork
Copy link

mguptawork commented May 15, 2017

@Tyriar I don't see this as an overly specific setting, having an option to select the location of my "general" workspace seems to be a pretty general configuration. As I commented earlier, this is not a problem I'm facing just because of one extension. In fact as @sean-mcmanus has pointed out, cpptools does have an option to change the cache location, which I'm already using. But the general workspace is used to store vscode's caches, it's used to store code's updates and so on. It's a data hog and I have no control where that data hogging happens. Having an option to specify that directory would be really valuable.

@sean-mcmanus
Copy link
Contributor Author

sean-mcmanus commented May 15, 2017

@mguptawork Changing your shortcut to run Code.exe --user-data-dir <dir> works as a good workaround for me (at least on Windows), although you may need to close your other VS Code instances. I assume there is some technical reason why this is a command line argument instead of in the settings.json.

@Tyriar
Copy link
Member

Tyriar commented May 15, 2017

@mguptawork I think the real fix here is for ensuring only lightweight files get put in roaming as part of #3884 (comment). In the proposal I made on that issue workspaceStorage.json is in local appdata, not roaming.

@mguptawork
Copy link

@sean-mcmanus @Tyriar oh I did not realize your suggestion meant we can give a user-data-dir option. That is indeed a good workaround for windows. I also think the option to put workspaceStorage files in local instead of roaming is a step in the right direction.

Infact it makes even more sense this be configurable via the settings json given the option exists to configure it via switches. After all the settings json captures the "permanent" state you would like your editor to be in. If everytime you want to bring your editor with a certain setting, it makes sense for that setting to belong in a config file. The switches should be used to override your default custom config.

@Tyriar
Copy link
Member

Tyriar commented May 15, 2017

It cannot be included in settings.json as that's loaded too late in the process for various reasons (performance is a big one). This is the reason a locale.json was added just for the language; so we didn't need to block initialization in order to parse a potentially large or malformed json file.

@mguptawork
Copy link

@Tyriar I see what you mean, I had a look at main.js and you are using locale.json and user-data-dir around the same time. I have a compromise suggestion then. Perhaps a person could configure what they would like their workspaceStorage location to be during installation time, having perhaps three options two defaults and a custom one. The Roaming folder, the installation folder or a custom folder

That information could be stored in the locale.json. If they want to change it after installation. It's on them. They can copy it and change the path manually. In a later release perhaps the option to change it automatically can be given via a small function, accessible from the command menu. What do you think?

@mguptawork
Copy link

Hi All, are we good with going forward with the suggestion I mentioned above?

@Tyriar
Copy link
Member

Tyriar commented May 22, 2017

There are a few ways to work around the issue now, I think we should revisit this once #3884 and #329 are resolved.

@thomthom
Copy link

thomthom commented Nov 8, 2017

Just checking the status of this one. I've been struggling with limited HD storage and I just realized that CPP Tools from VSCode had eaten a lot of GBs. Being able to manage where the cache is and clear it would be good.

@sean-mcmanus
Copy link
Contributor Author

@thomthom The cpptools team hasn't done any changes for this. You can set the browse.databaseFilename for projects, change your shortcut to run Code.exe --user-data-dir <dir>, and/or add a link to the workspaceStorage location and delete the files occasionally. It's on our todo list to add a C++ setting to change the default database location, but not many people have been asking for it.

@vscodebot
Copy link

vscodebot bot commented Sep 17, 2018

This iteration we focus on issue grooming. This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@sun-xm
Copy link

sun-xm commented Oct 22, 2019

Just curious why not save the workspaceStorage data just under .vscode directory in each workspace folder? Easy to find and delete to entirely reset the workspace. It's much cleaner to me.

@sean-mcmanus
Copy link
Contributor Author

@sun-xm That was the default originally for our C/C++ extension (and the same as the VS default in their .vs folder), but we got lots of users complaining about the large database file being added to their workspace so we moved it. Setting your C_Cpp.default.browse.databaseFilename to "${workspaceFolder}/.vscode/vc.db" is the workaround for our extension.

@sun-xm
Copy link

sun-xm commented Oct 24, 2019

Sounds good. Thanks very much for the explanation @sean-mcmanus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

8 participants