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

Allow Open Named Configuration File... prior to attaching #4013

Open
chrmarti opened this issue Nov 13, 2020 · 4 comments
Open

Allow Open Named Configuration File... prior to attaching #4013

chrmarti opened this issue Nov 13, 2020 · 4 comments
Assignees
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Milestone

Comments

@chrmarti
Copy link
Contributor

One more suggestion to make my life easier is allowing access to command Remote-Containers: Open Named Configuration File... in command palette prior to attaching to container, or just providing a similar command that allows me to create an attach config before attaching to container.

Originally posted by @lbssousa in #3345 (comment)

@thomas-j-moffett
Copy link

thomas-j-moffett commented Mar 1, 2021

I'm not sure if this is part of the original request, but it would be ideal to have the Attached Container config files specified in a repository that can be easily shared with a team. https://code.visualstudio.com/docs/remote/attach-container#_attached-container-configuration-files

In my scenario, I am using Lando for my local dev, and I'm not looking to switch any time soon. However, I would like to take advantage of things like smart PHP intellisense, which only seems possible while running in a container (or having PHP installed on local machine, which I prefer not to do). Since I already have containers running in Lando with one of them running PHP, I would like to attach to that container, but I want the settings for that attached container to come from my project repository.

Also, it's unclear how often the settings get updated when you attach to a running container. I was just trying some stuff out, and I deleted the settings in /root/.vscode-server/data/Machine/settings.json on the attached container to see if settings would get loaded again. I closed remote connection, and then I attached to the same running container. The settings did not get re-imported.

I have my container settings in a directory like this on my actual local machine: ~/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/nameConfigs/NAME_OF_CONTAINER.json.

My goal would be able to store those settings in my project repo so I can easily share with the team and have them loaded from there when attaching to the running container.

I guess I can do some manual set up in Lando to get settings files where I need them on those containers, but since VSCode already has the core pieces of this feature, it'd best handled there.

Also, if any of this stuff is already possible and I just missed some documentation, please let me know! I just started trying out the remote containers feature earlier today and looking at the docs.

@thomas-j-moffett
Copy link

I did just re-read this part from here

Once saved, whenever you open a container for the first time with the same image / container name, these properties will be used to configure the environment.

I think that answers my question on how often the settings get updated, but it's still unclear how I get to the state where it will re-import those settings. It doesn't seem to happen by closing connection and attaching again. Would I have to destroy the Lando app, and rebuild just to get those settings re-imported?

Any clarification on that would be much appreciated.

@chrmarti
Copy link
Contributor Author

chrmarti commented Mar 2, 2021

@thomas-j-moffett You can delete data/Machine/.writeMachineSettingsMarker to make it write the settings while attaching again.

Could you open a new feature request for the repository with configs request?

@thomas-j-moffett
Copy link

@chrmarti Thanks for the note on forcing it to rewrite the settings!

I opened #4584 as a feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants