-
Notifications
You must be signed in to change notification settings - Fork 102
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
Propagate and handle connection/disconnection events #1142
Conversation
@sebjulliand I cannot comment on the code, but a quick run showed the following:
Enough for now... 😉 |
Wrongly used methods reference instead of instance's
Superb feedback @chrjorgensen , thanks!
More or less! When I worked on the
My bad...I called references to methods instead of the date handler instance's methods, which resulted in a crash (your console should have been full of those). Now it's ok, instance methods get called, the date shows and if the date settings is changed with opened member, a warning is issued to ask to close the editors to apply the change.
This one I'm not sure about. I reorganized the call to the views' refresh when connecting, hopefully it should fix the issue. The views will also refresh synchronously on disconnect to empty them. There should not be any remaining items from a previous connection this way.
Fixed!
Right! Enjoy your week-end 😉 |
Woah, big change indeed. I've had a review and I appreciate your notes about the significant changes. The biggest change here that I am worried is to the member file system, in particular continuing to support 'edit' and 'diff' mode when source dates are enabled. I need to sit down for a few hours and just use Code for IBM i on this branch to give it some real testing - and that's exactly what I'm going to do tomorrow (Sunday) morning.
@sebjulliand @chrjorgensen Seeing as this is the largest PR at the moment, would you say this should go to the top of the queue with highest priority? Great work. I admire your skill! |
As always, thanks for your appreciation, it means a lot 😊 AFAIC, I would say this PR should be merged as soon as it's approved, given the amount of changes in there and the fact it fixes/enhance the "Disconnect gracefully" PR that's already been merged. |
Ok, after my testing this is what I've found:
Here's a couple of issues: DeployDeploy status bar item was not showing up on the first connection even with a local folder open: Though if I disconnected and connected to the same system again, it was shown: Source datesOn first time connect, it was mostly working. The logic to track edits looks like it was working correctly - this is the important part! When opening a file though, the gutter was not appearing even when I had source dates enabled (usually it has to render when the file has been opened also). Screen.Recording.2023-03-19.at.11.42.14.AM.movLastly, the biggest issue was that the gutter was not showing at all if I disconnected and reconnected to the same system. Couldn't really understand why. |
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.
Please see my review above.
@worksofliam I fixed it all (well...at least what you found!). |
@sebjulliand i will play some more tonight! Great work! |
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.
Just gave your changes a whirl. I am very happy with this change. I am just have a stroll through the code and take a look and how you managed it!
@chjorgensen Would you also mind giving this another go? I think we're getting close to merging this in.
getConnection() { | ||
return this.connection; | ||
} | ||
private connection: IBMi | undefined; |
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.
This is welcome change. Fingers crossed anyone using our extension API isn't using these!
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 am happy with my testing and the code - how grateful I am. This will allow for a much improved switch between systems. A welcome UX change.
@chrjorgensen Before we merge, I'd like your overview also. If you agree with me that it runs stable, I think we can go ahead and merge.
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.
@sebjulliand A quick review found the following:
- Disconnecting with a branch open in the object browser gives the following message:
- When disconnecting, the message
Disconnecting from...
stays on screen. Should beDisconnected from...
.
It's great to be able to change the source date settings and just reopen the editor and not having to disconnect + reconnect! 👌
@chrjorgensen thanks for the testing!
Fixed...
...and fixed! |
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.
@sebjulliand LGTM - no further problems found.
@worksofliam I'll let it be up to you to approve - I have not found any more issues.
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 am happy too. Let's merge! This will be released tonight in 1.7.6.
Changes
This PR follows changes introduced by #1110.
Disconnecting and connecting to another IBM i would leave the extension in a state where some part would remain initialized for the previous connection:
member
file system provider remained configured for the previous connection's settingsThe PR mainly reorganize the extension initialisation process and leverage the
connected
/disconnected
events to handle connection changes.Noticeable changes:
IBMiEvent
type (makes it easier to use and find event references)member
file system provider now dynamically adapts to the current connection's settings and its changes. Most of the related code has been reorganized and converted to TypeScriptinstantiate.ts
toextension.ts
connected
event intialization; mainly for Debug, Deployment, Instantiate and QSysFSChecklist