mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
Re microsoft/vscode-pull-request-github#70. Open the comments panel only for the first session.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user