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

CLI: support associating a profile to a worksapce #158275

Merged
merged 9 commits into from Aug 18, 2022
Merged

Conversation

sandy081
Copy link
Member

Support associating a profile to a workspace from CLI using the argument --settings-profile. Profile will be created if not exist. Eg: code <folder/workspace> --settings-profile <name>

@sandy081 sandy081 enabled auto-merge (squash) August 16, 2022 13:55
@sandy081 sandy081 self-assigned this Aug 16, 2022
@sandy081 sandy081 requested a review from bpasero August 16, 2022 13:55
@VSCodeTriageBot VSCodeTriageBot added this to the August 2022 milestone Aug 16, 2022
src/vs/platform/environment/common/argv.ts Outdated Show resolved Hide resolved
src/vs/platform/window/common/window.ts Outdated Show resolved Hide resolved
src/vs/platform/window/common/window.ts Outdated Show resolved Hide resolved
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a follow up, we should probably look into the code in desktop.main.ts that deals with the profile:

  • how is this supported in web?
  • can we optimize entering the profile given we call this so early even before some services are created?
  • are there things created before the profile switch that need to update when the profile changes or is that being taken care of already?
  • is the code safe for parallel execution? because I can run code-insiders --profile ... to restore multiple windows so the code gets executed multiple times?

@sandy081
Copy link
Member Author

how is this supported in web

In web, would be adding profileInfo api so that embedder can provide the info for the opened workspace. For eg., embedder can pass the profile template blob for the workbench to initialise.

can we optimize entering the profile given we call this so early even before some services are created?

It is well optimised now. But will see if we can optimise further.

are there things created before the profile switch that need to update when the profile changes or is that being taken care of already?

Yeah, they are taken care of.

is the code safe for parallel execution? because I can run code-insiders --profile ... to restore multiple windows so the code gets executed multiple times?

Yes it is. Some of the changes in this PR are meant to handle this.

@sandy081 sandy081 merged commit 559ebf8 into main Aug 18, 2022
@sandy081 sandy081 deleted the sandy081/christian-ox branch August 18, 2022 11:41
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants