-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
added version to the workbench layout interface #1603
Conversation
52c055b
to
48cf081
Compare
This change is the first step to resolve #1075. We want to reset the work bench if there is a version mismatch, to avoid the confusion. All users who get this change would see a reset workbench the first time s/he loads theia. |
setLayoutData({ version, mainPanel, bottomPanel, leftPanel, rightPanel, statusBar }: ApplicationShell.LayoutData): void { | ||
if (version !== LAYOUT_DATA_VERSION) { | ||
throw new Error(`Saved workbench layout (version ${version || 'unknown'}) is incompatible with the current (${LAYOUT_DATA_VERSION})`); | ||
} |
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 think it would be good to extract this check to a protected method checkLayoutData
so it can be overridden. That method could return the passed layout data if the version matches, so by overriding it it's easy to implement conversions between data format versions.
setLayoutData(layoutData: ApplicationShell.LayoutData): void {
const { mainPanel, bottomPanel, etc. } = this.checkLayoutData(layoutData);
...
}
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.
Since the checkLayoutData() returns an object, i prefer to name it in the way of getXXXX(). WDYT?
8ec2e39
to
47568d1
Compare
@spoenemann As far as I can tell, after a workbench reset the editors are gone, so it does not make sense to have those labels and buttons on the right hand side of the status bar (see screenshot below, including the "problems" button) any more. |
Resetting the workbench also clears the status bar, so we don't need to do anything in that case. |
Tested. yep you are right :) |
- The initial step that resolves eclipse-theia#1075 Signed-off-by: elaihau <liang.huang@ericsson.com>
Signed-off-by: elaihau liang.huang@ericsson.com