-
Notifications
You must be signed in to change notification settings - Fork 13
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
Implement manifest selection #71
Conversation
src/flatpakManifest.ts
Outdated
@@ -467,6 +468,12 @@ export class FlatpakManifest { | |||
return new Command('flatpak', args, this.workspace) | |||
} | |||
|
|||
async deleteBuildDir(): Promise<void> { |
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.
Do we want to 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.
we call it on manifest changed and clean command
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.
and it complains when tried to build init when .flatpak exists. I haven't tested much the edge cases yet, maybe tomorrow
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.
hmm maybe just the .flatpak/repo
. Since deleting .flatpak
deletes every cached dependencies.
Edit: Changed to just delete the repoDir
Most of the things are now implemented and probably need a commit squash. One thing I'm not sure about is whether the status bar item should open the active manifest or activate the It also needs more testing for edge cases |
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.
I did a quick review, I will get back to this later today
src/flatpakManifest.ts
Outdated
* @param other the more updated FlatpakManifest to get new info from | ||
* @returns whether to request for a rebuild | ||
*/ | ||
updateFieldsFrom(other: FlatpakManifest): boolean { |
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.
Do we need to update the fields here? normally we would have separate FlatpakManifest or not?
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.
Either could work, but I think the intent is shown better and clearer this way.
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.
I just noticed you are calling this when the manifest receives changes, I think the best way to handle this is to just the new modified manifest as the active one (if it has the same uri as the currently active one)
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.
changed to that behavior, and since an activeManifestChanged
triggers to clear repoDir
. It will ask to initialize a build every manifest modification. So I guess we can remove that message and just handle the build initialization automatically on a build or rebuild command.
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 will ask to initialize a build every manifest modification.
But normally we already know if the manifest uri changed, if not and that manifest state says it was initialized that should give us enough info to know whether we should show the dialog or not
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.
Nvm, that was not the reason. ===
operator in js doesn't check by value, but by instance. So had to use util.isDeepStrictEqual
, either way, I think it is still better to remove that message, since running any build command should initialize a build
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.
Oops, sorry. I didn't notice your last message. Was it okay though to remove the message with this reason?
running any build command should initialize a build
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.
running any build command should initialize a build
It should, but my intention with that dialog is that someone not familiar with Flatpak/VScode could get an idea how to start a build and get the application up and running easily
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.
Should not be a bigger problem with #55. But that makes sense
await this.manifestManager.doWithActiveManifestElseDisplayErr((activeManifest) => { | ||
const runtimeTerminal = window.createTerminal(activeManifest.runtimeTerminal()) | ||
this.extCtx.subscriptions.push(runtimeTerminal) | ||
this.activeTerminals.push(runtimeTerminal) |
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.
What happens if the user closes the terminal, is it dropped from the activeTerminals list?
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.
ah yeah, that seems problematic. It is only used though to kill terminals when manifest changes. I think we can remove that since we can't also kill terminals that are provided by TerminalProviders.
And I realized killing terminals unknowingly maybe unideal
Btw, I sent you an invite for having write access to the repository just in case :) |
thanks :D |
fa0762c
to
052b56d
Compare
df10c4c
to
525b8da
Compare
Could use a rebase |
I'll squash every commits for easier rebase |
525b8da
to
dba5353
Compare
dba5353
to
4e02f31
Compare
there seems no cleaner way to do it |
04b4f14
to
29faecf
Compare
await this.ensurePipelineState() | ||
} | ||
|
||
private async resetPipelineState(): Promise<void> { |
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.
Should probably be part of workspaceState and called reset :)
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.
we don't want to reset activeManifestUri
too. Additionally, workspaceState shouldn't know which keys are part of the pipeline state as most of the pipeline state stuffs are handled in the extension.ts
fb3473c
to
74e16f9
Compare
74e16f9
to
1f9de44
Compare
Let us land this and do potential bugfixes/cleanups in following merge requests, awesome work! |
Closes #17 and #8
TODO: