-
Notifications
You must be signed in to change notification settings - Fork 526
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
Handling vscode insiders devcontainers #7111
Conversation
@@ -12,7 +12,9 @@ namespace Aspire.Hosting.Devcontainers; | |||
internal class DevcontainerSettingsWriter(ILogger<DevcontainerSettingsWriter> logger, IOptions<CodespacesOptions> codespaceOptions, IOptions<DevcontainersOptions> devcontainerOptions) | |||
{ | |||
private const string CodespaceSettingsPath = "/home/vscode/.vscode-remote/data/Machine/settings.json"; | |||
private const string LocalDevcontainerSettingsPath = "/home/vscode/.vscode-server/data/Machine/settings.json"; | |||
private const string VSCodeServerPath = "/home/vscode/.vscode-server"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't these install side by side? We want to apply these modifications to both right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you switch between VS Code and VS Code Insiders with the same devcontainer, you will end up with both a .vscode-server
and .vscode-insiders-server
in the /home/vscode
directory, which means that there is the possibility of false positives and that you apply changes to the wrong settings file.
Unfortunately, I can't find any way in which you can detect which edition of VS Code you're running in the devcontainer. Here's the Community Toolkit, opened in a devcontainer in both VS Code and VS Code Insiders
No environment variables seem useful enough in determining which one to apply beyond "guessing" using the available paths, short of checking the PATH
for vscode-server
or vscode-server-insiders
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can’t we do both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd require a bit more invasive a refactor, since the method GetSettingsPath
(that used the const) only returned a single path, but if that'd be preferred, I can have it go down that path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I would do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Fixes #7110