Closed StevenMaude closed 2 months ago
~It seems like you can set the setting as follows in devcontainer.json
, but that "remote" setting gets overridden by the workspace settings:~
"customizations": {
"vscode": {
"settings": {
"files.autoSave": "off"
}
}
}
Actually, I think this works. The actual setting state is very confusing, because there are multiple levels of setting (user, workspace, remote…) and, I'm not entirely sure but I think, "Auto save" might be ticked in the menu bar, yet possibly disabled even?!
For reference, the other location you can add such settings is .vscode/settings.json
.
Disabling autosave entirely may not be what we want though:
Ctrl+S
; example: "files.autoSaveDelay": 60000
Now that we know that auto save is configurable in Codespaces, what I think needs to be decided to close this are:
When you connect to a codespace through Visual Studio Code running on your desktop, you must enable auto-save.
Finally, it will be useful to confirm that any settings changes added behave as intended in a codespace. The hierarchy of Visual Studio Code settings can be a little complex, especially with the extra "Remote" level added by Codespaces/dev containers.
For projects that only actually run code when opensafely run
, then the answers might be:
I'm closing this, because after testing it appears that autosave has been enabled and this isn't causing any problems with the user experience/performance.
In some instances, a frequent autosave may not be desirable; for example, where you have a site that rebuilds on every save.
For the research-template, this may or may not be OK.
Auto save is controlled via a JSON setting.