-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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] Add a user setting to change defaultDatabaseLocation #1404
Comments
@sean-mcmanus, could you give priority for this issue? I have several copy of my code, the disk always show full and need to clean the temp file. Thanks. |
Yeah, sorry for the repeated delay. This is sort of low priority for us, because there is a workaround of modifying your link to VS Code with |
@sean-mcmanus , I introduced VS code and cpptools extension to my colleagues, and they complained with to me about the symbol size many times. But not all people want to modify the argument to the Code path, this is not a simply method. I believe this is a big user experience. Could you give this priority? Please... |
@bobbrow This isn't fixed? Can't the user set the default.browse.databasefilename to something like |
@sean-mcmanus @bobbrow , It's better add a setting in "User settings", then it will be applied to all workspace. Thanks very much for your effort. :) |
Yeah, the setting does apply globally in the settings.json (user settings tab). It's C_Cpp.default.browse.databaseFilename in 0.17.0-insiders (or later) if you want to try it out before the official release (expected next week): https://github.com/Microsoft/vscode-cpptools/releases/ |
I was using this issue to track the "default" database location when no database is specified, that's why I removed the "fixed" label. There's still another setting I was planning to add (an enum instead of requiring users to figure out the |
Actually, it might have made sense to make the default.browse.databaseFilename an enum, because it would only work with ${workspaceFolder}, because otherwise multiple workspaces would trample over the same database. But as long as the setting is set as intended (i.e. no user error), it's okay. Well, there's no way to set the location to a place outside the workspaceFolder and still be unique (e.g. workspace root in C and database in F) -- if we supported ${workspaceFolderBasename} it would be a workaround for that issue, but no users have complained yet so it might not be worth adding. |
@sean-mcmanus , yes, I tried 0.17.0-insiders version, and set: |
After reading so much discussion, I still don't know how to simply change the Please tell me if there is a simple way of operation, thanks! |
@zhaojuntao You can user |
Could you use the same folder path to storage cpptools database and ipch file? such as : And I wish I can set workspaceStorage path, because currently this path is located in C disk. Database and Ipch file will results in the increase of C disk rapidly and it's also important for us. |
When you set
the precompiled headers (ipch) will go in the folder specified via intelliSenseCachePath and the database whereever you specific databaseFilename to go. .e.g.
put both in a |
@pfeerick Your suggested config change will cause all multiple workspaces to use the same database file, which is probably not what you want. The suggested fix would be to add the storage hash to the databaseFilename, but we haven't implemented that yet. |
@sean-mcmanus That would be the ideal fix. Thankfully, this works quite well with multi-root workspaces, since when the file already exists, a number is appended to the name..., so there must already be some filename collision detection logic in place. |
@pfeerick The additional database files gets created whenever the database is locked by another process -- the expected scenario is when the same folder is opened in 2 different VS Code instances (or VS Code and VS Code Insiders). The problem with relying on this behavior when the workspaces are different is that the database will likely need to be recreated every time and/or it may contain stale data from another workspace, because after the VS instances are closed and reloaded it will try to use the 0th, 1st, etc. databases but the ordering may not match the initial ordering. |
Drats! Thanks for the explanation Sean, I get it, it's likely to backfire on me at some point until the storage hash is exposed in a manner it can be used (variable?). Chances are pretty remote though as I've got it on a ramdisk on Windows, and tmpfs on linux, so it needs to recreate from scratch every time anyway, and and don't often switch workspaces so not too much chance for it to get confused. Lets just say I prefer it that way for now in comparison to needing 80+MB of cache files per project, with dozens of different project folders... |
This feature request is being closed due to insufficient upvotes. When enough upvotes are received, this issue will be eligible for our backlog. |
VS Code cpptools stores the symbols files in workspace storage default (Temp folder in Win OS) currently.
The request is adding a user setting to change defaultDatabaseLocation with setting "workspaceStorage" (current behavior) or "workspaceFolder" (original behavior). Just like:
"C_Cpp.defaultDatabaseLocation ": "workspaceStorage" or -> VS Code storage path
"C_Cpp.defaultDatabaseLocation ": "workspaceFolder" -> work space .vscode folder
More detail discussion please refer to: #558
The text was updated successfully, but these errors were encountered: