comment service fetch

This commit is contained in:
Peng Lyu
2018-04-17 17:07:29 -07:00
parent 801d3eaacf
commit aed94aee0c
9 changed files with 62 additions and 22 deletions

View File

@@ -833,7 +833,7 @@ export interface ExtHostProgressShape {
export interface ExtHostCommentsShape {
$provideComments(handle: number, document: UriComponents): TPromise<modes.CommentThread[]>;
$provideNewCommentRange(handle: number, document: UriComponents): TPromise<modes.NewCommentAction>;
$provideNewCommentRange(handle: number, document: UriComponents): TPromise<modes.NewCommentAction[]>;
$provideAllComments(handle: number): TPromise<modes.CommentThread[]>;
}

View File

@@ -87,7 +87,7 @@ export class ExtHostComments implements ExtHostCommentsShape {
}
$provideNewCommentRange(handle: number, uri: UriComponents): TPromise<modes.NewCommentAction> {
$provideNewCommentRange(handle: number, uri: UriComponents): TPromise<modes.NewCommentAction[]> {
const data = this._documents.getDocumentData(URI.revive(uri));
if (!data || !data.document) {
return TPromise.as(null);
@@ -97,8 +97,7 @@ export class ExtHostComments implements ExtHostCommentsShape {
let provider = this._providers.get(handle);
return provider.provideNewCommentRange(data.document, token);
})
.then(newCommentAction => convertNewCommandAction(newCommentAction, this._commandsConverter));
.then(newCommentActions => newCommentActions.map(newCommentAction => convertNewCommandAction(newCommentAction, this._commandsConverter)));
}
}