From af1b4ebdedbc3842ae419fb5638f679a59a58ee2 Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Thu, 8 Nov 2018 10:45:15 -0800 Subject: [PATCH] Refactoring comment service to not be keyed on handle --- src/vs/editor/common/modes.ts | 2 - .../electron-browser/mainThreadComments.ts | 76 ++++++++++----- src/vs/workbench/api/node/extHostComments.ts | 2 - .../parts/comments/common/commentModel.ts | 12 ++- .../comments/electron-browser/commentNode.ts | 2 +- .../electron-browser/commentService.ts | 95 +++++++++++-------- .../electron-browser/commentThreadWidget.ts | 8 +- .../commentsEditorContribution.ts | 18 ++-- .../electron-browser/commentsPanel.ts | 5 +- 9 files changed, 132 insertions(+), 88 deletions(-) diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index f1437578194..dddda55dbc4 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -1130,7 +1130,6 @@ export interface Command { * @internal */ export interface CommentInfo { - owner: number; threads: CommentThread[]; commentingRanges?: IRange[]; reply?: Command; @@ -1187,7 +1186,6 @@ export interface Comment { * @internal */ export interface CommentThreadChangedEvent { - readonly owner: number; /** * Added comment threads. */ diff --git a/src/vs/workbench/api/electron-browser/mainThreadComments.ts b/src/vs/workbench/api/electron-browser/mainThreadComments.ts index 137265bad71..347b9b6d014 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadComments.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadComments.ts @@ -16,13 +16,46 @@ import { COMMENTS_PANEL_ID } from 'vs/workbench/parts/comments/electron-browser/ import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { URI } from 'vs/base/common/uri'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { generateUuid } from 'vs/base/common/uuid'; +export class ExtensionCommentProviderHandler implements modes.DocumentCommentProvider { + private _proxy: ExtHostCommentsShape; + private _handle: number; + + constructor(proxy: ExtHostCommentsShape, handle: number) { + this._proxy = proxy; + this._handle = handle; + } + + async provideDocumentComments(uri, token) { + return this._proxy.$provideDocumentComments(this._handle, uri); + } + + async createNewCommentThread(uri, range, text, token) { + return this._proxy.$createNewCommentThread(this._handle, uri, range, text); + } + + async replyToCommentThread(uri, range, thread, text, token) { + return this._proxy.$replyToCommentThread(this._handle, uri, range, thread, text); + } + + async editComment(uri, comment, text, token) { + return this._proxy.$editComment(this._handle, uri, comment, text); + } + + async deleteComment(uri, comment, token) { + return this._proxy.$deleteComment(this._handle, uri, comment); + } + + onDidChangeCommentThreads = null; +} @extHostNamedCustomer(MainContext.MainThreadComments) export class MainThreadComments extends Disposable implements MainThreadCommentsShape { private _disposables: IDisposable[]; private _proxy: ExtHostCommentsShape; private _documentProviders = new Map(); private _workspaceProviders = new Map(); + private _handlers = new Map(); private _firstSessionStart: boolean; constructor( @@ -40,32 +73,20 @@ export class MainThreadComments extends Disposable implements MainThreadComments $registerDocumentCommentProvider(handle: number): void { this._documentProviders.set(handle, undefined); + const handler = new ExtensionCommentProviderHandler(this._proxy, handle); - this._commentService.registerDataProvider( - handle, - { - provideDocumentComments: async (uri, token) => { - return this._proxy.$provideDocumentComments(handle, uri); - }, - onDidChangeCommentThreads: null, - createNewCommentThread: async (uri, range, text, token) => { - return this._proxy.$createNewCommentThread(handle, uri, range, text); - }, - replyToCommentThread: async (uri, range, thread, text, token) => { - return this._proxy.$replyToCommentThread(handle, uri, range, thread, text); - }, - editComment: async (uri, comment, text, token) => { - return this._proxy.$editComment(handle, uri, comment, text); - }, - deleteComment: async (uri, comment, token) => { - return this._proxy.$deleteComment(handle, uri, comment); - } - } - ); + const providerId = generateUuid(); + this._handlers.set(handle, providerId); + + this._commentService.registerDataProvider(providerId, handler); } $registerWorkspaceCommentProvider(handle: number, extensionId: string): void { this._workspaceProviders.set(handle, undefined); + + const providerId = generateUuid(); + this._handlers.set(handle, providerId); + this._panelService.setPanelEnablement(COMMENTS_PANEL_ID, true); if (this._firstSessionStart) { this._panelService.openPanel(COMMENTS_PANEL_ID); @@ -73,7 +94,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments } this._proxy.$provideWorkspaceComments(handle).then(commentThreads => { if (commentThreads) { - this._commentService.setWorkspaceComments(handle, commentThreads); + this._commentService.setWorkspaceComments(providerId, commentThreads); } }); @@ -89,7 +110,9 @@ export class MainThreadComments extends Disposable implements MainThreadComments $unregisterDocumentCommentProvider(handle: number): void { this._documentProviders.delete(handle); - this._commentService.unregisterDataProvider(handle); + const handlerId = this._handlers.get(handle); + this._commentService.unregisterDataProvider(handlerId); + this._handlers.delete(handle); } $unregisterWorkspaceCommentProvider(handle: number): void { @@ -97,12 +120,15 @@ export class MainThreadComments extends Disposable implements MainThreadComments if (this._workspaceProviders.size === 0) { this._panelService.setPanelEnablement(COMMENTS_PANEL_ID, false); } - this._commentService.removeWorkspaceComments(handle); + const handlerId = this._handlers.get(handle); + this._commentService.removeWorkspaceComments(handlerId); + this._handlers.delete(handle); } $onDidCommentThreadsChange(handle: number, event: modes.CommentThreadChangedEvent) { // notify comment service - this._commentService.updateComments(event); + const providerId = this._handlers.get(handle); + this._commentService.updateComments(providerId, event); } getVisibleEditors(): ICodeEditor[] { diff --git a/src/vs/workbench/api/node/extHostComments.ts b/src/vs/workbench/api/node/extHostComments.ts index 1ab328793c7..cbd48c1a557 100644 --- a/src/vs/workbench/api/node/extHostComments.ts +++ b/src/vs/workbench/api/node/extHostComments.ts @@ -146,7 +146,6 @@ export class ExtHostComments implements ExtHostCommentsShape { provider.onDidChangeCommentThreads(event => { this._proxy.$onDidCommentThreadsChange(handle, { - owner: handle, changed: event.changed.map(thread => convertToCommentThread(provider, thread, this._commandsConverter)), added: event.added.map(thread => convertToCommentThread(provider, thread, this._commandsConverter)), removed: event.removed.map(thread => convertToCommentThread(provider, thread, this._commandsConverter)) @@ -157,7 +156,6 @@ export class ExtHostComments implements ExtHostCommentsShape { function convertCommentInfo(owner: number, provider: vscode.DocumentCommentProvider, vscodeCommentInfo: vscode.CommentInfo, commandsConverter: CommandsConverter): modes.CommentInfo { return { - owner: owner, threads: vscodeCommentInfo.threads.map(x => convertToCommentThread(provider, x, commandsConverter)), commentingRanges: vscodeCommentInfo.commentingRanges ? vscodeCommentInfo.commentingRanges.map(range => extHostTypeConverter.Range.from(range)) : [] }; diff --git a/src/vs/workbench/parts/comments/common/commentModel.ts b/src/vs/workbench/parts/comments/common/commentModel.ts index 64d0efd2cfa..1d22f17c626 100644 --- a/src/vs/workbench/parts/comments/common/commentModel.ts +++ b/src/vs/workbench/parts/comments/common/commentModel.ts @@ -10,6 +10,10 @@ import { groupBy, firstIndex, flatten } from 'vs/base/common/arrays'; import { localize } from 'vs/nls'; import { values } from 'vs/base/common/map'; +export interface ICommentThreadChangedEvent extends CommentThreadChangedEvent { + owner: string; +} + export class CommentNode { threadId: string; range: IRange; @@ -53,19 +57,19 @@ export class ResourceWithCommentThreads { export class CommentsModel { resourceCommentThreads: ResourceWithCommentThreads[]; - commentThreadsMap: Map; + commentThreadsMap: Map; constructor() { this.resourceCommentThreads = []; - this.commentThreadsMap = new Map(); + this.commentThreadsMap = new Map(); } - public setCommentThreads(owner: number, commentThreads: CommentThread[]): void { + public setCommentThreads(owner: string, commentThreads: CommentThread[]): void { this.commentThreadsMap.set(owner, this.groupByResource(commentThreads)); this.resourceCommentThreads = flatten(values(this.commentThreadsMap)); } - public updateCommentThreads(event: CommentThreadChangedEvent): boolean { + public updateCommentThreads(event: ICommentThreadChangedEvent): boolean { const { owner, removed, changed, added } = event; if (!this.commentThreadsMap.has(owner)) { return false; diff --git a/src/vs/workbench/parts/comments/electron-browser/commentNode.ts b/src/vs/workbench/parts/comments/electron-browser/commentNode.ts index cda2ce3f13e..40da787fdef 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentNode.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentNode.ts @@ -56,7 +56,7 @@ export class CommentNode extends Disposable { constructor( public comment: modes.Comment, - private owner: number, + private owner: string, private resource: URI, private markdownRenderer: MarkdownRenderer, private themeService: IThemeService, diff --git a/src/vs/workbench/parts/comments/electron-browser/commentService.ts b/src/vs/workbench/parts/comments/electron-browser/commentService.ts index 8623e77007c..c15bc0c5c41 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentService.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentService.ts @@ -11,16 +11,23 @@ import { URI } from 'vs/base/common/uri'; import { Range } from 'vs/editor/common/core/range'; import { keys } from 'vs/base/common/map'; import { CancellationToken } from 'vs/base/common/cancellation'; +import { ExtensionCommentProviderHandler } from 'vs/workbench/api/electron-browser/mainThreadComments'; +import { assign } from 'vs/base/common/objects'; +import { ICommentThreadChangedEvent } from 'vs/workbench/parts/comments/common/commentModel'; export const ICommentService = createDecorator('commentService'); export interface IResourceCommentThreadEvent { resource: URI; - commentInfos: CommentInfo[]; + commentInfos: ICommentInfo[]; +} + +export interface ICommentInfo extends CommentInfo { + owner: string; } export interface IWorkspaceCommentThreadsEvent { - ownerId: number; + ownerId: string; commentThreads: CommentThread[]; } @@ -28,20 +35,20 @@ export interface ICommentService { _serviceBrand: any; readonly onDidSetResourceCommentInfos: Event; readonly onDidSetAllCommentThreads: Event; - readonly onDidUpdateCommentThreads: Event; + readonly onDidUpdateCommentThreads: Event; readonly onDidSetDataProvider: Event; - readonly onDidDeleteDataProvider: Event; - setDocumentComments(resource: URI, commentInfos: CommentInfo[]): void; - setWorkspaceComments(owner: number, commentsByResource: CommentThread[]): void; - removeWorkspaceComments(owner: number): void; - registerDataProvider(owner: number, commentProvider: DocumentCommentProvider): void; - unregisterDataProvider(owner: number): void; - updateComments(event: CommentThreadChangedEvent): void; - createNewCommentThread(owner: number, resource: URI, range: Range, text: string): Promise; - replyToCommentThread(owner: number, resource: URI, range: Range, thread: CommentThread, text: string): Promise; - editComment(owner: number, resource: URI, comment: Comment, text: string): Promise; - deleteComment(owner: number, resource: URI, comment: Comment): Promise; - getComments(resource: URI): Promise; + readonly onDidDeleteDataProvider: Event; + setDocumentComments(resource: URI, commentInfos: ICommentInfo[]): void; + setWorkspaceComments(owner: string, commentsByResource: CommentThread[]): void; + removeWorkspaceComments(owner: string): void; + registerDataProvider(owner: string, commentProvider: ExtensionCommentProviderHandler): void; + unregisterDataProvider(owner: string): void; + updateComments(ownerId: string, event: CommentThreadChangedEvent): void; + createNewCommentThread(owner: string, resource: URI, range: Range, text: string): Promise; + replyToCommentThread(owner: string, resource: URI, range: Range, thread: CommentThread, text: string): Promise; + editComment(owner: string, resource: URI, comment: Comment, text: string): Promise; + deleteComment(owner: string, resource: URI, comment: Comment): Promise; + getComments(resource: URI): Promise; } export class CommentService extends Disposable implements ICommentService { @@ -50,8 +57,8 @@ export class CommentService extends Disposable implements ICommentService { private readonly _onDidSetDataProvider: Emitter = this._register(new Emitter()); readonly onDidSetDataProvider: Event = this._onDidSetDataProvider.event; - private readonly _onDidDeletetDataProvider: Emitter = this._register(new Emitter()); - readonly onDidDeleteDataProvider: Event = this._onDidDeletetDataProvider.event; + private readonly _onDidDeleteDataProvider: Emitter = this._register(new Emitter()); + readonly onDidDeleteDataProvider: Event = this._onDidDeleteDataProvider.event; private readonly _onDidSetResourceCommentInfos: Emitter = this._register(new Emitter()); readonly onDidSetResourceCommentInfos: Event = this._onDidSetResourceCommentInfos.event; @@ -59,42 +66,43 @@ export class CommentService extends Disposable implements ICommentService { private readonly _onDidSetAllCommentThreads: Emitter = this._register(new Emitter()); readonly onDidSetAllCommentThreads: Event = this._onDidSetAllCommentThreads.event; - private readonly _onDidUpdateCommentThreads: Emitter = this._register(new Emitter()); - readonly onDidUpdateCommentThreads: Event = this._onDidUpdateCommentThreads.event; + private readonly _onDidUpdateCommentThreads: Emitter = this._register(new Emitter()); + readonly onDidUpdateCommentThreads: Event = this._onDidUpdateCommentThreads.event; - private _commentProviders = new Map(); + private _commentProviders = new Map(); constructor() { super(); } - setDocumentComments(resource: URI, commentInfos: CommentInfo[]): void { + setDocumentComments(resource: URI, commentInfos: ICommentInfo[]): void { this._onDidSetResourceCommentInfos.fire({ resource, commentInfos }); } - setWorkspaceComments(owner: number, commentsByResource: CommentThread[]): void { + setWorkspaceComments(owner: string, commentsByResource: CommentThread[]): void { this._onDidSetAllCommentThreads.fire({ ownerId: owner, commentThreads: commentsByResource }); } - removeWorkspaceComments(owner: number): void { + removeWorkspaceComments(owner: string): void { this._onDidSetAllCommentThreads.fire({ ownerId: owner, commentThreads: [] }); } - registerDataProvider(owner: number, commentProvider: DocumentCommentProvider) { + registerDataProvider(owner: string, commentProvider: DocumentCommentProvider) { this._commentProviders.set(owner, commentProvider); this._onDidSetDataProvider.fire(); } - unregisterDataProvider(owner: number): void { + unregisterDataProvider(owner: string): void { this._commentProviders.delete(owner); - this._onDidDeletetDataProvider.fire(owner); + this._onDidDeleteDataProvider.fire(owner); } - updateComments(event: CommentThreadChangedEvent): void { - this._onDidUpdateCommentThreads.fire(event); + updateComments(ownerId: string, event: CommentThreadChangedEvent): void { + const evt = assign({}, event, { ownerId }); + this._onDidUpdateCommentThreads.fire(evt); } - async createNewCommentThread(owner: number, resource: URI, range: Range, text: string): Promise { + async createNewCommentThread(owner: string, resource: URI, range: Range, text: string): Promise { const commentProvider = this._commentProviders.get(owner); if (commentProvider) { @@ -104,7 +112,7 @@ export class CommentService extends Disposable implements ICommentService { return null; } - async replyToCommentThread(owner: number, resource: URI, range: Range, thread: CommentThread, text: string): Promise { + async replyToCommentThread(owner: string, resource: URI, range: Range, thread: CommentThread, text: string): Promise { const commentProvider = this._commentProviders.get(owner); if (commentProvider) { @@ -114,7 +122,7 @@ export class CommentService extends Disposable implements ICommentService { return null; } - editComment(owner: number, resource: URI, comment: Comment, text: string): Promise { + editComment(owner: string, resource: URI, comment: Comment, text: string): Promise { const commentProvider = this._commentProviders.get(owner); if (commentProvider) { @@ -124,7 +132,7 @@ export class CommentService extends Disposable implements ICommentService { return Promise.resolve(void 0); } - deleteComment(owner: number, resource: URI, comment: Comment): Promise { + deleteComment(owner: string, resource: URI, comment: Comment): Promise { const commentProvider = this._commentProviders.get(owner); if (commentProvider) { @@ -134,12 +142,23 @@ export class CommentService extends Disposable implements ICommentService { return Promise.resolve(false); } - getComments(resource: URI): Promise { - const result: Promise[] = []; - for (const handle of keys(this._commentProviders)) { - const provider = this._commentProviders.get(handle); - if ((provider).provideDocumentComments) { - result.push((provider).provideDocumentComments(resource, CancellationToken.None)); + getComments(resource: URI): Promise { + const result: Promise[] = []; + for (const owner of keys(this._commentProviders)) { + const provider = this._commentProviders.get(owner); + if (provider.provideDocumentComments) { + result.push(provider.provideDocumentComments(resource, CancellationToken.None).then(commentInfo => { + if (commentInfo) { + return { + owner: owner, + threads: commentInfo.threads, + commentingRanges: commentInfo.commentingRanges, + reply: commentInfo.reply + }; + } else { + return null; + } + })); } } diff --git a/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts b/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts index 9697e93878d..ebc848b4e29 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts @@ -63,7 +63,7 @@ export class ReviewZoneWidget extends ZoneWidget { private _collapseAction: Action; private _commentThread: modes.CommentThread; private _commentGlyph: CommentGlyphWidget; - private _owner: number; + private _owner: string; private _pendingComment: string; private _localToDispose: IDisposable[]; private _globalToDispose: IDisposable[]; @@ -71,7 +71,7 @@ export class ReviewZoneWidget extends ZoneWidget { private _styleElement: HTMLStyleElement; private _error: HTMLElement; - public get owner(): number { + public get owner(): string { return this._owner; } public get commentThread(): modes.CommentThread { @@ -88,7 +88,7 @@ export class ReviewZoneWidget extends ZoneWidget { private dialogService: IDialogService, private notificationService: INotificationService, editor: ICodeEditor, - owner: number, + owner: string, commentThread: modes.CommentThread, pendingComment: string, options: IOptions = {} @@ -161,7 +161,7 @@ export class ReviewZoneWidget extends ZoneWidget { if (this._commentEditor) { let model = this._commentEditor.getModel(); - if (model.getValueLength() > 0) { // checking length is cheap + if (model && model.getValueLength() > 0) { // checking length is cheap return model.getValue(); } } diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts b/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts index c3a5715b91d..6d7ef69d25f 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts @@ -24,7 +24,7 @@ import { editorForeground, registerColor } from 'vs/platform/theme/common/colorR import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { CommentThreadCollapsibleState } from 'vs/workbench/api/node/extHostTypes'; import { ReviewZoneWidget, COMMENTEDITOR_DECORATION_KEY } from 'vs/workbench/parts/comments/electron-browser/commentThreadWidget'; -import { ICommentService } from 'vs/workbench/parts/comments/electron-browser/commentService'; +import { ICommentService, ICommentInfo } from 'vs/workbench/parts/comments/electron-browser/commentService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IOpenerService } from 'vs/platform/opener/common/opener'; @@ -68,7 +68,7 @@ class CommentingRangeDecoration { return this._decorationId; } - constructor(private _editor: ICodeEditor, private _ownerId: number, private _range: IRange, private _reply: modes.Command, commentingOptions: ModelDecorationOptions) { + constructor(private _editor: ICodeEditor, private _ownerId: string, private _range: IRange, private _reply: modes.Command, commentingOptions: ModelDecorationOptions) { const startLineNumber = _range.startLineNumber; const endLineNumber = _range.endLineNumber; let commentingRangeDecorations = [{ @@ -85,7 +85,7 @@ class CommentingRangeDecoration { } } - public getCommentAction(): { replyCommand: modes.Command, ownerId: number } { + public getCommentAction(): { replyCommand: modes.Command, ownerId: string } { return { replyCommand: this._reply, ownerId: this._ownerId @@ -123,7 +123,7 @@ class CommentingRangeDecorator { this.commentsOptions = CommentingRangeDecorator.createDecoration('comment-thread', overviewRulerCommentingRangeForeground, options); } - public update(editor: ICodeEditor, commentInfos: modes.CommentInfo[]) { + public update(editor: ICodeEditor, commentInfos: ICommentInfo[]) { let model = editor.getModel(); if (!model) { return; @@ -168,14 +168,14 @@ export class ReviewController implements IEditorContribution { private _newCommentWidget: ReviewZoneWidget; private _commentWidgets: ReviewZoneWidget[]; private _reviewPanelVisible: IContextKey; - private _commentInfos: modes.CommentInfo[]; + private _commentInfos: ICommentInfo[]; private _commentingRangeDecorator: CommentingRangeDecorator; private mouseDownInfo: { lineNumber: number } | null = null; private _commentingRangeSpaceReserved = false; - private _computePromise: CancelablePromise | null; + private _computePromise: CancelablePromise | null; private _pendingCommentCache: { [key: number]: { [key: string]: string } }; - private _pendingNewCommentCache: { [key: string]: { lineNumber: number, replyCommand: modes.Command, ownerId: number, pendingComment: string } }; + private _pendingNewCommentCache: { [key: string]: { lineNumber: number, replyCommand: modes.Command, ownerId: string, pendingComment: string } }; constructor( editor: ICodeEditor, @@ -410,7 +410,7 @@ export class ReviewController implements IEditorContribution { this.beginCompute(); } - private addComment(lineNumber: number, replyCommand: modes.Command, ownerId: number, pendingComment: string) { + private addComment(lineNumber: number, replyCommand: modes.Command, ownerId: string, pendingComment: string) { if (this._newCommentWidget !== null) { this.notificationService.warn(`Please submit the comment at line ${this._newCommentWidget.position.lineNumber} before creating a new one.`); return; @@ -508,7 +508,7 @@ export class ReviewController implements IEditorContribution { } - private setComments(commentInfos: modes.CommentInfo[]): void { + private setComments(commentInfos: ICommentInfo[]): void { if (!this.editor) { return; } diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts b/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts index de280198c18..213a134d437 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts @@ -9,13 +9,12 @@ import { IAction } from 'vs/base/common/actions'; import { debounceEvent } from 'vs/base/common/event'; import { CollapseAllAction, DefaultAccessibilityProvider, DefaultController, DefaultDragAndDrop } from 'vs/base/parts/tree/browser/treeDefaults'; import { isCodeEditor, isDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { CommentThreadChangedEvent } from 'vs/editor/common/modes'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { TreeResourceNavigator, WorkbenchTree } from 'vs/platform/list/browser/listService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Panel } from 'vs/workbench/browser/panel'; -import { CommentNode, CommentsModel, ResourceWithCommentThreads } from 'vs/workbench/parts/comments/common/commentModel'; +import { CommentNode, CommentsModel, ResourceWithCommentThreads, ICommentThreadChangedEvent } from 'vs/workbench/parts/comments/common/commentModel'; import { ReviewController } from 'vs/workbench/parts/comments/electron-browser/commentsEditorContribution'; import { CommentsDataFilter, CommentsDataSource, CommentsModelRenderer } from 'vs/workbench/parts/comments/electron-browser/commentsTreeViewer'; import { ICommentService, IWorkspaceCommentThreadsEvent } from 'vs/workbench/parts/comments/electron-browser/commentService'; @@ -256,7 +255,7 @@ export class CommentsPanel extends Panel { this.refresh(); } - private onCommentsUpdated(e: CommentThreadChangedEvent): void { + private onCommentsUpdated(e: ICommentThreadChangedEvent): void { const didUpdate = this.commentsModel.updateCommentThreads(e); if (didUpdate) { this.refresh();