Add active comment thread.

This commit is contained in:
Peng Lyu
2019-04-28 12:30:29 -07:00
parent accab2eaa7
commit 2884d2239b
4 changed files with 24 additions and 0 deletions

View File

@@ -99,6 +99,17 @@ export class ExtHostComments implements ExtHostCommentsShape {
return Promise.resolve(commentControllerHandle);
}
$onActiveCommentThreadChange(commentControllerHandle: number, threadHandle: number): Promise<number | undefined> {
const commentController = this._commentControllers.get(commentControllerHandle);
if (!commentController) {
return Promise.resolve(undefined);
}
commentController.$onActiveCommentThreadChange(threadHandle);
return Promise.resolve(threadHandle);
}
$provideCommentingRanges(commentControllerHandle: number, uriComponents: UriComponents, token: CancellationToken): Promise<IRange[] | undefined> {
const commentController = this._commentControllers.get(commentControllerHandle);
@@ -563,6 +574,7 @@ class ExtHostCommentController implements vscode.CommentController {
}
public inputBox: ExtHostCommentInputBox | undefined;
public activeCommentThread: ExtHostCommentThread | undefined;
public activeCommentingRange?: vscode.Range;
public get handle(): number {
@@ -610,6 +622,10 @@ class ExtHostCommentController implements vscode.CommentController {
}
}
$onActiveCommentThreadChange(threadHandle: number) {
this.activeCommentThread = this.getCommentThread(threadHandle);
}
getCommentThread(handle: number) {
return this._threads.get(handle);
}