dispose empty comment thread when collapse.

This commit is contained in:
Peng Lyu
2019-05-23 16:37:33 -07:00
parent a9e31b19d7
commit 346da6b01a
5 changed files with 36 additions and 0 deletions

View File

@@ -173,6 +173,14 @@ export class ExtHostComments implements ExtHostCommentsShape {
return Promise.resolve(commentControllerHandle);
}
$deleteCommentThread(commentControllerHandle: number, commentThreadHandle: number) {
const commentController = this._commentControllers.get(commentControllerHandle);
if (commentController) {
commentController.$deleteCommentThread(commentThreadHandle);
}
}
$provideCommentingRanges(commentControllerHandle: number, uriComponents: UriComponents, token: CancellationToken): Promise<IRange[] | undefined> {
const commentController = this._commentControllers.get(commentControllerHandle);
@@ -764,6 +772,16 @@ class ExtHostCommentController implements vscode.CommentController {
return commentThread;
}
$deleteCommentThread(threadHandle: number) {
let thread = this._threads.get(threadHandle);
if (thread) {
thread.dispose();
}
this._threads.delete(threadHandle);
}
$onCommentWidgetInputChange(uriComponents: UriComponents, range: IRange, input: string) {
if (!this.inputBox) {
this.inputBox = new ExtHostCommentInputBox(this._proxy, this.handle, URI.revive(uriComponents), extHostTypeConverter.Range.to(range), input);