Re microsoft/vscode-pull-request-github#70. Open the comments panel only for the first session.

This commit is contained in:
rebornix
2018-08-27 11:56:04 -07:00
parent 8ca1bb3d99
commit 9f864bac0d

View File

@@ -25,6 +25,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
private _proxy: ExtHostCommentsShape;
private _documentProviders = new Map<number, IDisposable>();
private _workspaceProviders = new Map<number, IDisposable>();
private _firstSessionStart: boolean;
constructor(
extHostContext: IExtHostContext,
@@ -35,6 +36,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
) {
super();
this._disposables = [];
this._firstSessionStart = true;
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostComments);
this._disposables.push(this._editorService.onDidActiveEditorChange(e => {
const editors = this.getFocusedEditors();
@@ -83,7 +85,10 @@ export class MainThreadComments extends Disposable implements MainThreadComments
$registerWorkspaceCommentProvider(handle: number): void {
this._workspaceProviders.set(handle, undefined);
this._panelService.setPanelEnablement(COMMENTS_PANEL_ID, true);
this._panelService.openPanel(COMMENTS_PANEL_ID);
if (this._firstSessionStart) {
this._panelService.openPanel(COMMENTS_PANEL_ID);
this._firstSessionStart = false;
}
this._proxy.$provideWorkspaceComments(handle).then(commentThreads => {
if (commentThreads) {
this._commentService.setWorkspaceComments(handle, commentThreads);