-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Introduce transient profiles #158695
Introduce transient profiles #158695
Conversation
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.
removeProfile
shall be renamed toremoveProfileIfNotAssociated
instead of adding a flag- rename
--transient
to--profile-transient
Are we thinking this is going to be used a lot from CLI over |
Agreed. I assume |
@@ -27,6 +27,7 @@ export interface ICodeWindow extends IDisposable { | |||
readonly win: BrowserWindow | null; /* `null` after being disposed */ | |||
readonly config: INativeWindowConfiguration | undefined; | |||
|
|||
readonly previousWorkspace?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier; |
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.
@bpasero I have added this property so that I can read the previous workspace and the profile associated and remove the profile if it is transient. Please take a look and let me know if there is a better way to do this.
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.
Not clear to me why this has to go into the window.ts
, can you not associate workspaces and windows (by their numerical ID for example) by listening to window events in your code and do this? I would only have such a property if it is used in more places tbh.
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 could do that. But getting this from ICodeWindow
is more elegant.
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 is not super clear to me, just reading the code what the lifecycle is though. Someone else using this could think this is stored and restored across restarts?
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.
Ok! Created this debt item #159189 to move it to the place where I use it.
Introduce transient profiles. These profiles are deleted automatically once the last window which uses it is closed.
You can create and associate a transient profile from
--profile-transient
flag. Eg:code <folder-uri> --profile-transient
Create Transient Settings Profile
These will create a transient settings profile and associate it to the workspace. Once the workspace is closed (or uses different profile) this profile is deleted.
Fixes #154460
CC @bpasero